-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcricket_20BAI1150.java
More file actions
49 lines (45 loc) · 1.85 KB
/
cricket_20BAI1150.java
File metadata and controls
49 lines (45 loc) · 1.85 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
import java.util.*;
public class cricket_20BAI1150 {
public static void main(String argv[])
{
List<String> duckout_innings = new ArrayList<>();
List<String> thirtyplus_innings = new ArrayList<>();
List<String> fiftyplus_innings = new ArrayList<>();
List<String> century_innings = new ArrayList<>();
int n;
Scanner sc= new Scanner(System.in);
System.out.println("Enter the number of cricketers : ");
n=sc.nextInt();
System.out.println("---ENTER INNINGS AND CRICKET DETAILS---");
for(int i=0;i<n;i++)
{
String innings_type,cricketer_name,play_type,country_belonging;
System.out.println("Enter the cricketer name : ");
cricketer_name=sc.next();
System.out.println("Enter the country in which player belongs to : ");
country_belonging=sc.next();
System.out.println("Enter the innings type : ");
innings_type=sc.next();
if(innings_type.equals("duckout"))
{
duckout_innings.add("duckout");
}
if(innings_type.equals("thirtyplus"))
{
thirtyplus_innings.add("thirtyplus");
}
if(innings_type.equals("fiftyplus"))
{
fiftyplus_innings.add("fiftyplus");
}
if(innings_type.equals("century"))
{
century_innings.add("century");
}
}
System.out.println("Number of duckout Innings scored : "+duckout_innings.size());
System.out.println("Number of thirty plus Innings scored : "+thirtyplus_innings.size());
System.out.println("Number of fifty plus Innings scored : "+fiftyplus_innings.size());
System.out.println("Number of century Innings scored : "+century_innings.size());
}
}