-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAverageScores.java
More file actions
31 lines (16 loc) · 828 Bytes
/
Copy pathAverageScores.java
File metadata and controls
31 lines (16 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class AverageScores{
public static void main(String[]args){
Scanner input = new Scanner(System.in);
System.out.print("Enter score 1: ");
int score1 = input.nextInt();
System.out.print("Enter score 2: ");
int score2 = input.nextInt();
System.out.print("Enter score 3: ");
int score3 = input.nextInt();
int total = score1 + score2 + score3;
double average = total/3;
System.out.println("Total score:",total);
System.out.printf ("Average score:%2f\n\n", average);
}
}