package gradeAvg;
import java.util.Scanner;
//Grade Average calculater
public class GradeAvg {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.print("Please Enter the first grade being added to the average:");
double average = input.nextInt();
System.out.print("The average is now: " + average + " Please enter the second grade being averaged:");
average += input.nextInt() ;
System.out.print("The average is now: " + average + " Please enter the third grade being averaged:");
average += input.nextInt()/2;
System.out.print("The average is now: " + average + " Please enter the fourth grade being averaged:");
average += input.nextInt()/2;
System.out.print("The average is now: " + average + " Please enter the fifth grade being averaged:");
average += input.nextInt()/2;
input.close();
System.out.print(average);
}
}
Привет, ребята, я действительно новичок в java и довольно ужасен по математике, я должен делать программу, которая позволяет пользователю вводить значение, усреднить, распечатать его, а затем разрешить ввод другого значения, усреднить его и распечатать и продолжить. Я ошибаюсь, когда я делюсь на 2 в конце каждого ввода или что?Попытка усреднить каждый раз, когда что-то добавляется