I have this school assignment and I just about got it but for some reason I cannot get the continue to let me continue after I click y.
import java.util.Scanner;
public class Project4 {
/**
*
* @param args
*/
public static void main(String[] args) {
//Welcome user to the program
System.out.println ("Welcome to the factorial calculator");
int z;
double b= 1;
Scanner sc=new Scanner(System.in);
String choice = ("y");
// Get the integer
System.out.print("Enter an integer that's greater than 0 but less than 9: ");
z=sc.nextInt();
// Calculate the factorial
System.out.println("The factorial is: " +z+ ":");
for (int i=1 ; i<=z; i++){
b=b*i;
}
System.out.println(b);
//See if the user wants to continue
System.out.print("Continue? (y/n): ");
choice = sc.next();
System.out.println();
}
}