Question: C++ code must use standard namespace Develop an abstract base class RandGen that will be used for generating random numbers or strings in various questions.

C++ code must use standard namespace

Develop an abstract base class RandGen that will be used for generating random numbers or strings in various questions. Give some supporting (mathematical) arguments for all your work in your report. Use library functions from the standard library like rand), srand() and time(). I suggest you use srand(time(0) to seed the random number generator. Create four derived classes RandLotto, RandDay, RandTime and RandString. The RandLotto will be used to generate random drawings for California Super Lotto Plus based on 5 numbers from 1 to 47 and one additional Mega number from 1 to 27. See www.Calottery.com/ games/superlotteryplus for Lottery rules. The RandDay will generate a random day of the year, use the class Date from the textbook. Make sure you look into the case of leap years to make it absolutely random. The RandTime will generate a random time of the day using class Time from textbook. The RandString will be used as a base class for two derived classes: RandStr will generate a random strings at most 256 characters long and a RandMsgOfTheDay will return a random message of the day (use a table of messages in memory- or in a file). Test all your classes. Use the classes from problem above for the following: Try to find what are your chances to win the California Super Lottery through a computer simulation. I suggest you keep generating random Super Lotto draws in a loop until you win, say 100 times. Try to have a significant number of wins before you draw a conclusion.

 C++ code must use standard namespace Develop an abstract base class
RandGen that will be used for generating random numbers or strings in
various questions. Give some supporting (mathematical) arguments for all your work in
your report. Use library functions from the standard library like rand), srand()
and time(). I suggest you use srand(time(0) to seed the random number
generator. Create four derived classes RandLotto, RandDay, RandTime and RandString. The RandLotto
will be used to generate random drawings for California Super Lotto Plus
based on 5 numbers from 1 to 47 and one additional Mega

I // Fig. 9.25: Time.h 2 // Time class modified to enable cascaded member-function calls. 3 #include 5 // Time class definition. 6 // Member functions defined in Time.cpp 7 #ifndef TIME-H 8 #define TIME-H 8. 9.25 3 Time class modified to enable cascaded member-function calls. (Part I of 2.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!