// Reaper
#include <iostream>
usingnamespace std;
int main()
{
int hits , bat;
float average;
cout << "This will display the batting average.\n\n";
cout << "Enter how many times you were up to bat: ";
cin >> bat;
cout << "Enter how many hits you got: ";
cin >> hits;
cout.setf(ios_base::fixed , ios_base::floatfield);
cout.precision(2);
average = bat / hits;
cout << "\n\n";
cout << "The average is " << average << endl;
return 0;
}
I had a problem with this same problem last time, but i dont remember how, i just installed ubuntu linux, so i have to recreate most of the programs i built.
this program is suppose to display the average percent, so if i said i was up to bat 10 times but only got 5 hits it should display 50.00 for 50%, but its display 2.00