Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program called \"Fortune Teller\". The program will prompt the user to g

ID: 3531031 • Letter: W

Question

Write a program called "Fortune Teller". The program will prompt the user to give a number between 1 and 100. Then the program will give a "fortune" depending on the number it receives. Your program should include 10 different outputs. It also will repeat until the user declines to play. Include a Pseudocode with the program. *suggest using multi-way if-else statement. Use" if-else if" example of printing grades for you model if you don't know where to start. To loop the program, use a do-while loop to prompt user at the end of program if he wants to play again. "y" answer will loop the program back to the beginning and prompt for a new number.

Explanation / Answer

Please rate with 5 stars :)

CODE
#include <iostream>
#include <cstdlib>
#include <string>
#include <conio.h>
using namespace std;
int beenhere=0;
int again();
int main()
{
string question;
int answer;
if (beenhere != 0)
{
cout << "What is your question now? ";
}

if (beenhere == 0)
{
cout << "Welcome to the fortune teller! What is your question? ";
beenhere++;
}
cin >> question;
srand(GetTickCount());
answer = rand()%7;
switch(answer)
{
case 0:
cout << "Yes ";
break;
case 1:
cout << "No ";
break;
case 2:
cout << "Most Likely ";
break;
case 3:
cout << "It is Certain ";
break;
case 4:
cout << "Don't Count on it ";
break;
case 5:
cout << "Ask Again Later ";
break;
case 6:
cout << "Outlook Good ";
break;
}
getch();
return again();
}
int again()
{
string another;
cout << "Would you like to ask another question? ";
cin >> another;
if (another[0] == 'y' || another[0] == 'Y')
{
system ("cls");
return main();
}
if (another[0] == 'n' || another[0] == 'N')
return 0;
else
{
system("cls");
return again();
}
}
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote