-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask2 ii.java
More file actions
26 lines (23 loc) · 928 Bytes
/
task2 ii.java
File metadata and controls
26 lines (23 loc) · 928 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
//program that asks a lecturer to enter marks for three units, java programming,
//networking and maths. The method should compute the average
package average2;
//import scanner
import java.util.Scanner;
public class Average2 {
//declaring variabes
static int java, networking, maths, average;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//ask lec to enter marks for java
System.out.println(" marks for java is");
java =input.nextInt();
//ask lec to enter marks for networking
System.out.println(" marks for networking is");
networking =input.nextInt();
//ask lec to enter marks for maths
System.out.println(" marks for maths is");
maths =input.nextInt();
average=(networking+maths+java)/3;
System.out.println("the average is: "+average);
}
}