Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions