Hi, I am making an student registration program as my project in school. But I had some problems making it. Our professor asked us to make an program where there are lists of subjects offered. Then the student will choose what subject/subjects he/she likes, then it will be computed. The tuition fee etc. My problem is at the end where I need to add all of the Tuition fee, Misc. Fee etc. It doesn't sum up. And if you enter 2 subjects the latest subject will only be the one that the unit is computed. pls. help I need this tomorrow. thanks.
#include<iostream.h>
#include<conio.h>
main()
{
int choice, unit, lab=0, tunit=0, total, tfee=0, y=5;
char ans;
clrscr();
cout<<"Offered Subjects";
cout<<"1. COE";
cout<<"2. MATH";
cout<<"3. Exit";
loop:
gotoxy(50,10);
cout<<"Enter your choice";
cin>>choice;
switch(choice)
{
case 1:
unit=4;
lab=1200;
y++;
gotoxy(50,y);
cout<<"COE "<<unit;
tunit=unit*130;
break;
case 2:
y++;
unit=3;
gotoxy(50,y);
cout<<"MATH "<<unit;
tunit=unit*130;
break;
default:
cout<<"Invalid Choice";
}
gotoxy(10,45);
cout<<"Do you want another transaction?";
cin>>ans;
if(ans=='Y'||ans=='y'){
goto loop;}
else{
goto loop1;
}
loop1:
tfee=tunit;
gotoxy(50,y+2);
cout<<"Tuition "<<tfee;
gotoxy(50,y+3);
cout<<"Laboratory "<<lab;
gotoxy(50,y+4);
cout<<"Miscellaneous "<<"1,920";
gotoxy(50,y+5);
cout<<"Others "<<"100";
gotoxy(50,y+6);
cout<<"Drug Testing "<<"200";
gotoxy(50,y+7);
cout<<"Mailing Fee "<<"60";
gotoxy(50,y+8);
cout<<"========================";
gotoxy(50,y+9);
cout<<"Total "<<total;
total=tfee+lab+1920+100+200+60;
getch();
return 0;
}