Question
Design and write a program in C++ that will generate fortune messages to the user. You can create as many messages as you want. Your
Design and write a program in C++ that will generate fortune messages to the user. You can create as many messages as you want. Your program should use a random number generator function (like the one we did in class). The value generated will be used to determine what message will be displayed on the screen. Have a loop in your program to allow for multiple messages to be generated until the user decides to quit. Use the following flowchart to guide you in the design of your program.
Functions that you will need:
A function to print a greeting message and give the user an overview of what the program does.
A function to generate a random number in a certain range (like the one we completed in class).
A function to print the fortune message that will be picked according to a random number. Notice that the number range will depend on how many different messages you want to print. Have at least ten.
A function that prints a goodbye message to the user
Other important requirements:
When picking what message to print, use a switch statement.
Use a while or do-while structure in main to repeat until the user decides to quit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started