Question: Write a program that will ask the user for a number between 1 and 1 0 0 . Generate the sum and compute the average

Write a program that will ask the user for a number between 1 and 100. Generate the sum and compute the average of random numbers in the range of 1 to 100 until a generated random number matches the number input by the user. Do not include this number as part of your sum.
Make sure you prime your loop properly.
Example Run:
Enter a number
10
8 numbers were randomly generated before 10 was generated. The sum of the numbers is 145, the average is 18.
NOTE:
You are not allowed to use any high level decisions or looping like .IF,.ELSE. WHILE, .REPEAT
Format your code with tohtml.com and paste it in the text box below. Be sure you are pasting the html from to html into the html editor and not the rich text editor.
View keyboard shortcuts
EditViewInsertFormatToolsTable
12pt
Paragraph

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 Programming Questions!