Still confused...
I missed the day on string variables...what am I doing wrong?!?!?!
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
void main()
{
double temp = 0.0;
string = x;
cout << "Please enter the temperature: ";
cin >> temp;
cout << endl;
cout << "Please enter if the temperature is in fahrenheit or celsius: ";
cin >> x;
cout << endl;
if (x = fahrenheit)
{
temp = temp-32/1.8;
cout << "The temperature in celsius is: " << temp << endl;
}
else
{
temp = temp*1.8+32;
cout << "The temperature in fahrenheit is: " << temp << endl;
}
cout << endl << endl;
system("pause");
}
#include <iostream>
#include <string>
using namespace std;
void main()
{
double temp = 0.0;
string = x;
cout << "Please enter the temperature: ";
cin >> temp;
cout << endl;
cout << "Please enter if the temperature is in fahrenheit or celsius: ";
cin >> x;
cout << endl;
if (x = fahrenheit)
{
temp = temp-32/1.8;
cout << "The temperature in celsius is: " << temp << endl;
}
else
{
temp = temp*1.8+32;
cout << "The temperature in fahrenheit is: " << temp << endl;
}
cout << endl << endl;
system("pause");
}
