0
I need Help in Java-Practice 14.3
Hi Could you help me to get the right solution of the Java-Practice 14.3? It's about Logical Statemnts and the name of the practice is "Lucky Winter". Thank you.
6 Answers
+ 2
Decoder21 you probably need to move your 2nd if statement and nest it under your 1st. I'd change it to "else if" as well.
+ 1
Copy your code into the code playground and then share the code here.
Then, someone can have a look and hopefully help.
+ 1
Hi sorry for the late answer. Here is my code.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
int number = read.nextInt();
if (number %10==0 && number %9==0)
System.out.println("You won $200");
else
System.out.println("Try again");
if (number %6==0 ||number %4==0)
System.out.println("You won $50");
else
System.out.println("Try again");
+ 1
Ausgrindtube it didn't work. Could you please show it here?
+ 1
If(number %10 == 0 && number %9 ==0)
System...
Else if(number %6 == 0 || number %4 ==0)
System...
Else
System...
I think.