- 2
Write a Java program to display the lamp is no if its true or the light is off.
4 Réponses
+ 1
Do you have any knowledge for the Java language?
Show your attempt.
Create a variable with a name. Give it a value for on.
Create a if statement with the condition for on. if true it should output the the lamp is on.
Create and else statement and print the lamp is off.
Here is some info for If...else statements.
https://www.w3schools.com/java/java_conditions.asp
0
I don't want to. But if you need help doing so, show some code so you can get proper help.
0
"the lamp is no if its true"?
What do you mean?
If you need help, please show what you have tried so far. If you need to revise the basics before doing the task, have a look at the sololearn Java course.
0
//"lamp is no"
"lamp is on"