Create the text menu system, in C++, that asks your user for an input and then d
ID: 3926539 • Letter: C
Question
Create the text menu system, in C++, that asks your user for an input and then displays the appropriate message. Your system should have the following options:
Choices
Output
Display Temperature
It is sunny and 85F, wind from the North
Display Stock Price
Stock Price as of 2pm is $3.45 per share
Display Word for the Day
achieve
Display Last Account Used
Mr. Jones, (# 12312) was selling his cat
Choices
Output
Display Temperature
It is sunny and 85F, wind from the North
Display Stock Price
Stock Price as of 2pm is $3.45 per share
Display Word for the Day
achieve
Display Last Account Used
Mr. Jones, (# 12312) was selling his cat
Explanation / Answer
#include <iostream>
using namespace std;
int main(){
cout << "Menu" <<endl;
cout << "1. Display Temperature." << endl;
cout << "2. Display Stock Price." << endl;
cout << "3. Display Word for the Day." << endl;
cout << "4. Display Last Account Used." << endl;
cout << "Input your choice : ";
int choice;
cin >> choice;
switch(choice)
{
case 1:
cout << "It is sunny and 85F, wind from the North." << endl;
break;
case 2:
cout << "Stock Price as of 2pm is $3.45 per share." << endl;
break;
case 3:
cout << "achieve." << endl;
break;
case 4:
cout << "Mr. Jones, (# 12312) was selling his cat." << endl;
break;
default:
cout << "Invalid choice.";
break;
}
return 0;
}
OUTPUT:
Menu
1. Display Temperature.
2. Display Stock Price.
3. Display Word for the Day.
4. Display Last Account Used.
Input your choice : 1
It is sunny and 85F, wind from the North.