Project: Add a Joke Option
Add a new option: ‘‘4. Tell a joke’’ that prints a random silly line.
Project: Add a Joke Option
Add a new option: ‘‘4. Tell a joke’’ that prints a random silly line.
#include <iostream>
// Include relevant headers
using namespace std;
int main() {
int choice = 0;
// Initialize random number generator
// Add code for option/case 4 in the while loop and the switch
while (choice != 3) {
cout << "\nMain Menu" << endl;
cout << "1. Say Hello" << endl;
cout << "2. Show Info" << endl;
cout << "3. Exit" << endl;
cout << "Choose an option: ";
cin >> choice;
switch (choice) {
case 1:
cout << "Hello there!" << endl;
break;
case 2:
cout << "This is a basic menu program." << endl;
break;
case 3:
cout << "Goodbye!" << endl;
break;
default:
cout << "Invalid choice." << endl;
}
}
return 0;
}Update the menu system