Question: program that initially asks a user to enter two positive integer numbers a and b. If either a or b are zero or negative, the

program that initially asks a user to enter two positive integer numbers a and b. If either a or b are zero or negative, the program terminates right away. Then, generate an array of 20 integer numbers, each randomly generated between a and b. If b happens to be greater than a, then the array must contain elements randomly generated between b and a. Display the whole array on the screen. After creating and displaying the array, the program shows:

[A]verage

[S]um

[F]ind Please choose an option:_

Then, if the user selects: - A (lowercase or uppercase): the program computes and displays the average of all elements of the array. - A (lowercase or uppercase): the program computes and displays the average of all elements of the array. - F (lowercase or uppercase): the program asks the user to insert an integer number to be found in the array. If present, the program displays "Found in position number " followed by the position of the first occurrence. If not present, the program displays "Number not found in the array".

with commented

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!