class agame {
cricketer a;
void play() {
a=new cricketer();
a.run();
}
}
class cricketer {
String[] p={"dhoni","gambhir","yosuf","ashwin","kohli","jadeja","dhawan","kartik","yuvraj","sehwag","samson"};
score k;
void run() {
k=new score();
int m=0;
int a=1;
System.out.print("match scorecard"+"\n");
while(m<=10)
{
System.out.print(a+"."+p[m]);
k.total();
m=m+1;
a=a+1;
}
k.netscore();
}
}
class score {
int num=0;
int y=0;
void total() {
int j=1;
int u=0;
int p;
while(j<=10)
{
p=(int)(Math.random()*20);
u=u+p;
j=j+1;
}
y=y+u;
System.out.println(" "+u);
}
void netscore()
{
System.out.print("\n\n\t\t\t"+" total: "+y);
}
}
public class casino
{
public static void main(String[] args)
{
agame nw;
nw=new agame();
nw.play();
}
}
cricketer a;
void play() {
a=new cricketer();
a.run();
}
}
class cricketer {
String[] p={"dhoni","gambhir","yosuf","ashwin","kohli","jadeja","dhawan","kartik","yuvraj","sehwag","samson"};
score k;
void run() {
k=new score();
int m=0;
int a=1;
System.out.print("match scorecard"+"\n");
while(m<=10)
{
System.out.print(a+"."+p[m]);
k.total();
m=m+1;
a=a+1;
}
k.netscore();
}
}
class score {
int num=0;
int y=0;
void total() {
int j=1;
int u=0;
int p;
while(j<=10)
{
p=(int)(Math.random()*20);
u=u+p;
j=j+1;
}
y=y+u;
System.out.println(" "+u);
}
void netscore()
{
System.out.print("\n\n\t\t\t"+" total: "+y);
}
}
public class casino
{
public static void main(String[] args)
{
agame nw;
nw=new agame();
nw.play();
}
}
No comments:
Post a Comment