Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this program you need to find the average of the numbers which are storing at odd indexes in the list. To implement this question,

image text in transcribed
In this program you need to find the average of the numbers which are storing at odd indexes in the list. To implement this question, firstly get n from the usernis the total number of the items in the list. After getting n value from the user, you can generate 2 random numbers for the starting and ending point of the range of the numbers. Finally, write a function that returns the average of the values that are storing at odd indexes. The prototype of the function is findAverage(start. end); float You can see the example in the sample output. Do not forget that numbers must be random. Sample Output: Enter the number of items: 5 #This number is a user input which shows the total number of the elements of the list. Random numbers: start: 15 #starting point end: 150 feriding point #After getting and generating the limits (start and end), call the function findAverage/start, end) This function generates n items between start and end points. You can see 5 random numbers between 15 and 150/NUMBERS ARE EXAMPLET YOUR NUMBERS MUST BE RANDOM NUMBERSI) List -- 20, 120, 15, 60, 35 #Generate n(s) numbers, then show all of them on the console. Total Sum -90 Show the average of the values which are storing at odd indexes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

list and explain the different types of research tools available;

Answered: 1 week ago

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago