Difference between revisions of "CSC103 Final Exam"

From dftwiki3
Jump to: navigation, search
Line 6: Line 6:
  
 
Make sure you reference all work/resources you use to answer the questions below.
 
Make sure you reference all work/resources you use to answer the questions below.
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
  
 
==Problem #1==
 
==Problem #1==

Revision as of 14:15, 7 October 2008

This final exam is take-home. It is open-books, open-notes, and open-Web. It is due a week after it is made available, at 9:00 a.m. on Wed. October 15, 2008.

You cannot discuss the details of this exam with anyone except your instructor. The TAs are not allowed to help you out in any way. No question will be answered in person after 10:20 a.m. on 10/08/08. Instead, if you have questions regarding the exam, you are to send them via email to [1], and the question and its answer will be broadcast back to the hole class via email.

The exam is given under the rules of the Smith College Honor Code.

Make sure you reference all work/resources you use to answer the questions below.





Problem #1

Question 1

Write a javascript program based on the Javascript Lab we did in class that computes the volume of all the grains of rice that would have to be put on the 64th square of a chessboard, if we were to start putting 1 grain on the first square, 2 grains on the second square, 4 grains on the next, 8 grains on the next, and so on, doubling every time the number of grains. You may want to read the problem statement in the lab again!

We will assume that the volume of a grain of rice is 2 mm3 (cubic millimeters).

Your program should output the number of grains of rice on the 64th square only, and their total volume expressed in cubic miles. Its output should look something like this:

CSC103 Rice Chessboar1.png

Of course the numbers shown in the image above are not the correct numbers your program should output!


Some important conversion equations you will need:

1 cubic meter (m3) contains 1,000,000,000 cubic millimeters (mm3).

1 cubic mile contains 4,168,181,825.5 cubic meters.

Note, when you enter a value in a variable in javascript, you do not use comas to isolate groups of 3 digits. For example, if you wanted a variable called factor to contain the last conversion number above, you would write:

var factor = 4168181825.5;

Copy/paste the code of your javascript program in a Word document (or some other word processor of your choice) which you will hand back in on the due date.

Note: if you want to create a supscript in html, you use the <sup> tag. Here is now we would write mm3 in html:

       mm<sup>3</sup>

Question 2

Write a second javascript program (modifying the first one) that computes the volume of all the grains of rice that would have to be put on all 64 squares of the the chess board, that is the volume of the sum of the grain on the first square, plus the grains on the second square, third, fouth, etc., all the way to the 64th square.

Again, your answer should be in square miles, and the output of your javascript program should look something like this:

CSC103 Rice Chess 2.png

(Here again I used totally arbitrary numbers for the grains of rice and the volume. Your answers will be totally different!)

Cut and paste your javascript program in your Word document.

Problem #2

First watch the first 45 minutes (until the question/answers section) of the Google Video "When computers were human" of a talk given by Prof. David Grier on human computers.

Then answer the following questions:

  1. Computer Scientists know of several key women instrumental in the first computer programming languages or programming the first computers. Ada Lovelace is one of them. Grace Mary Hopper another one. However the Grier's talk shows that women were involved with computing in different ways. Expend on two different examples illustrating how women have been instrumental in the area of "computing."
  1. What was the purpose of having human computers in the beginning of the 20th century?

Please limit your answers to a maximum of one page of typed information for both answers.

Problem #3

The textbook for the class illustrates a 1-bit memory cell with a circuit containing an inverter, an AND gate, and an OR gate. The circuit below is similar, except that it contains an extra inverter between the AND and the OR gate.

Does this circuit behave as a 1-bit memory? In other words, can we activate one of the inputs to "store a 1" in the memory, and force its output to 1, and can we activate the other input to "store a 0" in the memory, and force its output to 0?

Clearly explain why you think this circuit is a memory bit, or why you think it cannot be used as one.

CSC103 MemoryBitOption.png