#include <iostream> #include <fstream> #include <iomanip> using namespace std; i
ID: 3612993 • Letter: #
Question
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
double GPA;
char gender;
ifstream infile;
infile.open("h:\GPAData.txt");
if (!infile)
{
cout<< "Cannot open the inputfile."<<endl;
cout<< "Programterminates!!"<< endl;
return 1;
}
cout<<fixed<<showpoint<<setprecision(2);
infile>> gender>>GPA;
while (infile)
{
switch(gender)
{
case 'f':
avgFemaleGpa= GPA / (//I don't know what toput here- this is where I got stuck!!)