You will write a C program that converts the Celsius temperature to the Fahrenheit and Kelvin...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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... 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...
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Calculate the following ratios from the data given below: 1. Debt ratio 2. Debt service coverage multiples 3. Interest coverage Balance Sheet 12/31/2014 Assets Cash..$575,000 Short-term...
-
Besides acting as mechanical barriers, the skin epidermis and mucosae of the body have other attributes that contribute to their protective roles. Cite the common body locations and the importance of...
-
Dorsey Company manufactures three products from a common input in a joint processing operation. Joint processing costs up to the split-off point total $350,000 per quarter. The company allocates...
-
a. Describe how an express warranty is created. b. Describe how an implied warranty of merchantability is created. c. Describe how an implied warrant of fitness for a particular purpose is created.
-
EZ-Credit, Inc., has $80 million in consumer loans with an average interest rate of 13.5 percent. The bank also has $64 million in home equity loans with an average interest rate of 9 percent....
-
* Select the jobs of the operating system many answers Manage CPU and Memory Provide computer with power Provide user interface Cool down the computer
-
Martha died this year with a net allowable capital loss for the year of death of $100,000. She had income from all sources of $5,000 in the year of death, $30,000 last year, and $27,000 two years...
-
The headline "I Was Gaga's Slave" appeared in the New York Post. Pop superstar Lady Gaga, whose real name is Stefani Germanotta, employed Jennifer O'Neill as a personal assistant for 13 months. Ms....
-
Provide two examples of personal expenses that are deductible on an individuals tax return.
-
Which of these includes the benefits of teamwork? Organizational enhancement Self-development and growth Helps in providing mutual support All of the above
-
How does motivation and intention play a role, for both you and your coworker
-
Which of these teams is formed to assist the permanent teams? Supervised teams Work teams Temporary teams Management teams
-
What is needed in order to deduct a business expense on a tax return?
-
Q#1. a. Give an example of a function g(x) that is continuous for all values of x except x = -1 where it has a non-removable discontinuity. Explain how you know that g is discontinuous there and why...
-
-4 1 9. Let A = Find A-1, (A") and verify that (A")= (A-1)".
-
Use properties of the trigonometric functions to find the exact value of each expression. Do not use a calculator. sin 40 tan 40 cos 40
-
True or False. The eccentricity e of any conic is c/a where a is the distance of a vertex from the center and c is the distance of a focus from the center.
-
Chris gets paid once a month and contributes $200 each pay period into his 401(k). If Chris plans on retiring in 20 years, what will be the value of his 401(k) if the per annum rate of return of the...
-
Suppose that the range of the strong interaction were suddenly increased by 20 orders of magnitude, with all other interactions unchanged. Describe the changes that might occur in the structure of...
-
Explain why friction is not considered a fundamental interaction.
-
An \(8.20-\mathrm{kg}\) object is sliding across the ice at \(2.34 \mathrm{~m} / \mathrm{s}\). An internal explosion occurs, splitting the object into two equal chunks and adding \(16 \mathrm{~J}\)...
Study smarter with the SolutionInn App