Question: 11.6 Week 8 Lab: Arrays Boulder Weights Solve in C! (1) Prompt the user to enter an integer for the number of boulders they have

11.6 Week 8 Lab: Arrays

Boulder Weights Solve in C!

(1) Prompt the user to enter an integer for the number of boulders they have (assume the value is always less than 50). Then, prompt the user to enter that many numbers, representing the boulders weights. Store the weights in an array of doubles. Output the array's numbers on one line, each number followed by one space. (2 pts)

(2) Also output the total weight, by summing the array's elements. (1 pt)

(3) Also output the average weight. (1 pt)

(4) Also output the maximum weight array element. (2 pts)

Here is a sample mixed output/input (you will need to exactly match the format of the output):

How many boulders do you have?: 5

Enter weight 1: 236

Enter weight 2: 89.5

Enter weight 3: 142

Enter weight 4: 166.3

Enter weight 5: 93

You entered: 236.000000 89.500000 142.000000 166.300000 93.000000

Total weight: 726.800000

Average weight: 145.360000

Max weight: 236.000000

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!