are you allowed to use switches yet, what about while loops?
write two functions, one for Celsius, one for Fahrenheit,
Code:
double MyFunction( double input)
{
return input / 34;
}
that is just an example of a shorter from of doing math in a function and returning it at the same time.
You know what condition loops have to have in order to enter them, you know how to change a variable to make it what you need to have it in order for it to leave a while loop, You know how to use a switch and a char as an int. you know how to use printf and return values from functions together, simultaneously in order to print out the results of the return value, you know how to use printf in general. piece of cake,
one while loop
one switch,
two functions
two vars: 1 char,1 double
and a few printf's for good measure
mixed logically
done.
covers the everything
needing an option to quit most always suggest a loop, if not always (otherwise the program would just process then quit on its own). Some teachers like to be "tricky" sometimes to see who is awake and who is not.
and you need to check your math on the conversions
Temperature Conversion Celsius to Fahrenheit | F to C or C to F | The Old Farmer's Almanac
so you'll end up with something that might look like this
Code:
$ ./Kayla_Hoyte_Temperature_converter
Enter a selection to convert temperatures.
1. Celsius to Fahrenheit
2. Fahrenheit to Celsius.
3. Quit
1
enter temperature in Celsius
-30
Celsius -30.00
Fahrenheit -22.00
Enter a selection to convert temperatures.
1. Celsius to Fahrenheit
2. Fahrenheit to Celsius.
3. Quit
2
enter temperature in Fahrenheit
40
Fahrenheit 40.00
Celsius 4.44
Enter a selection to convert temperatures.
1. Celsius to Fahrenheit
2. Fahrenheit to Celsius.
3. Quit
3
addio