Computer Science, asked by vihangaravishka30, 1 month ago

Write a single Java program to perform the following:

1. Read the (11) names of Sri Lankan cricket players

2. Read the number of wickets taken in the year 2020 by each player

3. Read the total runs in the year 2020 by each player

4. Display the name of the player who got maximum number of wickets in the year 2020

5. Display the name of the player who got maximum runs in the year 2020.

6. Display the name of the player who got minimum runs in the year 2020.​

Answers

Answered by AaravChhabra3008
2

(A) There are 6 bowlers, 3 wicket keepers and 11 batsman in all. The number of ways in which a  

team of 4 bowlers, 2 wicket keepers and 5 batsman can be chosen.

=  

6

C  

4

×  

3

C  

2

×  

11

C  

5

 

=  

6

C  

2

×  

3

C  

1

×  

11

C  

5

 

$$=\frac{6\times 5}{5\times 1}\times \frac{3}{1}\times \frac{11\times 10\times 9\times 8\times  

7}{5\times 4\times 3\times 2\times 1}$$

=20790

Answered by aniketkatiyar1pdgi1k
5

Explanation:

import java.util.Scanner;

class prp_7th {

public static void main(String[] args) {

String[] str = new String[11];

int[] wicket = new int[11];

int[] run = new int[11];

for (int i = 1; i <= 11; i++) {

System.out.println("Enter the player" + " " + i + " " + "name,wicket and run:");

Scanner sc = new Scanner(System.in);

str[i] = sc.nextLine();

wicket[i] = sc.nextInt();

run[i] = sc.nextInt();

}

int temp ;

for (int i = 1; i <= 11; i++) {

for (int j = i + 1; j <= 11; j++) {

if (wicket[i] > wicket[j]) {

temp = wicket[i];

wicket[i] = wicket[j];

wicket[j] = temp;

}

}

}

int temp1;

for (int i = 1; i <= 11; i++) {

for (int j = i + 1; j <= 11; j++) {

if (run[i] > run[j]) {

temp1 = run[i];

run[i] = run[j];

run[j] = temp1;

}

}

}

System.out.println("maximum number of wicket taker bowler in 2020 is: "+wicket[11]);

System.out.println("maximum number of scoring run in 2020 is: "+run[11]);

System.out.println("minimum number of scoring run in 2020 is: "+run[1]);

}

}

Similar questions