subject

(Sum and average of a set of integers entered by the user) Write a Java program that reads an unspecified number of integers (but no more than twenty, total), determined how many of those were positive vs. negative, and computes the total sum and the average of the entered values. The program stops prompting the user to enter more integers once either 0 has been entered as input, or if there have been twenty entered (non-zero) values. You are encouraged, but not strictly required to use methods. Show the output of your Java program on five sets of inputs, total. Three sets are your choice, under the constraint that there should be at least five input non-zero values before the first 0 is encountered. The remaining two test runs should be on the following input sequences: 1 2-1 35 10 -5 -10 0 1 -1 2-2 3-3 4-4 5 -5 0

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, yyy77uh
You will be given two character arrays of the same size, one will contain a number of ships. ships will move around the character array based on which way they are facing and the route they are on. routes are given in the other array. the route consists of '-' and '|' for straight paths, '\' and '/' for curves, and '+' for intersections. there are ships on these routes. ships always face a direction, '^' for up, '> ' for right, 'v' for down, and '< ' for left. any time the ships hit a '\' or a '/' it will turn as you would expect a ship to turn (e. g. a '^' that moves into a '/' will turn right). at an intersection, ships will always continue straight through. all ships move at the same speed, ships take turns moving and all ships move during one 'tick'. the one in the most top left goes first, followed by those to its right, then the ones in the next row. it iterates along the rows and then down the columns. each ship moves one space on its turn moving along the route. your function needs to return the position of the first collision between two ships and the number of ticks before the crash occurred.
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 23.06.2019 06:10, erick7123
The head restraint should be adjusted so that it reaches a. the top of your ears b. the base of your skull c. the top of the head
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, kodak0531
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
You know the right answer?
(Sum and average of a set of integers entered by the user) Write a Java program that reads an unspec...

Questions in other subjects: