-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotOrt.java
More file actions
57 lines (37 loc) · 1.46 KB
/
NotOrt.java
File metadata and controls
57 lines (37 loc) · 1.46 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.util.Scanner;
public class NotOrt {
public static void main(String[] args) {
int numberOfLesson=0;
int avange=0;
Scanner scn = new Scanner(System.in);
System.out.println("Enter your math grade: ");
int math = scn.nextInt();
System.out.println("Enter your Turkish grade: ");
int Turkish = scn.nextInt();
System.out.println("Enter your physic grade: ");
int phy = scn.nextInt();
System.out.println("Enter your biology grade: ");
int bio = scn.nextInt();
System.out.println("Enter your chemistry grade: ");
int che = scn.nextInt();
if (math!=0&&math!=100) {
avange+=math;
numberOfLesson++;}
if (phy!=0&&phy!=100) {
avange+=phy;
numberOfLesson++;}
if (Turkish!=0&&Turkish!=100) {
avange+=Turkish;
numberOfLesson++;}
if ((bio!=0&&bio!=100)){
avange+=bio;
numberOfLesson++;}
if(che!=0&&che!=100) {
avange += che;
numberOfLesson++;
System.out.println("Derslerin Ortalaması: " + (avange / numberOfLesson));}
else {
System.out.println("Ortalamanız Hesaplanamaz!!");
}
}
}