what am i doing wrong ?????

output:

frequency:

15
.
.
.
5 *
. * *
. * * *
. * * *
0 * * * * * *

1 2 3 4 5 6 face

NOTE: the stars display randomly.my problem is the position of the star is not displayed

in the correct place so help me ok ! the program listing down there!


public class Ass{

public static void main(String [] args){

int dice;

int c1=0,c2=0,c3=0,c4=0,c5=0,c6=0;


for (int i=0;i<60;i++){

dice=(int)(1+Math.random()*6);

if(dice==1)

c1++;
else if(dice==2)
c2++;
else if(dice==3)
c3++;
else if(dice==4)
c4++;
else if(dice==5)
c5++;
else if(dice==6)
c6++;

}

System.out.println("Frequency");

System.out.println("~~~~~~~~~
");



System.out.print(c1+"

");

System.out.print(c2+"

");

System.out.print(c3+"

");

System.out.print(c4+"

");

System.out.print(c5+"

");

System.out.print(c6);





for(int a=0;a<c1;a++)

System.out.println(" *");




/* System.out.print(c2+"

");



System.out.print(c3+"

");



System.out.print(c4+"

");


System.out.print(c5+"

");


System.out.print(c6);*/





/* for(int c=0;c<c3;c++)
System.out.println("*");
System.out.print(" ");


for(int d=0;d<c4;d++)
System.out.println("*");
System.out.print(" ");


for(int e=0;e<c5;e++)
System.out.println("*");
System.out.print(" ");


for(int f=0;f<c6;f++)
System.out.println("*");
System.out.print(" ");*/


System.out.print(" "+"----------------------------------------------------->Face");

System.out.println();

System.out.print(" 1 ");



System.out.print("2 ");


System.out.print("3 ");

System.out.print("4 ");


System.out.print("5 ");


System.out.print("6 ");

}

}

Comments

  • I am not exactly sure what you are asking....what exactly is the program supposed to do?

  • i already listed up the output that the program is supposed to do !

    but the progam contains some problems that the output doesnot exactly what i want
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories