Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: You will write a C program that converts the Celsius temperature to the Fahrenheit and Kelvin temperature degrees. In this lab exam, you are

image text in transcribed
image text in transcribed
Question: 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: Fahrenheito 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: F -32 -273 100 180 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 3e.ee Celsius is 86.00 Fahrenheit. Please enter the temperature in Celsius :14.0 Please enter Flf 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.80 Celsius is 274.15 Kelvin. Please enter the temperature in Celsius :42.0 Please enter F/4 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.88 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

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago

Question

=+ d. a professor deciding how much to prepare for class

Answered: 1 week ago