Assignment 3

This assignment is worth 10 points.

When you finish this assignment you should be able to

Write a program which will convert units. The program should begin by prompting the user for two integers which represent the relationship between two units. For example, if the user were working in inches and feet, the values would be 12 and 1, or if the user were working in meters and decimeters the values would be 1 and 10. I will refer to these as unitsA and unitsB. These must be read in as an integer

The progrm should then request the measurement of an item in terms of unitB. This is a floating point number.

You should compute the measurement of the item in terms of unitA. The results should be presented in the nearest integer.

For example, if unitA = 10 and unitB = 2, and the measurement is .5 your program should compute an answer of 10/2*.5 = 2.5 and should output 3.

Finally your program should identify when unit is larger. In this case since it takes 10 of unitA to be a unitB, the program should print that "Unit B is larger".

Example:

Enter the factor for unit A => 10
Enter the factor for unit B => 2
Enter the measurement (in terms of unit B) of the item => .5

Length of the item in terms of unit A is 3
Unit B is larger.

When you are finished attach a copy of your source code (.C or .cpp file) to an email message to danbennett360@gmail.com.

Make sure you include your name in the email message. Include "Homework 4" in the subject of your message.