Part 2 Module Write 2 Short Programs Thing Convert Two Temperatures Values Type Double Cel Q43818434
In Part 2 of this module you will write 2 short programs that do the same thing – convert two temperatures values of type double from Celsius to Fahrenheit: • Normal body temperature of 37.0 °C. • Water boiling temperature of 100.0 °C. Use the Celsius-to-Fahrenheit formula: T: – 1.8 * TC +32 The difference between the two short programs is that in the first you allocate memory on the stack, while in the second you allocate memory in the heap. Both programs should output the following: The normal body temperature is 98.600000 OF Water boils at a temperature of 212.000000 of prog1.c: allocate memory on the stack The first program should be called prog1.c. All needed variables should be allocated on the stack. You can do everything in main() or you can write a helper function called celsiusToFahrenheit that does the conversion: double celsiusToFahrenheit (double); prog2.c: allocate memory on the heap The second program should be called prog2.c. Allocate needed memory of all variables on the heap. To allocate memory on the heap use the function malloc defined in stdlib.h.. As in progi.c you can do everything in main() or you can write a helper function called celsius ToFahrenheit that does the conversion: double *celsiusToFahrenheit(double*); Show transcribed image text In Part 2 of this module you will write 2 short programs that do the same thing – convert two temperatures values of type double from Celsius to Fahrenheit: • Normal body temperature of 37.0 °C. • Water boiling temperature of 100.0 °C. Use the Celsius-to-Fahrenheit formula: T: – 1.8 * TC +32 The difference between the two short programs is that in the first you allocate memory on the stack, while in the second you allocate memory in the heap. Both programs should output the following: The normal body temperature is 98.600000 OF Water boils at a temperature of 212.000000 of prog1.c: allocate memory on the stack The first program should be called prog1.c. All needed variables should be allocated on the stack. You can do everything in main() or you can write a helper function called celsiusToFahrenheit that does the conversion: double celsiusToFahrenheit (double); prog2.c: allocate memory on the heap The second program should be called prog2.c. Allocate needed memory of all variables on the heap. To allocate memory on the heap use the function malloc defined in stdlib.h.. As in progi.c you can do everything in main() or you can write a helper function called celsius ToFahrenheit that does the conversion: double *celsiusToFahrenheit(double*);
Expert Answer
Answer to In Part 2 of this module you will write 2 short programs that do the same thing – convert two temperatures values of typ…
OR