What's wrong with this code?
it returns Zero;
cout<<"Do you want to know what GPA you currently have in this School Year\n";
cout<<"To see if you're on track for you goal?\n"<<endl;
cout<<" (1)Yes\t";cout<<"(2) No";
long double GPA;
case 1: cout<<"Let's take a hack at it then\n";
case 2: cout<<"No Problem\n";
cout<<"That's an average of \n";
cout<<"See You're on your way already.\n";
cout<<"Well you have to do better than that\n";
long double YearGPA()
cout<<"For how many nine weeks do you want to average your GPA?\n";
case 1: CurrentGPA=OneNineWeeks();
case 2: TwoNineWeeks();
case 3: ThreeNineWeeks();
case 4: FourNineWeeks();
cout<<"What Grade did you get for the following classes\n";
int temp2, temp3, temp4, temp5, temp6;
temp1=first * tempEX;
temp2=second * tempEX;
temp3=third * tempEX;
temp4=fourth * tempEX;
temp5=fifth * tempEX;
temp6=six * tempEX;
Yet I aways get zero for the GPA.
The problem rests in many things (as I can see by just glancing at your code). The main problem is this:
In C/C++, when you do division with integers it truncates the decimal part. Which also points out another problem with your program.. You defined/declared everything as an integer. GPA's and grades are usually real numbers, so redefine everything as a double.
temp7=temp6/6; // NO NO NO
So to fix your program (mostly), redefine everything as double's and do the above code like this:
I didn't really have time to go through your code thoroughly (sorry), but I think I pointed out the recurring problem.
temp7 = temp6 / 6.0; // Correct
Good luck ;)
Thanks for your help man that seems to have fixed it. Well gotta keep working on it though, there's lot more stuff to it than that.