CSc 101: Section 16 – Review

The last section! No new material here. Instead, this contains a number of practice problems to help you prepare you for the final exam. Your section leader will guide you through some of these problems. Please ask questions if you have them!

Problem 1 - Algorithms

Recall our definition of Computer Science:
The process of finding solutions to difficult or complex issues by defining a set of steps or instructions to be run by a computer for accomplishing a particular task
When we write out these steps, there are called algorithms. Algorithms can be written in many ways, and in class we talked about writing them both as instruction outlines and flow diagrams. For each of the below, come up with an algorithm to go from the starting point to the solutions.
  • Starting point: Dirty car. Goal: Washed and clean car inside-out
  • Starting point: Final exam coming up, have not studied. Goal: Fully studied and well-prepared for exam


Problem 2 - Info Representation

Recall that one way text is represented on a computer hard drive is in ASCII format. If you need a refresher, go back and reference the lecture slides. Convert the below lines of text to both the DECIMAL and BINARY ASCII representation:
  • HELLO WORLD
  • you are 30 years old


Problem 3 - Info Representation

Below are several lines of binary data. Convert these to their corresponding ASCII text:
  • 01101001 00100000 01101100 01101001 01101011 01100101 00100000 01100011 01110011
  • 01101101 01111001 00100000 01101110 01100001 01101101 01100101 00100000 01101001 01110011 00100000 01100010 01100101 01101110


Problem 4 - BMP

When talking about how information is represented earlier this semester we also talked about image files. Specifically, we created some BMP image files by-hand. Create a BMP image that looks like the one to the left when opened up in an image editor:


Problem 5 - Variables and Conditions

Below is a small snippet of processing code with three variables declared at the beginning. Determine the numeric value that will be stored in each of these variables after this code as been executed.
int coordA = 100;
int coordB = 200;
int coordC = 50;
if (coordB > coordC) { 
  coordA = coordA + 50;
} else if (true) {
  coordC = coordC + 10;
}
if (coordA > coordB) {
  coordB = 0;
} else {
  coordC += 30;
  coordB -= 20;
}


Problem 6 - Variables and Loops

Below is a small snippet of processing code with three variables declared at the beginning. Determine the numeric value that will be stored in each of these variables after this code as been executed.
int num1 = 100;
int num2 = 200;
int num3 = 50;
for (int i = 0; i < 10; i += 1) {
  num1 += 10;
  num3 = 5;
}
for (int j = 2; j < 14; j += 2) {
  num22 += 2;
}


Problem 7 - Computer Organization

Recall the many components of a computer that we discussed awhile back in class. Draw a diagram similar to the one that was showed on the slides in class of the components of a computer. Make sure to include the following components at least: CPU, RAM, Hard Drive, Video Card, monitor, keyboard, and mouse. Draw arrows between the components that directly communicate/interact with eachother.


Problem 8 - Computer Networking

When designating the layout of a computer network, this is done with a network diagram. Network diagrams are composed of icons of nodes, routers, switches, and the internet. Lines indicate connections between the parts of the network. Draw a computer diagram that has 4 nodes connected to a single router, and the router gives each of the nodes access to the internet.


Problem 9 - Security

We discussed many types of securirity attacks made on users of computers. Describe three of the attacks that we talked about. For each one, suggest a specific way that a user could protect themselves from such an attack.


Problem 10 - Strings

Below is a string variable in Procesing.
String alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
test
ing
Write a snippet of python code that prints out every-other letter in this string. You should do this using a for-loop. You will also need to use the length() and charAt() methods to loop through and extract individual characters.


Solutions will be posted the day after section

Download Solutions