Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write down C++ code E.3 Statistics on Integer Inputs Requirements Write a program that calculates statistics on a set of integer inputs Specifications 1.

Please write down C++ codeimage text in transcribed

E.3 Statistics on Integer Inputs Requirements Write a program that calculates statistics on a set of integer inputs Specifications 1. 2. Print a header to the console similar to the one shown in the sample output First the program will ask the user to input an integer size for the set of integers they would like to use for computation (the number of integers they wish to input in the next step) Validate that the entered integer number is greater than 0. Assume that the user will only enter integer number 3. Your program must use a loop structure (while or do-while) where the user is asked to input a new integer on each iteration, until the total number of integers have been input by the user You can assume that the user will enter integer values and no validation is required 4. After each iteration, the program will print: the mean, count of even integers, and count of odd integers, minimum value, and maximum value input thus far to the console Mean will be computed as = and the denominator is the total count of integers input. For example, if the user enters integers, the mean will be = (x1 + x2 + x3)/3, where x1, x2 and x3 are the inputted values. Note that the mean value must be computed accordingly to accommodate real number results 5, where the numerator is the sum of all integers input 6. Hints: To determine if an input is even or odd, see lecture unit 4, slide 18 Watch out for integer truncation during division: 5/2 is 2 in C++, while 5/2.0 2.5 . Sample Output Student Name Lab #3 Date: Question #2 Enter an integer number for the number of loop iterations: 3 Enter integer 1: 2 The mean of 1 input(s) is: 2 Max value: 2 Min value: 2 Even count:1 Odd count: 0 Enter integer 2: -2 The mean of 2 input(s) is: 0 Max value: 2 Min value: -2 Even count: 2 Odd count: 0 Enter integer 3: 53 The mean of 3 input(s) is: 17.6667 Max value: 53 Min value: -2 Even count: 2 Odd count: 1 Goodbye! Program ended with exit code:0 ES1036 Lab 3 Page 7 of 8

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

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago