Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to calculate the avg with count and sum values ? keep getting divison wrong. ex: only enter number -9 for use input and get

how to calculate the avg with count and sum values? keep getting divison wrong. ex: only enter number -9 for use input and get back -4 as avg but 1 for count and -9 for sum.
image text in transcribed
3. Display instructions for the user. 4. Repeatedly prompt the user to enter a number. a. Validate the user input to be in [200,100] or [50,1] cinclusive), b. Notify the user of any involid negative numbers (negative, but not in the ranges specified) c. Count and accumulate the valid user numbers until a non-oegative number is entered. Detect this using the SIGN flag. (The non-negative number and any numbers not in the specified ranges are discarded.) 5. Calculate the (rounded integer) average of the valid numbers and store in a variable: 6. Display: a. the count of validated numbers entered NOTE: if no valid numbers were entered, display a special message and skip to ( f ) b. the sum of valid numbers c. the muximum (closest to 0 ) valid user value entered d. the minimum (farthest from 0 ) valid user value entered e. the averase, rounded to the nearest integer i. 20.01 rounds to 20 ii. 20.5 rounds to 20 iii. 20.51 rounds to 21

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

More Books

Students also viewed these Databases questions

Question

Explain the supervisors role in supporting lean concepts.

Answered: 1 week ago

Question

1. Describe the power of nonverbal communication

Answered: 1 week ago