Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use c++ as the language. 14.4 Homework 1, problem 3 (1) Write a function called fahrenheit for converting a temperature from Celsius to Fahrenheit.

image text in transcribed

Please use c++ as the language.

14.4 Homework 1, problem 3 (1) Write a function called fahrenheit for converting a temperature from Celsius to Fahrenheit. (Recall that to do this, you take the value, multiply by 1.8, and then add 32.) Your function should take the Celsius temperature, a floating point value, as input, and return the Fahrenheit temperature, also a floating point value. For two points, have your main call this function and print the value of 26 degrees Celsius. (2) Next, for two points, prompt the user to enter the current temperature, store it in a variable called temperature, and write a loop in your main that tests the function by calculating the Fahrenheit values of 0 through temperature degrees Celsius, with each value printed on a single line as shown below. (You may assume the user will input an integer.) (3) Finally, for two points, add an if statement that checks if the final value is greater than 100. If it is, print "It's hot!", and if it's not, print "Feels good out here!" For example, a full run of this program (just to help you get the formatting correctly) with input 4 should look like: 26 degrees Celsius is 78.8 Enter the current temperature: 0 degrees Celsius is 32 Fahrenheit degrees Celsius is 33.8 Fahrenheit 2 degrees Celsius is 35.6 Fahrenheit 3 degrees Celsius is 37.4 Fahrenheit 4 degrees Celsius is 39.2 Fahrenheit Feels good out here

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions