Question: 2.19.2: Random numbers. Given integer variables seedVal, lowest, and highest, output a winning lottery ticket consisting of one number in the range lowest to highest

2.19.2: Random numbers.

Given integer variables seedVal, lowest, and highest, output a winning lottery ticket consisting of one number in the range lowest to highest inclusive. End with a newline.

Ex: If lowest is 20 and highest is 90, then a possible output is:

43

(How do I get the correct input?)

2.19.2: Random numbers. Given integer variables seedVal, lowest, and highest, output a

Jump to level 1 Given integer variables seedVal, lowest, and highest, output a winning lottery ticket consisting of one number in the range lowest. to highest inclusive. End with a newline. Ex: If lowest is 20 and highest is 90 , then a possible output is: 43 \begin{tabular}{r|r} 3 & using namespace std; \\ 4 & \\ 5 & int main() \{ \\ 6 & int seedval; \\ 7 & int lowest; \\ 8 & int highest; \\ 9 & \\ 10 & cin >> seedval; \\ 11 & cin > lowest; \\ 12 & cin >> highest; \\ 13 & \\ 14 & srand(seedval); \\ 15 & \\ 16 & \\ 17 & \\ 18 & return ; \\ 19 & \end{tabular} If lowest is 20 and highest is 90 , the number of possible values is 9020+1=71. rand 0%71 generates an integer in the range 0 to 70 . Adding 20 yields a range 20 to 90 . This sequence of operations is performed one time. Not all tests passed. 1: Compare output Input. Your output Your program produced no output Expected output 55

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!