This is a Java program
Write a program that reads an unspecified number of integers, determines home many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number to 2 decimal places. System.out.println(countPositive);
System.out.println(countNegative);
System.out.println(total);
System.out.printf("%.2f",total * 1.0 / count);
Assume inputs are always integer [-912985158, 912985158] and ends with 0.
Input 1 2 -1 3 0
Output 3 1 5 1.25
NOTE: 1- When the input is 0 , that means, user didn't enter anything and so the expected output is single zero 0 . // Do not count zero as positive or negative number!
2- You need to read all the inputs in one single line with one space between each number. Exactly like the provided examples. Do not add extra spaces.
3- The output needs to be in separate lines.
You must use this Driver Class.
class DriverMain{
public static void main(String args[]){
GW3_P4 gw3P4 = new GW3_P4();
gw3P4.solution();
}
}

import java.util.Scanner;
public class GW3_P4 {
public void solution() {
int total = 0;
int num, count = 0, countPositive = 0, countNegative = 0;
Scanner in = new Scanner(System.in);
while (true) {
num = in.nextInt();
if(num == 0) {
break;
}
if(num < 0) {
countNegative++;
} else {
countPositive++;
}
total += num;
count++;
}
System.out.println(countPositive);
System.out.println(countNegative);
System.out.println(total);
System.out.printf("%.2f",total * 1.0 / count);
}
}

class DriverMain{
public static void main(String args[]){
GW3_P4 gw3P4 = new GW3_P4();
gw3P4.solution();
}
}

This is a Java program Write a program that reads an unspecified number of integers, determines...
Java programming 1. Write a program that reads an unspecified number of integers, determines how many positive and negative value have been read, and computes the total and average of the input values (not counting zeros. Your program ends with the input 0. Display the average as a floating point number Here are sample runs: (red indicates a user input) Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is...
Correct the five syntax, run-time or logic errors that are found in the CountAndAverageNumbers.java file. Link to the file: CountAndAverageNumbers.javaPreview the document. Make sure you include comments in your code where errors were corrected. If you do not flag each error with a comment, points will be deducted. Upload the corrected .java file here. The output of the corrected file looks like the following: Debug4Output.PNG This program reads an unspecified number of integers, determines how many positive and negative values...
(While-loop controlled by a sentinel value) Write a program that reads an unspecified number of integers. Your program ends with the input 0. Determine and display how many positive and negative values have been read, the maximum and minimum values, and the total and average of the input values (not counting the final 0).
(Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. If you entire input is 0, display 'No numbers are entered except 0.' *So I think my code is looping because the...
I need to write a program that reads an unspecified number of
scores and determines how many scores are above or equal to the
average and how many scores are below the average. Enter a negative
number to signify the end of the input. Assume that the maximum
number of scores is 100.
PreLab07 Analyze scores Write a program that reads an unspecified number of scores and determines how many scores are above or equal to the average and how...
Need help figuring this out Write a program that reads in a sequence of numbers (doubles) from standard input until 0 is read, and stores them in an array, This part is done using iteration (loop). You may assume that the maximum size of the array will not be more than 100. Your program computes the maximum number stored in the array, the count of negative numbers, and computes the sum of positive numbers, using recursion. You need to have...
10) Write a program that inputs five numbers and determines the number of negative numbers input, the number of positive numbers input and the number of zeros input. An easy way to create a counter is given in the example below: int counter 0; initializes the counter counter counter +1;//increments the counter each time is used. Note: Output should read as shown below where # replaces the number of inputs and it is displayed on a table format] (40 pts.)...
Using basic c++ 2. Count the positive and negative numbers using ***while loop*** • Write a program that reads unspecified number of integers , determines how many negative and positive values have been read. Also calculate total and average. Your program will end with input 0. • Output Enter an integer, the input ends if it is 0: 25 34 -89 72 -35 -67 21 48 0 The number of positives is 5 The number of negatives is 3 The...
Only used main method please. (Count positive and negative numbers and compute the average, of numbers) Write a program that reads an unspecified number of integers , determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Display the total as a floating-point number. Display the lowest number in the list. Display the...
Java Program 1. Write a class that reads in a group of test scores (positive integers from 1 to 100) from the keyboard. The main method of the class calls a few other methods to calculate the average of all the scores as well as the highest and lowest score. The number of scores is undetermined but there will be no more than 50. A negative value is used to end the input loop. import java.util.Scanner; public class GradeStat {...