can help me ?? i want to loop to "Please choose the section you want" after all the calculation, but it only loop to "key in the number of adults"..Please help..
#include <iostream>
using namespace std;
int main ()
{
int adults1, childrens1, adults2, children2, adultstotal, childrentotal, choices, total_ticket1 = 0, total_ticket2 = 0, sessions;
int total_day = ( total_ticket1+total_ticket2 );
sessions = 0;
cout << " Please choose the sessions you want " << endl;
cout << " Key in 1 for 2pm to 4pm session " << endl;
cout << " Key in 2 for 8pm to 10pm session " << endl;
cin >> sessions ;
if ( sessions == 1 && sessions != 0 ) {
cout << " Welcome to Zoo Melaka " << endl;
cout << " This is 2pm to 4pm session " << endl;
cout << " To exit, key in 0 for both adults and children " << endl;
while ( total_ticket1 < 50 ) {
int adult1, children1;
cout << " Key in the number of adults " << endl;
cin >> adults1;
total_ticket1 += adults1;
cout << " Key in the number of children that below 12 years old " << endl;
cin >> children1;
total_ticket1 += children1;
if ( adults1 == 0 && children1 == 0 ) break;
else {
int adultstotal_1 = ( adults1*10);
int childrentotal_1 = ( children1*5);
int total = ( adultstotal_1+childrentotal_1);
int ticket1 = (adults1+children1);
cout << " The total amount is " << total << endl;
int choice;
cout << " Do you want to print receipt? " << endl;
cout << " Key in 1 to print receipt " <<endl;
cout << " Key in 2 to exit " << endl;
cin >> choices;
if ( choices != 1 || choices == 2 )break;
else if ( choices == 1 || choices != 2 ){
cout << "The receipt for the purchase is:" << endl;
cout << "Adult " << adults1 << " RM" << adultstotal_1 << endl;
cout << "Children " << children1 << " RM" << childrentotal_1 << endl;
cout << "Total " << ticket1 << " RM" << total << endl;
}
}
if ( total_ticket1 > 50 ){
cout << " Exceed total ticket allowed !! " << endl;
cout << " Please key in less ticket :" << endl;
}
else if ( total_ticket1 == 50 ) {
cout << " Warning!! The ticket was sold out " << endl;
cout << " Please come again! " <<endl;
}
int choice;
int total_day = (total_ticket1 + total_ticket2);
cout << " Insert 1 to accept " << endl;
cout << " Insert 2 to terminate the program " << endl;
cin >> choice;
if ( choice == 2 ) break;
else if ( choice == 1 ){
cout << " Total ticket that had been sold are " << total_ticket1 << endl;
cout << " Total ticket sold by today are " << total_day << endl;
}
system("pause");
}
}
if ( sessions == 2 && sessions != 0 ) {
cout << " Welcome to Zoo Melaka " << endl;
cout << " This is 8pm to 10pm session " << endl;
cout << " To exit, key in 0 for both adults and children " << endl;
while ( total_ticket2 < 50 ) {
int adult2, children2;
cout << " Key in the number of adults " << endl;
cin >> adults2;
total_ticket2 += adults2;
cout << " Key in the number of children that below 12 years old " << endl;
cin >> children2;
total_ticket2 += children2;
if ( adults2 == 0 && children2 == 0 ) break;
else {
int adultstotal_2 = ( adults2*10);
int childrentotal_2 = ( children2*5);
int total = ( adultstotal_2+childrentotal_2);
int ticket2 = (adults2 + children2);
cout << " The total amount is " << total << endl;
int choices;
cout << " Do you want to print receipt? " << endl;
cout << " Key in 1 to print receipt " <<endl;
cout << " Key in 2 to exit " << endl;
cin >> choices;
if ( choices != 1 || choices == 2 )break;
else if ( choices == 1 || choices != 2 ){
cout << "The receipt for the purchase is:" << endl;
cout << "Adult " << adults2 << " RM" << adultstotal_2 << endl;
cout << "Children " << children2 << " RM" << childrentotal_2 << endl;
cout << "Total " << ticket2 << " RM" << total << endl;
}
}
if ( total_ticket2 > 50 ){
cout << " Exceed total ticket allowed !! " << endl;
cout << " Please key in less ticket :" << endl;
}
else if ( total_ticket2 == 50 ) {
cout << " Warning!! The ticket was sold out " << endl;
cout << " Please come again! " <<endl;
}
int choice;
int total_day = (total_ticket1 + total_ticket2);
cout << " Insert 1 to accept " << endl;
cout << " Insert 2 to terminate the programme " << endl;
cin >> choice;
if ( choice == 2 ) break;
else if ( choice == 1 ){
cout << " Total ticket that had been sold are " << total_ticket2 << endl;
cout << " Total ticket sold by today are " << total_day << endl;
}
system("pause");
}
}
return 0;
}