-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
49 lines (38 loc) · 1.37 KB
/
Main.java
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
// package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
String Yourgroup = "group";
try (Scanner name = new Scanner(System.in)) {
System.out.print("Enter Name: ");
String urname = name.nextLine();
System.out.print("Age: ");
int urage = name.nextInt();
if( urage >= 20)
{
Yourgroup = "RED";
}
else if (urage>=15 && urage<20)
{
Yourgroup = "BLUE";
}
else if (urage>=10 && urage<15)
{
Yourgroup = "YELLOW";
}
System.out.print("Blood group: ");
try (Scanner Bloodgroup = new Scanner(System.in)) {
String urBloodgroup = Bloodgroup.nextLine();
System.out.println();
System.out.println("||----------------------||");
System.out.println(" Name: " + urname);
System.out.println(" Age: " + urage);
System.out.println(" Blood group: " + urBloodgroup);
}
}
System.out.println("||----------------------||");
System.out.println(" Your group: " + Yourgroup);
System.out.println("||----------------------||");
}
}