Practice: More Looping

Take out a piece of paper. We’ll be programming on paper.

For the following programming questions, I’d like you to follow the programming algorithm.

1) Read and understand the problem

2) Create the comment stating the problem.

3) Insert the Java boilerplate.

/** Program that ...
 * @author Cam Moore
public class ProgramName {
  /** Does something.
   * @param args the command line arguments.
  public static void main(String[] args) {

4) Write the steps in pseudo code.

5) Refine the pseudo code.

Problem 1

Write a program that asks the user to enter floating point numbers between 1 and 100 and calculates the average of the numbers. When the user enters a number out of the range the program should calculate the average and stop.

Problem 2

Write a program that counts down from 100 to 0 by fives and prints the numbers as it goes.

Problem 3

Write a program that prints out the even numbers from 22 to 44. Do not use any branching statements.

Show me your code before you leave