shark amongst salmon

Drops in the bit bucket.
May 23
Permalink

My teacher makes NO sense.

/* Maus Stearns CIS 15 AGThis program converts Fahrenheit to Celsius then Farenheit to Rankine and then Celsius to Kelvin.*/
#include
//This converts fahernheit to celsisus, this also returns the value of the celsius in order to calculate celsius to kelvin later
float f2c (float far) { const float fahren2cel = 100 / 180.0 ; const int thirtytwo = 32; float celsius = (far - thirtytwo) * fahren2cel; printf(“Fahrenheit to Celsius\t\t%.2f\n”, celsius); return(celsius);}
//Same princepal here but the return is void because the value isnt going to be used for anything else
void f2r (float far) { const float addednumber = 491.67; const int thirtytwo = 32; float rankine = (far -thirtytwo) + addednumber; printf(“Fahrenheit to Rankine\t\t%.2f\n”, rankine ); }//This one grabs the result ouput from function f2c to calculate the kelvin
void c2k (float result) { const float addednumber2 = 273.16; float kelvin = result + addednumber2; printf(“Celsius to Kelvin\t\t%.2f\n”, kelvin); }
//Main just grabs the data and also helps move the variable over
int main () { float far; printf(“This Application takes the tempature in Fahrenheit and converts it to Celsius, Rankine, and then the Celsius to Kelvin\n”); printf(“Please enter the Fahrenheit to calculate: “); scanf (“%f”, &far); float result = f2c(far); f2r(far); c2k(result);}

He docks me for putting the scanf information in the main function…. Die evil teacher…