Programming Homework 2

This assignment is due by the start of class on Friday, February 14. You are encouraged to do this homework with your partner, and you are welcome to get help on it during the lab time Tuesday.

Submit a printout of your solution to the problem below. Make sure that your name and account name are in comments at the top; for example,

/* Description: Programming Homework 2
   Filename:    program1.cpp
   Account:     CSC121xx
   Author:      Your Name
   Date:        Today's Date
*/
If you work with your partner, you only need to submit one copy of the program; be sure that both of your names are listed in the comments (the account name should be the one in which the solution is stored).

You should start by copying the folder called Program2 from my public directory, I:\CSC121\public\Howard\, into your own folder, I:\CSC121\CSC121xx\. When you open your copy of the project, by following the same instructions as for the labs, you should see the comments shown above; modify them as needed and continue writing your program.

Starting with this assignment, you will be graded on program style as well as correct output. Style points include proper use of functions to break up your code, indentation of function and loop bodies to make the structure of your code easy to read, and the inclusion of comments to identify the parts of the program and to state the required pre- and post-conditions for each function other than main. A program without all of these style points will not receive full credit.

The assignment is to produce a program that requests two numbers, a and b, and shows two ways of counting up to a×b: first counting by a's, and then counting by b's. For example, if the user enters the numbers 3 and 5, then the program should first clear the screen and display the following on the console:

Counting by 3 to 15:
3
6
9
12
15
Hit <Enter> to continue
After the user hits enter, it should clear the screen and display the following:
Counting by 5 to 15:
5
10
15
Hit <Enter> to continue
Finally, it should display a farewell message and wait for the user to hit enter to quit.

Your program should consist of the following four functions: