Agatha Haddock (112233445)
COMP-202A, Section 0 (Fall 2010)
Instructor: Cuthbert Calculus
Assignment 1, Question 3 (b)
Compile-time errors:
-Line 27: missing operator; 4(z/x) should be 4*(z/x)
-Line 27: loss of precision; meaninglessexpression should be a double, not int.
Run-time errors:
-Line 27: since x may have value 0 (if user is born in 1989), z/x divides by 0.
Fix it by restricting input or removing z/x.
Logical errors:
-Line 24: (x + y + z /3) should be (x+y+z)/3.0 to compute the average without
losing precision. This counts as TWO logical errors. To fix them, you add
() and change 3 to 3.0.