Loop more than one time

Once we hve entered Y for individual subject and the amount of subject, the receipt wont come out and loop for one more time(how many subject to regiter) before showing the receipt

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 category ( PT3 ) : ";
cin>>category;

if (strcmp(category ,"PT3")==0 || strcmp(category ,"pt3")==0)
{
cout<<"\n|----------------------------";
cout<<"\n| Category | Type of ";
cout<<"\n| | Category ";
cout<<"\n|----------------------------";
cout<<"\n| | |";
cout<<"\n| | |";
cout<<"\n| | PACKAGE |";
cout<<"\n| PT3 | / |";
cout<<"\n| | INDIVIDUAL |";
cout<<"\n| | |";
cout<<"\n| | |";
cout<<"\n----------------------------|";

cout<<"\n\nPlease enter your type of category (P-Package) : ";
cin>>codeOfCategory;

if (codeOfCategory == 'P' || codeOfCategory == 'p')
{
cout<<"\n|-------------------------------------------------------------------------------------------------------------------------------------------------|";
cout<<"\n| Category | Type of | Code of | Type of | Code of | Code of Individual | Subject | Time | Code of | Price per |";
cout<<"\n| | Category | Category | Subject | Package | Subject | | | Time | package |";
cout<<"\n|-------------------------------------------------------------------------------------------------------------------------------------------------|";
cout<<"\n| | | | LANGUAGE | PTL | BMY | Bahasa Melayu | Weekdays | D | 90 |";
cout<<"\n| | | | | | ENG | English | Weekend | E | 70 |";
cout<<"\n| | | | | | SEJ | Sejarah | | | |";
cout<<"\n| PT3 | PACKAGE | P =======================================================================================================|";
cout<<"\n| | | | STEM | PTA | MAT | Mathematic | Weekdays | D | 80 |";
cout<<"\n| | | | | | SCI | Science | Weekend | E | 70 |";
cout<<"\n| | | | | | GEO | Geography | | | |";
cout<<"\n--------------------------------------------------------------------------------------------------------------------------------------------------|";

cout<<"\nPlease enter code of Package ( PTL-Language / PTA-STEM ) : ";
cin>>codeOfPackage;

if(strcmp(codeOfPackage,"PTL")==0 || strcmp(codeOfPackage,"ptl")==0)
{
cout<<"\nPlease enter code of time ( D-WEEKDAYS / E-WEEKEND ) : ";
cin>>codeOfTime;

if (codeOfTime == 'D' || codeOfTime =='d')
{
price=90.00;
}
else if (codeOfTime == 'E' || codeOfTime == 'e')
{
price=70.00;
}
else
{
price=0.00;
cout<<"\nERROR!";
}
tax = 0.06;
TpricePT1 = price + (price * tax);
}
else if(strcmp(codeOfPackage,"PTA")==0 || strcmp(codeOfPackage,"pta")==0)
{

cout<<"\nPlease enter code of time ( D-WEEKDAYS / E-WEEKEND ) : ";
cin>>codeOfTime;

if(codeOfTime == 'D' || codeOfTime =='d')
{
price=80.00;
}
else if(codeOfTime =='E' || codeOfTime =='e')
{
price=70.00;
}
else
{
price = 0.00;
}
tax = 0.06;
TpricePT1 = price + (price * tax);
}
else
{
price=0.00;
cout<<"\nERROR!";
}

cout<<"\nDo you want to add Individual Subject? : ";
cin>>addOn;
cout<<setprecision(2)<<fixed;

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 | Weekend | E | 35 |";
cout<<"\n| |--------------------|-----------------| | |-----------|";
cout<<"\n| | SEJ | Sejarah | Weekdays | D | 35 |";
cout<<"\n--------------------------------------------------------------------------------------|";

cout<<"\nHow many subject do you want to register (MAXIMUM - 3 SUBJECTS)? : ";
cin>>PT3Sub;

while (PT3Sub<0 || PT3Sub>4)
{
cout<<"ERROR!!";
cout<<"\nHow many subject do you want to register (MAXIMUM - 3 SUBJECTS)? : "; //over limit please choose until 3 subject
cin>>PT3Sub; //cin>>countI;
}

while(count<= PT3Sub)
{

cout<<"\n\nPlease enter code of Individual Subject : ";
cin>>codeOfIndividualSub;

while(strcmp(codeOfIndividualSub,"BMY")!=0 && strcmp(codeOfIndividualSub,"ENG")!=0 && strcmp(codeOfIndividualSub,"SEJ")!=0 )
{
cout<<"ERROR!!";
cout<<"\n\nPlease enter code of Individual Subject : ";
cin>>codeOfIndividualSub;

}

if (strcmp(codeOfIndividualSub,"BMY")==0)
{
price17 = 35.00;
tax= 0.06;
price17 = price17 + (price17*tax);
cout<<setprecision(2)<<fixed;
cout<<"\nPrice for Bahasa Melayu : RM" <<price17; //inside

}
else if (strcmp(codeOfIndividualSub,"ENG")==0)
{
price18 = 35.00;
tax= 0.06;
price18 = price18 + (price18*tax);
cout<<setprecision(2)<<fixed;
cout<<"\nPrice for English : RM" <<price18; //inside

}
else if (strcmp(codeOfIndividualSub,"SEJ")==0)
{
price19 = 35.00;
tax= 0.06;
price19 = price19 + (price19*tax);
cout<<setprecision(2)<<fixed;
cout<<"\nPrice for Sejarah : RM" <<price19; //inside

}
else
{
price = 0.00;
tax= 0.06;
price = price + (price*tax);
cout<<"\nERROR!!";
}
TpricePT1= TpricePT1;
TpricePT4 = price17 + price18 + price19;
TpricePT3=TpricePT1 + TpricePT4;
cout<<setprecision(2)<<fixed;
count++;
//cout<<"\nTotal price for taken subject(s) : RM" <<TpricePT3; //outside pricE
} //while
} //for

} //addOn
cout<<setprecision(2)<<fixed;
cout<<"\n|---------RECEIPT OF REGISTRATION FORM---cuba--------|";
cout<<"\n|Your code of package is ( PTL-Language / PTA-STEM ) : " <<codeOfPackage;
cout<<"\n|Your code of time is ( D-WEEKDAYS / E-WEEKEND ) : " <<codeOfTime;
cout<<"\n|Your price is : RM" <<TpricePT3;
cout<<"\n\nDo you want to add another registration? (Y-YES / N-NO) : ";
cin>>registration ;
}
}
else
{
cout<<"error!";
}
}while (registration == 'Y');
Split your code into functions.

Do not spend 90% of your time trying to make fancy std::cout statements: make it work, before.

There are patent errors:
 
TpricePT1= TpricePT1;   // no comment 


1
2
3
while(    strcmp(codeOfIndividualSub,"BMY")!=0
       && strcmp(codeOfIndividualSub,"ENG")!=0
       && strcmp(codeOfIndividualSub,"SEJ")!=0 )

How can a variable be equal to “BMY”, “ENG”, “SEJ” at the same time?

What about std::strings? Can’t you use them?

Anyway the biggest problem is the fact you don’t need all those nested ifs.
For example: you don’t need to ask the user how many individual ‘subjects’ s/he wants to take (I think you meant ‘courses’, didn’t you?).
Just ask him/her which one s/he want to take and make the additions.

Do calculate the tax only once at the end.

If you split your code into functions, you could easily spot every problem.
Your code is incomplete. You have not shown the definition of your variables. We're not mind readers. How do we know you have your variables defined correctly?

When posting code, please post something that compiles.

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

As Enoizat said, break your code into to functions. It will make you code mush easier to follow and debug.
[code] Loop me baby one more time! https://www.youtube.com/watch?v=dQw4w9WgXcQ [/code]
Topic archived. No new replies allowed.