Keep running program and 'int' problem
I'm using this program in C++ to calculate wind chill:
Code:
#include <cstdlib>
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
cout << "Wind Chill Calculator...\n" ;
cout << "By William Seed\n" ;
int temp, vel;
int ch;
cout << "Enter the temperature:";
cin >> temp;
cout << "Enter the wind speed:";
cin >> vel;
ch = 35.75 + (.6215 * temp) - (35.75 * pow(vel,.16)) + (.4275 * temp * pow(vel,.16));
cout << "The wind chill is: ";
cout << ch;
cout << "\n";
system("PAUSE");
return EXIT_SUCCESS;
}
I have two problems:
1. (most important) I want this program to keep running until I tell it to stop (using imput as yes or no.
2. If I try to use a decimal for 'temp', then the program ends...
I'm new, so no flaming, please.
Thanks in advance,
Will