-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT40.java
More file actions
62 lines (53 loc) · 1.28 KB
/
YT40.java
File metadata and controls
62 lines (53 loc) · 1.28 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
58
59
60
61
62
//funn 2023
import java.util.*;
public class YT40
{
String name, stream;
int age;
double mks;
public void accept()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the name: ");
name= sc.nextLine();
System.out.println("Enter the age: ");
age= sc.nextInt();
System.out.println("Enter the marks: ");
mks= sc.nextDouble();
sc.close();
}
public void allocation()
{
if(mks>=300)
{
stream="Science and Computer";
}
else if(mks>=200 && mks<300)
{
stream="Commerce and Computer";
}
else if(mks>=75 && mks<200)
{
stream="Arts and Animation";
}
else
{
stream="Try Again";
}
}
public void print()
{
System.out.println();
System.out.println("Name: "+name);
System.out.println("Age: "+age);
System.out.println("Marks: "+mks);
System.out.println("Stream: "+stream);
}
public static void main(String[] args)
{
YT40 y1 = new YT40();
y1.accept();
y1.allocation();
y1.print();
}
}