Confidential Teaching Materials
Homework 2 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] 25 points
Write the headers for the following modules. You DO NOT have to write the code for the modules.
a) A module that reads in a name and GPA and returns these pieces of information to the main
algorithm.
b) A module that detemines the two roots of a quadratic equation, given the equation coefficients A,
B, and C. (You can assume that the coefficients A, B, and C will only produce real roots.)
c) Given a person’s birthday (month, day, and year), returns a string representing the day of the week
on which the person was born.
d) A module that, passed in a number, prompts the user for a second number and adds the two
numbers together, returning the result to the main algorithm.
e) A module that will return the distance between two coordinates on a two-dimensional Cartesian
plane. (Each coordinate has an x and a y component).
[c1] 25 points
Sample Answers:
GRADING CRITERIA:
a) -1 for not making it a procedure (pro)
-2 for not having the name parameter (npo)
b) -1 for not making it a procedure (pro)
-2 for not having the A, B, and C parameters (npo)