CALCULATE THE ECONOMIC RATE OF BOWLER.ACCEPT THE NAME OF THE BOWLER. ACCEPT VALUE OF RUNS CONCEDED BECAUSE OF BOWLER IN FOUR OVERS,
RESPECTIVELY. IF ECONOMIC RATE IS LESS THAN OR EQUAL TO 9 THEN PRINT THAT THE BOWLER IS EXCELLENT.BUT IF ECONOMIC RATE IS MORE THAN 20 THEN PRINT THAT THE BOWLER IS VERY BAD. OTHERWISE IN BETWEEN RATE THEN PRINT THAT BOWLER IS AVERAGE.
Economic rate is the average number of runs conceded for every over bowled.
Example:
PROGRAM:
import java.util.Scanner;
public class economic_rate
{ static int run;
public static void main (String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the name of the bowler:");
String s = sc.nextLine();
int sum=0;
for(int i=1 ; i<=4 ; i++)
{
System.out.println("Enter number of runs conceded in "+i+" over:");
run=sc.nextInt();
sum+=run;
}
double erate = sum/4;
System.out.println("Economic rate of the bowler is: " + erate);
if(erate<=9){
System.out.println(s + " is a excellent bowler.");
}
else if(erate>9&&erate<=20){
System.out.println(s + " is a average bowler.");
}
else{
System.out.println(s + " is a very bad bowler.");
}
}
}