-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1 ii.java
More file actions
31 lines (29 loc) · 1.13 KB
/
task1 ii.java
File metadata and controls
31 lines (29 loc) · 1.13 KB
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
//program that ask user to enter their marks and it computes their average marks
package average;
//importing scanner
import java.util.Scanner;
public class Average {
//declaring variables
static int HCI,networking,maths,cabling,java;
static float average;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//ask user to enter marks of Hci
System.out.println("enter marks of HCI");
HCI=input.nextInt();
//ask user to enter marks of networking
System.out.println("enter marks of networking");
networking=input.nextInt();
//ask user to enter marks of maths
System.out.println("enter marks of maths");
maths=input.nextInt();
//ask user to enter marks of cabling
System.out.println("enter marks of cabling");
cabling=input.nextInt();
//ask user to enter marks of java
System.out.println("enter marks of java");
java=input.nextInt();
average=(HCI+networking+maths+cabling+java)/5;
System.out.println("average of marks is"+average);
}
}