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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 7E: (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or...
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.
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.
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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