Write an equivalent if...else if...else statement to replace the following switch statement
int cents;
switch (cents) {
case 1:
System.out.println("Cent.");
break;
case 5:
System.out.println("Nickle.");
case 10:
System.out.println("Dime.");
case 25:
System.out.println("Quarter.");
default:
System.out.println("Not a valid value.");
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here