Write a program that first asks the user which Temperature scale conversion would he like to perform: Convert F to C Convert C to F What is your choice?  Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two-column Fahrenheit to Celsius table or a two-column Celsius to Fahrenheit table, depending on the choice.  For choice 1, The first column should be labeled Fahrenheit and the first value the Fahrenheit column is start_temp.  The second column should be labeled  Celsius, and its value is calculated from the values in the Fahrenheit column using the formula C = (5.0/9.0)*(F – 32.0).  For choice 2, the table will show the Celsius column first, Fahrenheit column second, and use the formula F = 9.0/5.0 * C + 32.0 Write and use functions called calcCelsius (is passed the Fahrenheit temp and returns the Celsius temp) and calcFahrenheit (is passed the Celsius temp and returns the Fahrenheit temp). The values for the temps in the first column will be incremented by temp_incr, and end when the table value would exceed the end_temp value.  Display all values with 1 decimal of accuracy, justified, and align

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a program that first asks the user which Temperature scale conversion would he like to perform:

  1. Convert F to C
  2. Convert C to F

What is your choice? 

Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two-column Fahrenheit to Celsius table or a two-column Celsius to Fahrenheit table, depending on the choice.  For choice 1, The first column should be labeled Fahrenheit and the first value the Fahrenheit column is start_temp.  The second column should be labeled  Celsius, and its value is calculated from the values in the Fahrenheit column using the formula C = (5.0/9.0)*(F – 32.0).  For choice 2, the table will show the Celsius column first, Fahrenheit column second, and use the formula F = 9.0/5.0 * C + 32.0

Write and use functions called calcCelsius (is passed the Fahrenheit temp and returns the Celsius temp) and calcFahrenheit (is passed the Celsius temp and returns the Fahrenheit temp).

The values for the temps in the first column will be incremented by temp_incr, and end when the table value would exceed the end_temp value.  Display all values with 1 decimal of accuracy, justified, and aligned.

 

Which Temperature Scale Conversion would you like to perform?
1. Convert F to C
2. Convert C to F
What is your choice?
2
Starting Temperature:
0.0
Ending Temperature:
100.0
Temperature Increase:
10.0
Celsius Fahrenheit
0.0
32.0
10.0
50.0
20.0
68.0
30.0
86.0
40.0
104.0
50.0
122.0
60.0
140.0
70.0
158.0
80.0
176.0
90.0
194.0
100.0
212.0
Transcribed Image Text:Which Temperature Scale Conversion would you like to perform? 1. Convert F to C 2. Convert C to F What is your choice? 2 Starting Temperature: 0.0 Ending Temperature: 100.0 Temperature Increase: 10.0 Celsius Fahrenheit 0.0 32.0 10.0 50.0 20.0 68.0 30.0 86.0 40.0 104.0 50.0 122.0 60.0 140.0 70.0 158.0 80.0 176.0 90.0 194.0 100.0 212.0
Which Temperature Scale Conversion would you like to perform?
1. Convert F to C
2. Convert C to F
What is your choice?
1
Starting Temperature:
32.0
Ending Temperature:
122.0
Temperature Increase:
10.0
Fahrenheit
Celsius
32.0
0.0
42.0
5.6
52.0
11.1
62.0
16.7
72.0
22.2
82.0
27.8
92.0
33.3
102.0
38.9
112.0
44.4
122.0
50.0
Transcribed Image Text:Which Temperature Scale Conversion would you like to perform? 1. Convert F to C 2. Convert C to F What is your choice? 1 Starting Temperature: 32.0 Ending Temperature: 122.0 Temperature Increase: 10.0 Fahrenheit Celsius 32.0 0.0 42.0 5.6 52.0 11.1 62.0 16.7 72.0 22.2 82.0 27.8 92.0 33.3 102.0 38.9 112.0 44.4 122.0 50.0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education