If you've ever visited Europe (or Canada) you'll know that they tend to measure temperature in degree Celsius rather than Fahrenheit. Conversion is pretty simple: if f is the temperature in degree Fahrenheit, then the temperature in degree Celsius is c = (f-32)*5/9. a. Write a function convert() that takes as an input degree Fahrenheit and returns degree Celsius. >>> convert(32) 0.0 >>> convert(68) 20.0 b. Using your

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 12PE: Write a program that takes as input five numbers and outputs the mean (average) and standard...
icon
Related questions
Question
100%

3. If you've ever visited Europe (or Canada) you'll know that they tend to measure
temperature in degree Celsius rather than Fahrenheit. Conversion is pretty simple: if f is
the temperature in degree Fahrenheit, then the temperature in degree Celsius is
c = (f-32)*5/9.
a. Write a function convert() that takes as an input degree Fahrenheit and
returns degree Celsius.
>>> convert(32)
0.0
>>> convert(68)
20.0
b. Using your function from part a. write a function table() that prints a
formatted look-up table that helps your European and Canadian friends figure out
the temperature in Chicago.
>>> table()
F             C
-22.0     -30.0
-4.0       -20.0
14.0      -10.0
32.0       0.0
50.0       10.0
68.0       20.0
86.0       30.0
104.0     40.0
This question is about the formatting: make sure the temperatures are displayed
with the same precision as shown above and aligned as above.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr