On the second loop, it should allow us to enter Individual Subject code but it directly showed the output without allowing me to enter the Individual Subject Code
do
{
cout<<"\n========================================================================";
cout<<"\n\n Welcome to i-Excellent Tuition Academy "<<endl;
cout<<"\n========================================================================";
cout<<"\nThis is a registration form." <<endl;
cout<<"\nPlease enter your full name : " ;
cin>>ws;
cin.getline(studentName,50);
cout<<"\nPlease enter your school name : ";
cin.getline(schoolName,30);
cout<<"\nPlease enter your contact number : ";
cin>>contactNumber;
cout<<"\nPlease enter category ( PT3 / SPM ) : ";
cin>>category;
@Assh,
Please do two things:
(1) Provide a MINIMAL, COMPILEABLE example that illustrates your problem.
(2) Put your SMALL code sample within [code][/code] tags.
if (addOn == 'Y')
{
for (int PT3Sub =0; PT3Sub <4; PT3Sub++)
{
cout<<"\n|-------------------------------------------------------------------------------------|";
cout<<"\n| Category | Code of Individual | Subject | Time | Code of | Price per |";
cout<<"\n| | Subject | | | Time | subject |";
cout<<"\n|-------------------------------------------------------------------------------------|";
cout<<"\n| | BMY | Bahasa Melayu | | | 35 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| | ENG | English | | | 35 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| | SEJ | Sejarah | Weekdays | D | 35 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| PT3 | MAT | Mathematics | Weekend | E | 30 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| | SCI | Science | | | 30 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| | GEO | Geography | | | 30 |";
cout<<"\n--------------------------------------------------------------------------------------|";
cout<<"\nHow many subject do you want to register (MAXIMUM - 4 SUBJECTS)? : ";
cin>>PT3Sub;
while (PT3Sub<0 || PT3Sub>4)
{
cout<<"ERROR!!";
cout<<"\nHow many subject do you want to register (MAXIMUM - 4 SUBJECTS)? : "; //over limit please choose until 4 subject
cin>>PT3Sub; //cin>>countI;
}
while(count<= PT3Sub)
{
cout<<"\n\nPlease enter code of Individual Subject : ";
cin>>codeOfIndividualSub;