Wednesday, February 24, 2010

Lab 6

You can put all this (except 7) into a single C++ program.
1) Take in two numbers. Determine the minimum, maximum, and average of these numbers and print them out.

2) Print out your name 100 times, one on each line.

3) Print out the numbers 1 to 100.

4) Print out the even numbers in the range of 2 to 100.

5) Print out the odd numbers in the range of 1 to 99.

6) Loop forever, asking the user for the grades of midterm and final, and print out, each time, the average of these two values.

7) For your own sakes, step through the code in this example:
"Enter even: use while to force correct input 02-22-10"

8) Research the do-while loop. Using a do-while loop, repeatedly ask the user for a password. If it is "swordfish", proceed. Otherwise, loop around again.

No comments:

Post a Comment