Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to find the sum, average, range of N non-zero positive integers. This program asks user to enter the value of N.

Write a program to find the sum, average, range of N non-zero positive integers. 

 

  • This program asks user to enter the value of N. Here, N indicates the number of values
    or terms from which user wants to sum, average, and range. This program then ask user
    to enter each term or values.
     
  • For example, suppose, a user entered N (number of value or term) as 4. Then the user
    entered the following four (4) values as: 20, 40, 60, and 80. So, the sum will be
    20+40+60+80=200. You need to enter each term/value using for loop. Now calculate
    the sum.
     
  • For calculating range, you need to subtract smallest number from the largest number.
     
  • Once you get the sum, you can simply divide sum by N; you will get the average value.

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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Databases questions

Question

Question 1 (a2) What is the reaction force Dx in [N]?

Answered: 1 week ago

Question

Determine which location has the highest compositescore:

Answered: 1 week ago