subject

The program prompts the user for five to ten numbers all on one line, separated by spaces, calculates the average of those numbers, and displays the numbers and their average to the user. The program uses methods to:

1) get the numbers entered by the user all on one line separated by spaces;

2) calculate the average of the numbers entered by the user; and

3) print the results.

The first method should take no arguments and return a String of numbers separated by spaces.

The second method should take a String as its only argument and return a double (the average).

The third method should take a String and a double as arguments but have no return value.

IF user input is: 20 40 60 80 100

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:50, akornegay2
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
image
Computers and Technology, 23.06.2019 15:10, cathyjuan
What role did women fill during world war ii?
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, genyjoannerubiera
In which view can you see speaker notes?
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, yola32
What is the most important for you to choose before you build a network?
Answers: 1
You know the right answer?
The program prompts the user for five to ten numbers all on one line, separated by spaces, calculate...

Questions in other subjects: