Question: Hi this is the same question with two pictures.This is C++,so code accordingly.pls I need your help with the best answer. thanks. Write a simple

 Hi this is the same question with two pictures.This is C++,so

code accordingly.pls I need your help with the best answer. thanks. Write

Hi this is the same question with two pictures.This is C++,so code accordingly.pls I need your help with the best answer. thanks.

Write a simple program that keeps generating three integers until all three values are different OR unil the loop runs up to 100 times (i.e. whichever condition is satisfied first). The program then outputs the minimum and maximum of the last three numbers generated. Note: Terminating the loop after 100 times is just used as cautionary measure. In reality, the probability of 3 random functions generating the same number 100 times in a row is extremely low! In reality, the loop would run only once or twice You MUST define and use all the following functions in your program: boolean is different int max of three) int greater of twoo .int min of three) int smaller of twoo void print result) Note: The arguments to the above functions have been intentionally omitted. You are responsible for selecting the appropriate number and type of arguments in each case Details of the program are as follows: A. Inside a do-while loop, call the following random function three times: random (1, 100) If two or more integers are the same (read on for how to do this), the body of the loop should be executed again. If the three integers are different, then exit the loop (i.e, go to step B). The termination condition of the loop should call a function boolean is different,which takes the three integers as arguments and returns true only when the three integers are all different (see note below regarding input arguments). The termination condition of the loop should also check to make sure the loop is not running for over 100 times i.e. use a counter to keep track of how many times the loop is running). If your program exited the loop based on generating 3 numbers continue on to steps B Dbelow. If the loop ran 100 times without generating 3 unique numbers, your program should exit the loop and output an error message 8

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!