-
-
Save krystian-booker/a1c908bafe544cb414a0b0af55ba7f25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Week3Task1 { | |
public static void main(String[] args) { | |
// Declare an integer variable named temperature and assign it a value of 20. | |
int temperature = 20; | |
// Use an if-else statement to print different messages based on temperature | |
if (temperature > 30) { | |
System.out.println("It's hot."); | |
} else if (temperature > 15) { | |
System.out.println("It's warm."); | |
} else { | |
System.out.println("It's cold."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment