class Main {
public static void main(String[] args){
int counter = 0;
System.out.println("FLIPS USING WHILE LOOP\n----------------");
while(counter<10){
counter+=1;
//generate random flip
double coin = Math.round(Math.random());
//output in words
if (coin == 1){
System.out.println("tails");
}
else{
System.out.println("heads");
}
}
System.out.println("\nFLIPS USING FOR LOOP\n----------------");
for(int flipNumber=1; flipNumber<=10; flipNumber++){
//generate random flip
double coin2 = Math.round(Math.random());
//output in words
if (coin2 == 1){
System.out.println("tails");
}
else{
System.out.println("heads");
}
}
}
}