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.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
C++ PLEASE pay attention to the extra instructions below (I am struggling with the floor function):
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 \]](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F20ef5b89-bdf5-4ebf-bc1c-34f412b810c9%2F4fb0620e-e552-401b-b595-53a0b7334fc6%2Ff1l2et9_processed.jpeg&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images









