subject

Write a program that calculates the average of a stream of non-negative numbers. The user can enter as many non-negative numbers as they want, and they will indicate that they are finished by entering a negative number. For this program, zero counts as a number that goes into the average. Of course, the negative number should not be part of the average (and, for this program, the average of 0 numbers is 0). You must use a method to read in the numbers, keep track of the running sum and count, compute the average, and return the average to the main() method. Note that you must use a loop to do this, as you don't know how many numbers the user will enter ahead of time.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
What “old fashioned” features of checking accounts is p2p replacing
Answers: 3
question
Computers and Technology, 22.06.2019 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
You know the right answer?
Write a program that calculates the average of a stream of non-negative numbers. The user can enter...
Questions
question
Mathematics, 24.10.2021 14:00
question
Mathematics, 24.10.2021 14:00
question
Mathematics, 24.10.2021 14:00
question
Biology, 24.10.2021 14:00
Questions on the website: 13722363