COSC 1320 C Programming
Weekly Hands-on Assignment
Weekly #5
Exercise on basic if statements using logic operators and the switch statement
Point value 25 points
Overall:
Write a program that will convert an input value and display the results of the
conversion.
In Detail:
1. Have a comment section at the top of the program similar to the following:
/*
Your Name
The Date
Week 5 Assignment
*/
2. Write a C-Language program that will present a basic menu with three
selections:
1- Convert fahrenheit to Celsius
2- Convert pounds to kilograms
3 Convert miles to kilometers
And will accept a number (1-3) as input.
3. Based on the number the user entered, you Must use a switch statement to do
the requested conversion.
Be sure and include the 'default' case that will output a message to the user
(you) that you didn't enter 1, 2, or 3.
4. You should ask for the input, do the conversion, and produce the output in each
case of the switch statement.
5. You must check the input according to the following requirements:
1. The temperature fahrenheit must be >= 0 and <= 212
2. The value for pounds must not be < 0 or > 1000
3. The miles must be from 1 to 300
In each case, if the user (you), does not enter a number within the designated
limits, set the value to the maximum allowed, then do the conversion and output
the result.