-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexp3b.java
More file actions
35 lines (35 loc) · 1.06 KB
/
exp3b.java
File metadata and controls
35 lines (35 loc) · 1.06 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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("NAME: Saachi Kokate \n ROLL NO : 50 \n BATCH : S13");
newmain obj = new newmain();
Scanner sc = new Scanner(System.in);
System.out.println("Enter your name:");
String name = sc.nextLine();
System.out.println("Enter your annual income:");
float income = sc.nextFloat();
System.out.println("Enter your marks:");
float marks = sc.nextFloat();
obj.scholarship(marks, income, name);
}
}
class newmain {
void display(String scholarship) {
System.out.println("Scholarship status : " + scholarship);
}
void scholarship(float marks, float income, String name) {
String scholarship;
if (income > 100000 && marks > 95) {
scholarship = "NOT ELIGIBLE";
} else if (income < 100000 && marks < 95) {
scholarship = "NOT ELIGIBLE";
} else if (income <= 100000 && marks > 95) {
scholarship = "ELIGIBLE";
} else if (income > 100000 && marks < 95) {
scholarship = "CAN APPLY FOR DONATION HAHAHAHAH";
} else {
scholarship = "PUT VALID DATA";
}
display(scholarship);
}
}