Chris Pollett>Old Classes>CS112, Spring 1998>Hw1

Computer Science 112
HW#1

        Due by 11:59 pm, Tuesday, Jan 27, 1998. Read to page 120 in Standish.

  1. Write a program which does the following: First, it prints
               Program Adder.

                Please input first number
    After which it gets characters one at a time from the keyboard inserting them into a
    list. If either there are no characters input followed by a return or some non-number is entered the program terminates and prints "Invalid input". The input for the first number is terminated by a return. The program proceeds to ask "Please input second number" and stores it in the same way. The program then uses the grade-school algorithm (The method you used in grade-school to add numbers) to add these numbers and prints the "Sum of your two numbers is:" followed by the sum. Your program should work on several hundred digit numbers. Submit this program as hw1p1.c
  2. Problem 16. on page 83 of Standish. Submit this program as hw1p2.c

  3. Problem 3. on page 129 of Standish. Submit this program as hw1p3.c

  4. Honors. This problem only has to be done by students enrolled in this class for honors credit. Problem 15 on page 82 in Standish. Submit this problem as hw1ph.c