C++ PLEASE pay attention to the extra instructions below (I am struggling with the floor function): Programming Challenge: 12 - Celsius to Fahrenheit table Have the user input the start and stop temperatures for the table as floating-point values. The values can be entered in any order. The lower of the two temperatures will be the start value, and the higher temperature will be the stop value.  Take the start value down to the next lower integer. For example, if the start value is 12.9 make the start value equal to 12 instead. This operation is called the "floor" of 12.9. The floor of a floating-point number is the largest integer that is not larger than that number. Note: the floor of 12 (an integer) is still 12. Take the stop value up to the next higher integer. For example, if the stop value is 24.1 take it up to 25. This operation is called the "ceiling" of 24.1. The ceiling of a floating-point number is the smallest integer that is not smaller than that number. The ceiling of 25 (an integer) is still 25. The cmath library contains functions floor() and ceil() that will do the math for you. So if you want to compute and store the (integer) value of the floor of x, write something like      int floor_x = floor(x); The table will run from start to stop (in Celsius) in 1-degree increments. The table should show the values right-justified in columns, with the Celsius values shown as integers (no decimal point) in the left-hand column and with the Fahrenheit values displayed with two digits after the decimal point in the right-hand column.  For your screen shot, enter temperatures of 14.1 and -9.5 degrees, in that order. This should produce a table from -10 to 15 degrees.

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

C++ PLEASE pay attention to the extra instructions below (I am struggling with the floor function):

Programming Challenge: 12 - Celsius to Fahrenheit table

Have the user input the start and stop temperatures for the table as floating-point values. The values can be entered in any order. The lower of the two temperatures will be the start value, and the higher temperature will be the stop value. 

Take the start value down to the next lower integer. For example, if the start value is 12.9 make the start value equal to 12 instead. This operation is called the "floor" of 12.9. The floor of a floating-point number is the largest integer that is not larger than that number. Note: the floor of 12 (an integer) is still 12.

Take the stop value up to the next higher integer. For example, if the stop value is 24.1 take it up to 25. This operation is called the "ceiling" of 24.1. The ceiling of a floating-point number is the smallest integer that is not smaller than that number. The ceiling of 25 (an integer) is still 25.

The cmath library contains functions floor() and ceil() that will do the math for you. So if you want to compute and store the (integer) value of the floor of x, write something like

     int floor_x = floor(x);

The table will run from start to stop (in Celsius) in 1-degree increments. The table should show the values right-justified in columns, with the Celsius values shown as integers (no decimal point) in the left-hand column and with the Fahrenheit values displayed with two digits after the decimal point in the right-hand column. 

For your screen shot, enter temperatures of 14.1 and -9.5 degrees, in that order. This should produce a table from -10 to 15 degrees.

### 12. Celsius to Fahrenheit Table

In Programming Challenge 12 of Chapter 3, you were asked to write a program that converts a Celsius temperature to Fahrenheit. Modify that program so that it uses a loop to display a table of the Celsius temperatures 0–20, and the Fahrenheit equivalents.

---

**Explanation:**

This challenge builds upon a previous programming assignment where a program was designed to convert temperatures from Celsius to Fahrenheit. The new requirement is to enhance the program by incorporating a loop structure to generate and display a table of Celsius temperatures ranging from 0 to 20 degrees, along with their corresponding Fahrenheit values. This exercise aims to improve understanding of loops and reinforce the concept of temperature conversion.

**Temperature Conversion Formula:**

To convert Celsius to Fahrenheit, use the following formula:
\[ \text{Fahrenheit} = (\text{Celsius} \times \frac{9}{5}) + 32 \]
Transcribed Image Text:### 12. Celsius to Fahrenheit Table In Programming Challenge 12 of Chapter 3, you were asked to write a program that converts a Celsius temperature to Fahrenheit. Modify that program so that it uses a loop to display a table of the Celsius temperatures 0–20, and the Fahrenheit equivalents. --- **Explanation:** This challenge builds upon a previous programming assignment where a program was designed to convert temperatures from Celsius to Fahrenheit. The new requirement is to enhance the program by incorporating a loop structure to generate and display a table of Celsius temperatures ranging from 0 to 20 degrees, along with their corresponding Fahrenheit values. This exercise aims to improve understanding of loops and reinforce the concept of temperature conversion. **Temperature Conversion Formula:** To convert Celsius to Fahrenheit, use the following formula: \[ \text{Fahrenheit} = (\text{Celsius} \times \frac{9}{5}) + 32 \]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
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