#include
using namespace std;
int invitedGuests;
int op1() {
cout << "How many guests would you like to invite?: ";
cin >> invitedGuests;
return invitedGuests;
}
void op2(int guests) {
int cards = guests / 2;
double sweets = guests * 1.2;
cout << cards << “invitation cards” << endl
<< sweets << “sweets”;
}
void menu() {
cout << “1. Enter number of invite guests.” << endl
<< “2. Determine the number of invitation cards and sweets” << endl
<< “3. Determine the number of tables needed” << endl
<< “4. Determine drinks order” << endl
<< “5. Cost of invitation cards.” << endl
<< “6. Cost of drinks” << endl
<< “7. Display all information” << endl
<< “8. Quit” << endl;
}
int userChoice() {
menu();
int choice;
cout << "Choose an option: ";
cin >> choice;
do {
if (choice == 1) {
cout << “You selected 1 (invite guests).” << endl;
op1();
break; }
else if (choice == 2){
cout << “You selected 2 (invitation cards and sweets).” << endl;
op2(invitedGuests);
break; }
else if (choice == 3) {
cout << “You selected 3 (number of tables needed)” << endl;
break; }
else if (choice == 4) {
cout << “You selected 4 (drinks order).” << endl;
break; }
else if (choice == 5) {
cout << “You selected 5 (cost of invitational cards).” << endl;
break; }
else if (choice == 6) {
cout << "You selected 6 (cost of drinks). " << endl;
break; }
else if (choice == 7) {
cout << “You selected 7 (Display all information)” << endl;
break; }
else if (choice == 8) {
cout << “You selected 8 (Quit).” << endl;
break; }
} while (choice != 8);
return 0;
}
int main() {
cout << “Hi, the Wedding Planning Assistant is pleased to be at your service!” << endl;
int runProgram = userChoice();
cout << runProgram;
return 0;
}
I want to be able to choose a new option after I’ve entered number of invited guests, but now it just breaks. How can I do this?