Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will write a C program that converts the Celsius temperature to the Fahrenheit and Kelvin temperature degrees. In this lab exam, you are
You will write a C program that converts the Celsius temperature to the Fahrenheit and Kelvin temperature degrees. In this lab exam, you are required to write a main to take the temperature in Celsius degree (of type float) and a character for the which converter should run from the user and call the desired functions according to the user's choice: If the user wants to convert Celsius to Fahrenheit, user should enter 'F' or 'f from the keyboard, and call Fahrenheit() function and display the result in main function. If the user wants to convert Celsius to Kelvin, user should enter 'K' or 'k' from the keyboard, and call Kelvin() function and display the result in main function. This process should be repeated 5 times (you have to use loop) for 5 different Celsius values. Main should display the results. Also, you should calculate the average of Fahrenheit values and average of Kelvin values in the main function and display it. Write two functions named "Fahrenheit" and "Kelvin" based on the information given below: Fahrenheit() function should receive a float number (temperature in Celsius), convert the temperature to Fahrenheit and returns the result to the main function. Kelvin function should receive a float number (temperature in Celsius), convert the temperature to Kelvin and returns the result to the main function. Hint: For calculation you may use the following conversion formula: C F-32 100 180 K-273 100 Please examine the sample run carefully and write your program exactly like the sample run. Sample Run is on the second page. SAMPLE RUN: Welcome to the temperature converter Please enter the temperature in Celsius :30.0 Please enter F/F to convert to Fahrenheit or enter K/k to convert to Kelvin: F 30.00 Celsius is 86.00 Fahrenheit. Please enter the temperature in Celsius :14.0 Please enter F/f to convert to Fahrenheit or enter K/k to convert to Kelvin K 14.00 Celsius is 287.15 Kelvin. Please enter the temperature in Celsius :1.0 Please enter F/f to convert to Fahrenheit or enter K/k to convert to Kelvin : k 1.00 Celsius is 274.15 Kelvin. Please enter the temperature in Celsius :42.0 Please enter F/f to convert to Fahrenheit or enter K/k to convert to Kelvin : : f 42.00 Celsius is 107.60 Fahrenheit. Please enter the temperature in Celsius :5.0 Please enter F/f to convert to Fahrenheit or enter K/k to convert to Kelvin: F 5.00 Celsius is 41.00 Fahrenheit. The average of Fahrenheit temperature values: 78.20 The average of Kelvin temperature values: 280.65 Press any key to continue...
Step by Step Solution
★★★★★
3.36 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Compile and run thi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started