Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the sample C++ program shown below, add statements starting line #14 to convert degrees in Fahrenheit to degrees in Celsius. Variable fahrenheit has a

Using the sample C++ program shown below, add statements starting line #14 to convert degrees in Fahrenheit to degrees in Celsius. Variable fahrenheit has a value of 212 (line #11) and it must be converted to some equivalent value in Celsius. Hence, it must be stored in the variable declared in line #12. Use the formula : celsius = (fahrenheit 32)* 5/9 for the conversion. Be careful and take note that in C++, 5/9 is evaluated to 0. To get the correct value, you have to write it as 5.0/9 or 5.0/9.0 or 5/9.0 Similarly, 9/5 is evaluated to 1. After the conversion, print both the values for fahrenheit and celsius.

image text in transcribed

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions