I am trying to run this program just for an exercise. It runs but completely ignores void computation. It goes directly to the line "system ("PAUSE");"
What could I be missing?
Thanks..
Code:#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
char ans, Y;
do
{
void computation();
}
while (ans = Y);
//wait until user is ready before terminating program to allow the
//user to see the program results
system ("PAUSE");
return 0;
}
void computation()
{
//enter the temperature in celsius
int celsius;
cout <<"Enter the temperature in celsius: ";
cin >> celsius;
//calculate conversion factor for celsius to fahrenheit
int factor;
factor = 212 - 32;
//use conversion factor to convert celsius into fahrenheit value
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;
//output the results (followed by an Newline)
cout <<"Fahrenheit value is: ";
cout <<fahrenheit <<endl;
//choice to input another
char ans;
cout <<"Do you want to try another one? [Y/N]: ";
cin >> ans;
}