Confidential Teaching Materials
Homework 1 Criteria, Page 1 of 4
Homework 1 Grading Criteria
Note: To receive any credit whatsoever, your answers must be legible and readily readable in the
judgment of the grader. Add brief explanatory comments as necessary to make sure your
answers are clear and unambiguous to the grader.
[p1] 16 points
List four built-in data types, and give an example of a value each could hold.
[c1] 16 points
Sample Answers:
GRADING CRITERIA:
[p2] 20 points
If you wanted to store information about the following, which data types would you use, and why? To
receive full credit, you must offer a brief explanation.
a) A person’s name
b) A person’s social security number (not including the dashes)
c) A person’s grade point average
d) Your letter grade in a class
e) Whether or not you have passed the Regent’s exam
[c2] 20 points
Sample Answers:
Confidential Teaching Materials
GRADING CRITERIA:
[p3] 10 points
What is the difference between a constant and a variable? Give an example of when each should be used.
[c3] 10 points
Sample Answer:
GRADING CRITERIA:
[p4] 20 points
For each of the following, provide a complete variable or constant declaration as appropriate.
a) The number of completed hours required to be classified as a sophomore.
b) A person’s name (read in from the user)
c) A counter for the amount of time you spend working on this class, in hours.
d) The number of feet in a mile.
e) Whether or not you need to do laundry.
[c4] 20 points
Homework 1 Criteria, Page 3 of 4
[p5] 12 points
Given the following code:
if (num_1 > num_2) ___ (num_2 < num_3) then
print (“I”)
else if (num_3 >= num_1) then
print (“LOVE”)
else
print (“Computing”)
endif
What would be printed if:
a) num_1 is 12, num_2 is 15, num_3 is 32, and ___ is AND?
b) num_1 is 2, num_2 is -1, num_3 is 2, and ___ is OR?
c) num_1 is 3, num_2 is 4, num_3 is 5, and ___ is XOR?
d) num_1 is 2, num_2 is 2, num_3 is 2, and ___ is AND?
[c5] 12 points
-3 (x4) for each incorrect answer (wra)
[p6] 20 points
Write an algorithm to do the following:
0. Prompt the user for two numbers
1. Read in two numbers
2. Compute the sum of the numbers
3. Print the sum of the numbers
4. If the sum is greater than 1000 print “Wow, that’s a big number”; otherwise, print
“That number isn’t too big”
Confidential Teaching Materials
[c6] 20 points
Sample Solution:
GRADING CRITERIA:
-2 (x3) for not having each number variable (nav)
-1 for not having the correct type ( Num) (num)
-2 for not prompting for the two numbers (wro)
-2 for not computing the sum properly