Program DROPAGARKAR
By India_raising, NewsJunkie - 19 April '03
April 19 2003
Program DROPAGARKAR
by India_raising & NewsJunkie, 19 April '03
import java.util.*;
/*
* author : india_raising
* concept : news_junkie
* inspiration : gaurang
* reviewed by : dhiresh,gullu,amit,gambit,shiva,.....
* (dis)approved by : anil_
* rev : 1.0
*/
public class DROPAGARKAR {
private static final X=4 // note this is final variable , cant be altered
private static final Y=8 // again final variable
private double strikeRate;
private int wickets;
private double ecoRate;
private int matchesPlayed=0;
private boolean play_mode=true;
public static void main(args String[]){
startPlay();
exit;
}
public void startPlay() {
play_mode=true;
wickets=2;
ecoRate=3.4;
strikeRate=28;
System.out.println("*** play started ");
while(matchesPlayed < X) {
wickets++;
ecoRate = ecoRate+1;
strikeRate = strikeRate+2;
System.out.println("*** playing "+matchesPlayed+1 +" match");
System.out.println("*** wickets taken this match = +wickets + " strike rate = "+strikeRate + "economy rate = "+ecoRate);
if (matchesPlayed = X-1) {
play_mode=false;
wickets=0;
ecoRate=6.5;
strikeRate=38;
System.out.println("*** wickets taken this match = +wickets + " strike rate = "+strikeRate + "economy rate = "+ecoRate);
System.out.println("*** dropped from team for 8 matches , play in ranji trophey and come back again");
exit;
}
}
}
}// end class
After you compile and run this program, output is like this:
*** play started
*** playing 1st match
*** wickets taken this match = 2 strike rate = 28 economy rate =3.4
*** playing 2nd match
*** wickets taken this match = 3 strike rate = 26 economy rate =4.4
*** playing 3rd match
*** wickets taken this match = 4 strike rate = 24 economy rate =4.3
*** playing 4th match
*** wickets taken this match = 0 strike rate = 38 economy rate =6.5
*** dropped from team for 8 matches, play in ranji trophy and come back again
View a Printer Friendly version of this Story.
Bookmark or share this story with: