Assignment 5

Due Monday 8 October at 1am.

The purpose of this assignment is to practice using loops.

You will write a unit conversion program where the user can specify the parameters of a conversion table – what value it starts with, where it ends, and how much to increase each time.

Below are some sample runs:

Enter start: 1.5
Enter stop: 2.5
Enter step: 0.2

Miles  Kilometers
 1.5    2.41401
 1.7    2.73588
 1.9    3.05775
 2.1    3.37961
 2.3    3.70148

Another run:

Enter start: 10.2
Enter stop: 20
Enter step: 3

Miles  Kilometers
 10.2   16.4153
 13.2   21.2433
 16.2   26.0713
 19.2   30.8993

You should do some simple error-checking:

Enter start: 19
Enter stop: 0
ERROR: stop must be greater than start.
Enter start: 7
Enter stop: 24
Enter step: 0
ERROR: step must be greater than zero.

Save your program to a05/table.cpp and sync with git.