Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview: You will write a menu driven program that will implement 3 choices: generating a random number, generating a random character, and exiting the program.

image text in transcribed
image text in transcribed
Overview: You will write a menu driven program that will implement 3 choices: generating a random number, generating a random character, and exiting the program. The user can continue to make selections until they select the option to exit the program, i.e. once the result is given, allow the user to select another option. Processing requirements: Your program will perform the following in the menu driven program: First option: generate a random number between the range of 1 and 1000 or more precisely: [1,1000) Second option: generate a random character between the range of 'c' and 'q' or more precisely: ['c','q'). Hints: Look-up the menu driven program examples on Slate. O You will need the functions srand and rand. 0 You may want to use the "cls" command to make your output screens more readable (look-up the examples posted on Slate). O Maybe make use of an enum for the choices. PostLab 1. Assuming that the menu options are given as 1, 2, and 3 (and not a,b, and c): a. In obtaining the selection from the menu, should the user input be integer or character? b. What are your options for obtaining the selection as a character or as an integer? c. Describe the advantages and disadvantages for your choice in Part A. 2. Why is the function srand necessary and where should it be placed inside the code (Hint: run your program a few times without the use of srand)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions