Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Write a simple program that checks if a number is positive or negative. Use an else statement.
Remember that zero is not negative.
Create a simple login program that checks if a user is logged in.
Think about what the else statement will execute when the if condition is not true.
What does the else statement do?
Think about when you would want to execute code as the alternative.
True or False: The else statement can exist by itself without an if statement.
Reflect on the necessity of if for defining actions.
Develop a complete grading program that takes a score input and outputs the grade A, B, C, D, or F based on standard grading criteria.
Think about the ranges for each grade tier.
Design a weather program that suggests whether to take an umbrella based on the predicted weather conditions input.
Encourage consideration of various weather states.
4 more questions in this section. Enroll free to practise them all.
Enroll free