New to Programming!!HW Help!
HEEEY Guy . Im having trouble exactly getting my code to do what the problem says here it is..[
Loops. Using the Die class defined in Chapter 4, design and implement a driver class called CountFaces whose main method rolls a die 100 times and counts how many times each face comes up. Using (a) while() loop, (b) do .. while() and (c) for loop, print the results. Use switch, not if statement.
public class Crapz {
public static void main(String[] args) {
die die1 = new die();
int x;
x = 0;
die1.getFaceValue();
die1.roll();
while (x <=100) {
System.out.println(die1.roll());
x ++;
}
do {
System.out.println(die1.roll());
x++;
} while(x <= 100);
for ( x=1 ;x<=100;x++) {
System.out.println(die1.roll());
x ++;
}
}
}
ps i have no clue how to actually collect the numbers to store them...