// This is a program that displays the choice the user picks using a Switch Statement
#include <iostream>
#include <string>
using namespace std;
int main()
{
// Underneath A switch program that shows the user his input choice
string word1 = "Achieve";
cout << "Welcome to Your AccuWeather Report Screen." << endl;
cout << endl;
cout << "Your choices are listed at the bottom." << endl;
cout << endl;
cout << "Choose what you want to view" << endl;
cout << endl;
cout << "Number 1 - Temperature outside right now" << endl;
cout << endl;
cout << "Number 2 - Stock Price of the day" << endl;
cout << endl;
cout << "Number 3 - Word of the day" << endl;
cout << endl;
cout << "Number 4 - Check the Last account that was opened" << endl;
cout << endl;
int Answer;
cout << "Answer : ";
cin >> Answer;
cout << endl;
// Underneath Shows the outcome of the operators number input
switch (Answer)
{
case 1:
cout << "It's a nice, sunny, 85 degree warm day today. We have a nice chilling breeze coming in from the north today, so I advise people to go outside and enjoy the day" << endl;
cout << endl;
break;
case 2:
cout << "Stock Price as of 2 pm today is $3.45 per share." << endl;
cout << endl;
break;
case 3:
cout << "Our 'Word of the Day' is : " << word1 << endl;
cout << endl;
break;
case 4:
cout << "Last Account Opened: Mr. Jones. " << endl;
cout << endl;
cout << "Reason: Selling his cat on Craigslist." << endl;
cout << endl;
// if user inputs a wrong choice, I prompted them
default:
cout << " What did you type??" << endl;
// Code used to generate the try again
char again = 'y', n = 'n';
while ((again == 'y') && (n == 'n'))
{
cout << "Try again? (y/n) ";
cin >> again;
cout << endl;
cout << endl;
cout << endl;
// Gives you your options again
cout << "Here are your choices again " << endl;
cout << endl;
cout << main();
if (cin >> n)
{
cout << "Good Bye" << endl;
}
}
}
system("PAUSE");
return 0;
}
I need the program to do this >>>>>> If the user selected n in the try again method, that he would be prompted good bye and then the program would end.
can someone show me how without using their jedi mind powers??? a lot would be appreciated