What's wrong with this code?
it returns Zero;
Code:/*snipt*/ 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"; cin>>choice; long double GPA; switch (choice) { case 1: cout<<"Let's take a hack at it then\n"; GPA=YearGPA(); break; case 2: cout<<"No Problem\n"; break; } cout<<"That's an average of \n"; cout<<GPA; if(FinalGpa2<=GPA) { cout<<"See You're on your way already.\n"; } else cout<<"Well you have to do better than that\n"; /*snip*/ //Function definition long double YearGPA() { cout<<"For how many nine weeks do you want to average your GPA?\n"; int N_Weeks; cin>>N_Weeks; int CurrentGPA; switch (N_Weeks) { case 1: CurrentGPA=OneNineWeeks(); break; case 2: TwoNineWeeks(); break; case 3: ThreeNineWeeks(); break; case 4: FourNineWeeks(); break; return CurrentGPA; } } int OneNineWeeks() { int first; int second; int third; int fourth; int fifth; int six; cout<<"What Grade did you get for the following classes\n"; cout<<"First Period:\n"; cin>>first; cout<<"Second Period:\n"; cin>>second; cout<<"Third Period:\n"; cin>>third; cout<<"Fourth Period:\n"; cin>>fourth; cout<<"Fifth Period:\n"; cin>>fifth; cout<<"Six Period:\n"; cin>>six; int temp1; int temp2, temp3, temp4, temp5, temp6; int tempEX=2; temp1=first * tempEX; temp2=second * tempEX; temp3=third * tempEX; temp4=fourth * tempEX; temp5=fifth * tempEX; temp6=six * tempEX; temp6=temp1+temp2+temp3+temp4+temp5+temp6; int temp7; temp7=temp6/6; return temp7; }
Yet I aways get zero for the GPA.