HELP! Switch statement

I cannot get this program rolling to save my life!
Any help would be greatly appreciated!
Thanks in advanced.

So here I have a program that is supposed to basically sort out who passed and failed.
I am currently stuck on the switch statement, I'm trying to count how many students received an A, B, C, etc.
&&&&&I have no idea where to start. Help Please.
Here's what I have so far:



#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

void printIdInfo(ofstream &fout);
void printColumnHeaders(ofstream &fout);
void getData(ifstream &fin, ofstream &fout, string student_id, double semester_avg, char semester_grd);
void passFailCount(char semester_grd, double semester_avg, int &sumpass, int &sumfail);
void gradeCount(char semester_grd);

int main()
{
string student_id;
double semester_avg;
char semester_grd;
int sumpass,
sumfail,
sumAs,
sumBs,
sumCs,
sumDs,
sumFs,
sumWs,
sumIs;

ifstream fin;
fin.open("prog5_251inp.txt");

ofstream fout;
fout.open("prog5_251out.txt");
printIdInfo(fout);
printColumnHeaders(fout);

getData(fin, fout, student_id, semester_avg, semester_grd);
while (!fin.eof()) //hopefully this fout's all this shit...
{
fout << student_id << semester_avg << semester_grd;
}

while (student_id!="A0")
{
getData(fin, fout, student_id, semester_avg, semester_grd);
passFailCount(semester_grd, semester_avg, sumpass, sumfail);
}





return 0;
}


void printIdInfo(ofstream &fout)
{
fout << "A G\n"
<< "C.S. 1428.251\n"
<< "04/14/14";
}

void printColumnHeaders(ofstream &fout)
{
fout << "\n\n\n"
<< "ID# Average Grade\n"
<< "_____________________________________\n";
}

void getData(ifstream &fin, ofstream &fout, string student_id, double semester_avg, char semester_grd)
{
while (!fin.eof())
{
fin >> student_id >> semester_avg >> semester_grd;
}
}

void passFailCount(char semester_grd, double semester_avg, int &sumpass, int &sumfail)
{
int i,
j;

if (semester_grd!='W' || semester_grd!='w' || semester_grd!='I' || semester_grd!='i')
{
if(semester_avg >= 59.5)
{
for (i=0; i < 13; i++);
{
sumpass+=i;
}
}
}
else if (semester_avg < 59.5)
{
for (j=0; j < 13; j++);
{
sumfail+=j;
}
}
}

void gradeCount(char semester_grd, int &sumAs)
{
switch (semester_grd)

case 'a' :
case 'A' : sumAs=0++;
break;
case 'b' :
case 'B' : sumBs=0++;
break;
case 'c' :
case 'C' : sumCs=0++;

case 'd' :
case 'D' : sumDs=0++;
break;
case 'f' :
case 'F' : sumFs=0++;
break;
case 'w' :
case 'W' : sumWs=0++;
break;
case 'i' :
case 'I' : sumIs=0++;
break;
}

/*
***Call a void function gradeCount to determine how many of each letter grade was assigned. (A’s, B’s, C’s, D’s, F’s, W’s, & I’s)
Note: For full credit, you must use a switch to accomplish this task.
*/
You should have a load of errors here. Did you try to fix them or at least post them here?
Topic archived. No new replies allowed.