Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is  C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater than 0.

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 prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is :
F=9/5*C+32
F is the Fahrenheit temperature, and C is the Celsius temperature.
The formula for the conversion from Celsius to Newton is 
C = 100/33*N
N is the Newton Temperature and C is the Celsius temperature

Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places.

INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater than 0.

**Sample Output Console**

1. **Input Scenario 1:**
   - *User Actions:*
     - Enter the lower value for the conversion table: 0
     - Enter the upper value for the conversion table: 5
     - Enter the increment: 0.25
   
2. **Input Scenario 2:**
   - *User Actions:*
     - Enter the lower value for the conversion table: a
     - Result: Error message displayed - "You have not entered a number. Try again."
     - Corrected input: 10
     - Enter the upper value for the conversion table: 2
     - Result: Error message displayed - "Your upper value is less than your lower value. Try again."
     - Corrected input: 11
     - Enter the increment: 0.1

3. **Input Scenario 3:**
   - *User Actions:*
     - Enter the lower value for the conversion table: 0
     - Enter the upper value for the conversion table: 10
     - Enter the increment: -5
     - Result: Error message displayed - "The increment must be greater than 0."
     - Corrected input: 1.5

**Sample Output File**

The table provides conversion data with the following columns:

- **C (Celsius):** Values range from 0.00 to 7.50, incremented by 0.25.
- **F (Fahrenheit):** Corresponding Fahrenheit values for each Celsius value.
- **N (Normalized value):** Normalized values that increment up as Celsius goes up.

Here are some sample rows from the table:

| C    | F    | N  |
|------|------|----|
| 0.00 | 32.00| 0.00 |
| 0.25 | 32.45| 0.08|
| 0.50 | 32.90| 0.17|
| ...  | ...  | ... |
| 7.50 | 45.50| 1.24|

This set of data illustrates temperature conversions and normalization for educational purposes. The data is ideal for understanding relationships between Celsius and Fahrenheit temperatures, as well as normalized increments.
Transcribed Image Text:**Sample Output Console** 1. **Input Scenario 1:** - *User Actions:* - Enter the lower value for the conversion table: 0 - Enter the upper value for the conversion table: 5 - Enter the increment: 0.25 2. **Input Scenario 2:** - *User Actions:* - Enter the lower value for the conversion table: a - Result: Error message displayed - "You have not entered a number. Try again." - Corrected input: 10 - Enter the upper value for the conversion table: 2 - Result: Error message displayed - "Your upper value is less than your lower value. Try again." - Corrected input: 11 - Enter the increment: 0.1 3. **Input Scenario 3:** - *User Actions:* - Enter the lower value for the conversion table: 0 - Enter the upper value for the conversion table: 10 - Enter the increment: -5 - Result: Error message displayed - "The increment must be greater than 0." - Corrected input: 1.5 **Sample Output File** The table provides conversion data with the following columns: - **C (Celsius):** Values range from 0.00 to 7.50, incremented by 0.25. - **F (Fahrenheit):** Corresponding Fahrenheit values for each Celsius value. - **N (Normalized value):** Normalized values that increment up as Celsius goes up. Here are some sample rows from the table: | C | F | N | |------|------|----| | 0.00 | 32.00| 0.00 | | 0.25 | 32.45| 0.08| | 0.50 | 32.90| 0.17| | ... | ... | ... | | 7.50 | 45.50| 1.24| This set of data illustrates temperature conversions and normalization for educational purposes. The data is ideal for understanding relationships between Celsius and Fahrenheit temperatures, as well as normalized increments.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Basics of loop
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
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