Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This needs to be solved without using TRY and CATCH. It also needs to check for non-numeric entries. Write a class called ArrayCalculations that does

This needs to be solved without using TRY and CATCH. It also needs to check for non-numeric entries. Write a class called ArrayCalculations that does the following: Declares an integer array named data with the elements 7, -1, 13, 24, and 6. Use only one statement to declare and initialize the array. Calculates and prints the maximum value in the array. Calculates and prints the minimum value in the array. Calculates and prints the sum of all the elements in the array. Calculates and prints the average (a double) of all the elements in the array. Please label your output (no specific format required). The numbers in the array initialization statement are not considered to be magic numbers. Write a program called StatisticsCalculator that calculates the mean (average) and standard deviation for a set of integer values entered by the user. Your program should Prompt the user for the number of values, n. (n must be 1 or greater!) Output "You must enter an integer greater than 0" and reprompt the user if the number of values is not an integer value greater than 0. Create an array to store the values. Prompt the user for each value and store it in the array. Output "Invalid value" and reprompt if the user enters something other than an integer. Calculate and output the mean of the values with 2 decimal places. Calculate and output the standard deviation of the values (with 2 decimal places) using the formula given below:

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions