Programming Assignment 03


Due: Week of Sep. 12 in lab


  1. Problem: Write a java program to help teach multiplication to children. Generate two random numbers a and b between 0 and 10. Prompt the user for the answer to a*b. Report whether their answer is correct. Name the file and program ch1sec3prob00.java. Worth 20pts. Use standard input to get the integers from the user. Assume the user provides valid input.
    Examples:
  2. Problem 1.3.5 on page 77 of your book. Name the file and program ch1sec3prob05.java. Worth 20pts. Output good error messages for incorrect input values and not providing the correct amount of inputs to the program; output a single value otherwise. You do not need to handle NumberFormatExceptions.
    Examples:
  3. Problem 1.3.28 on page 81 of your book. Name the file and program ch1sec3prob28.java. Worth 40pts. Input from the command line and Output a single number. Hint: This code requires a loop.
    Examples:
  4. Problem 1.3.30 on page 81 of your book. Name the file and program ch1sec3prob30.java. Worth 20pts. Output a list of numbers each on their own line as described. Do not use Math.pow, it is not appropriate for integers, as doubles represent a different range of values inaccurately. Hint: Stop your loop 1 iteration early to avoid "integer overflow".
    Examples:
  5. Bonus. Write a bank account tracker that starts with $0 in the bank account. Prompt the user to alter their account (positive numbers will be deposits and negative numbers are withdrawals/charges). If they enter 0, quit the program. Worth 20pts. Display all money values nicely. Your program must handle incorrect input as well. Name your file and program ch1sec3bonus.java. Use standard input to get the alterations from the user.
    Examples: