//Saliha Babar CS1A Chapter 5, Page 296, #12
//
/************************************************************************
*
* DISPLAY A CELCIUS AND FAHRENHEIT TABLE
* ______________________________________________________________________
* This program displays a table of Celcius temperatures from 0-20 and
* their Fahrenheit equivalents.
*
* Calculation is based on the formula
* f = (9*c/5) + 32
*________________________________________________________________________
* INPUT
* f : temperature in fahrenheit
* c : temperature in celcius
*
* OUTPUT
* displays a table of celcius and fahrenheit temperatures
* *********************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int celcius; // COUNTER VARIABLE - for temperature
const int minCelcius = 0 ; // INPUT - minimum temperature of Celcius
const int maxCelcius = 20; // INPUT - maximum temperature of Celcius
double c; // INPUT - temperature in Celcius
double f; // INPUT - temperature in Fahrenheit
// Assign c to the starting value
c = minCelcius;
cout << "Table of Celcius and Fahrenheit temperatures\n";
cout << "-----------------------\n";
cout << " celcius fahrenheit\n";
while (c <= maxCelcius )
{
f = (9*c/5) + 32;
cout <<"\t" << c << "\t\t\t" << f << endl;
c++;
}
return 0;
}