CSC 104 Test #1
Time allotted: 45 minutes
No aids permitted.
Since time is short, be careful not to get stuck on one question to the exclusion of others. The amount of marks or answer-space allotted does not indicate how long it will take you to complete the question, nor does the size of the answer-space indicate the size of the correct answer.
Answer all questions. Answer questions in the space provided.
Do not open this booklet until you are instructed to.
Give an example of a problem-solving task in which these phases overlap, stating what part of "carry out the plan" would typically be performed during or after what part of "evaluate the solution".
For example, I (ajr) am going to print test papers which have students' names pre-printed on the covers. This involves writing a little program. While the tests are printing, I'm going to be standing by the printer (for security!) and I will be examining the tests as they print, to make sure that everything is coming out right. I will be evaluating the correctness of my little program while more batches are still printing and more batches are yet to be printed. This is useful because if there is something wrong, I would like to catch it early and not actually go through with the rest of the printing until I fix my little program.
Solution: Most likely answer is: RAM
Other sorts of descriptions of main memory will be accepted, but not just the word "memory".
(This part is worth only 1 of the 3 points for this question.)
b) Give one example of a kind of "secondary storage".
Some solutions (pick any one): disks, floppy disks, tape, punch cards, USB flash drive. (not an exhaustive list)
as a numeric expression in a text format suitable for use in a typical programming language (such as Python). (The raised "a+b" indicates exponentiation. You can use "**" as the exponentiation operator.)
Extra parentheses are fine. However, square brackets ("[" and "]") mean something different, in python and in almost all programming languages (although what they mean differs between programming languages -- in Python it indicates list literals); students who used any square brackets did not get full marks for this question.
Write absolute path names to specify the following three files:
a) the "cat" program (on the left)
Solution: /bin/cat
b) the "z" file (lowest on the diagram)
Solution: /u/csc104h/summer/pub/x/z
c) my (ajr's) "hello" file
Solution: /u/ajr/hello
If your current directory is my home directory (the ajr directory), write relative path names to specify the following three files:
d) my "hello" file
Solution: hello
e) my "checkq5" file
Solution: 104/checkq5
f) the "u" directory near the top
Solution: ..