Just testing out arrays on this one. MY project is to create a thermometer that converts Celsius to Fahrenheit or vice-versa.
#include <iostream>
#include <windows.h>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
cout << setiosflags(ios::fixed) << setprecision(2) << ios::showpoint;
float value1[11], value2[11];
char gauge1, gauge2, gauge;
cout << "Welcome to my program, which converts celsius into fahrenheit,\nor fahrenheit into celsius.\n\n";
cout << "**********\nCelsius - c\n**********\n\n";
cout << "**********\nfahrenheit - f\n**********\n\n";
cout << "Please enter the gauge that you would like to convert: ";
cin >> gauge;
system("cls");
cout << "Please enter the temperature that you would like to see converted(1-999): ";
cin >> value1[6];
if(gauge == 'c')
{
gauge1 = 'C';
gauge2 = 'F';
value1[5] = value1[6] + 1;
value1[4] = value1[5] + 1;
value1[3] = value1[4] + 1;
value1[2] = value1[3] + 1;
value1[1] = value1[2] + 1;
value1[7] = value1[6] - 1;
value1[8] = value1[7] - 1;
value1[9] = value1[8] - 1;
value1[10] = value1[9] - 1;
value1[11] = value1[10] - 1;
value2[1]=value1[1]*(9/5)+32;
value2[11]=value1[11]*(9/5)+32;
value2[10]=value1[10]*(9/5)+32;
value2[9]=value1[9]*(9/5)+32;
value2[8]=value1[8]*(9/5)+32;
value2[7]=value1[7]*(9/5)+32;
value2[6]=value1[6]*(9/5)+32;
value2[5]=value1[5]*(9/5)+32;
value2[4]=value1[4]*(9/5)+32;
value2[3]=value1[3]*(9/5)+32;
value2[2]=value1[2]*(9/5)+32;
}
else
{
gauge1 = 'F';
gauge2 = 'C';
value2[6]=value1[6]*(9/5)+32;
}
system("cls");
cout << setw(32) << gauge1 << " | | " << gauge2 << endl;
cout << setw(45) << "| |" << endl;
cout << setw(32) << value1[1] << "-| |-" << value2[1] << endl;
cout << setw(32) << value1[2] << "-| |-" << value2[2] << endl;
cout << setw(32) << value1[3] << "-| |-" << value2[3] << endl;
cout << setw(32) << value1[4] << "-| |-" << value2[4] << endl;
cout << setw(32) << value1[5] << "-| |-" << value2[5] << endl;
cout << setw(32) << value1[6] << "-|**********|-" << value2[6] << endl;
cout << setw(32) << value1[7] << "-|**********|-" << value2[7] << endl;
cout << setw(32) << value1[8] << "-|**********|-" << value2[8] << endl;
cout << setw(32) << value1[9] << "-|**********|-" << value2[9] << endl;
cout << setw(32) << value1[10] << "-|**********|-" << value2[10] << endl;
cout << setw(32) << value1[11] << "-|**********|-" << value2[11] << endl;
cout << setw(45) << "|**********|" << endl;
cout << setw(46) << "/************\\" << endl;
cout << setw(47) << "/**************\\" << endl;
cout << setw(48) << "|****************|" << endl;
cout << setw(48) << "|****************|" << endl;
cout << setw(48) << "|****************|" << endl;
cout << setw(48) << "|****************|" << endl;
cout << setw(48) << "|****************|" << endl;
cout << setw(47) << "\\**************/" << endl;
cout << setw(46) << "\\************/" << endl;
}