Feb 8, 2013 at 12:32am UTC
I'm having issues getting this to run. im sure its a stupid mistake... anyone have any ideas? its supposed to allow me to input several different values...
#include<iostream>
#include<iomanip>
using namespace std;
void main(void)
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(1);
int count=0;
float sumf=0, sumc=0, fahrenheit, centigrade, averagef, averagec;
cout<<"Enter a fahrenheit temperature. "<<endl;
cout<<"Enter -999.0 to stop. "<<endl;
cout<<setw(30)<<"Fahrenheit"<<setw(20)<<"Centigrade"<<endl<<endl;
cin>>fahrenheit;
while(fahrenheit!=-999.0);
{
centigrade=(5.0/9.0)*(fahrenheit-32);
cout<<setw(30)<<fahrenheit<<setw(20)<<centigrade<<endl;
sumf=sumf+fahrenheit;
sumc=sumc+centigrade;
count++;
cin>>fahrenheit;
}
averagef=sumf/count;
averagec=sumc/count;
cout<<setw)30)<<averagef<<setw(20)<<averagec<<endl;
}