write a program that creates and displays a table of temperature conversions. Get the starting temperature from the keyboard in degrees Celsius (do not allow input of a value below absolute zero). Also get an integer value to represent the number of degrees to increment for each of a 20 row table (do not allow the increment value to be less than one. The first column will be a row number starting with one, follow by the Celsius value and then the conversions into Fahrenheit, Kelvin, and Rankine. Be sure that all columns are neatly right aligned for a variety of inputs.
Modularize the temperature conversion program in Lab 04. Use the breakdown of modules from item 4 (above) as the minimum level of modularity. Be sure that you comment each function correctly.
This is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find derivative of function without knowledge in arithmetic, you cannot do more complex tasks in programming without clear understanding of basics
You have to break it down into functions.
For example,
A function that converts celcius to fahrenreit.
A function that converts celcius to kelvin.
A function that takes the user input
More functions...
The output could look something like this...
What is temperature degree in Celcius: -273.16
Your input -273.16 is incorrect.
Please, try again.
What is temperature degree in Celcius: 20
Input the number of degrees to increment up to 20 rows: 0
Your input 0 is incorrect.
Please, try again.
Input the number of degrees to increment up to 20 rows: 5
# Celcius Fahrenheit Kelvin Rankine
----------------------------------------------------------------------------
1 20 68 293.15 527.67
2 25 77 298.15 536.67
3 30 86 303.15 545.67
4 35 95 308.15 554.67
5 40 104 313.15 563.67
6 45 113 318.15 572.67
7 50 122 323.15 581.67
8 55 131 328.15 590.67
9 60 140 333.15 599.67
10 65 149 338.15 608.67
11 70 158 343.15 617.67
12 75 167 348.15 626.67
13 80 176 353.15 635.67
14 85 185 358.15 644.67
15 90 194 363.15 653.67
16 95 203 368.15 662.67
17 100 212 373.15 671.67
18 105 221 378.15 680.67
19 110 230 383.15 689.67
20 115 239 388.15 698.67
// Temperature Converter
#include <iostream>
#include <cmath>
using namespace std;
int getInput ();
void getInput (double& Cels, double& num)
{
cout << "Enter a temperature in Celcius: ";
cin >> Cels;
if (Cels < -273.15)
{
cout << "Temperature must be greater than or equal to -273.15: ";
cin >> Cels;
}
cout << "Enter the increment in Celsius: ";
cin >> num;
if (num < 1)
{
cout << "Increment must not be less than one: ";
cin >> num;
}
}
This is what i have so far, how would i now separate into converting into all the different columns
// Temperature Converter
#include <iostream>
#include <cmath>
using namespace std;
#define COLUMN_SEPARATOR "\t|"
void getInput (double& Cels, double& num)
{
cout << "Enter a temperature in Celcius: ";
cin >> Cels;
if (Cels < -273.15)
{
cout << "Temperature must be greater than or equal to -273.15: ";
cin >> Cels;
}
cout << "Enter the increment in Celsius: ";
cin >> num;