Assignment Level 2
Assignment Level 2
provided. Ensure to complete the task and submit it by September 30, 2024.
1. Write a program that asks the user to input a number. If the number is greater than 10, print
"Greater than 10". Otherwise, print "Less than or equal to 10".
2. Write a program that asks the user to input two numbers. If the first number is larger, print
"First is larger". Otherwise, print "Second is larger".
3. Write a program that asks the user to enter a number. If the number is divisible by 3, print
"Divisible by 3". Otherwise, print "Not divisible by 3".
4. Write a program that asks the user for their height in centimeters. If their height is 150 cm or
more, print "You are tall". Otherwise, print "You are short".
5. Write a program that asks the user to enter the temperature in Celsius. If the temperature is
below 0, print "Freezing". Otherwise, print "Not freezing".
6. Write a program that asks the user for a number. If the number is 10, print "Ten". Otherwise,
print "Not Ten".
7. Write a program that asks the user to enter a grade (A, B, C, D, F). If the grade is A, print
"Excellent". If it is B, print "Good". If it is C, print "Average". If it is D, print "Below Average". If it
is F, print "Fail".
8. Write a program that asks the user to input the speed of a car. If the speed is more than 100
km/h, print "Speeding". Otherwise, print "Not speeding".
9. Write a program that asks the user for a number. If the number is less than 50, print "Below
50". If it is equal to 50, print "Exactly 50". If it is greater than 50, print "Above 50".
10. Write a program that asks the user for the current hour (0-23). If the hour is less than 12,
print "Good morning". If it is 12 or later, print "Good afternoon".
11. Write a program that asks the user to enter a number. If the number is divisible by 2 and 3,
print "Divisible by both 2 and 3". If it is divisible by only one of them, print which one.
Otherwise, print "Not divisible by 2 or 3".
12. Write a program that asks the user to input a person's age. If the age is less than 13, print
"Child". If the age is between 13 and 19, print "Teenager". If the age is 20 or above, print
"Adult".
13. Write a program that asks the user for a score (0-100). If the score is 90 or above, print "A". If
the score is 80-89, print "B". If the score is 70-79, print "C". If the score is 60-69, print "D". If
the score is below 60, print "F".
14. Write a program that asks the user for a temperature in Celsius. If it’s less than 0, print
"Freezing". If it’s between 0 and 30, print "Normal". If it’s above 30, print "Hot".
15. Write a program that asks the user for their favorite number. If the number is between 1 and
10, print "That's a small number!". Otherwise, print "That's a big number!".
16. Write a program that asks the user for the current day of the week (1 for Monday, 2 for
Tuesday, etc.). If it’s 6 or 7, print "Weekend". Otherwise, print "Weekday".
17. Write a program that asks the user for a number between 1 and 7. Print the corresponding
day of the week (1 for Monday, 2 for Tuesday, etc.).
18. Write a program that asks the user to enter their height in inches. If their height is 60 inches
or less, print "Short". If their height is between 61 and 72 inches, print "Average". If it is
greater than 72 inches, print "Tall".
19. Write a program that checks if a given year is a "Century Year" (e.g., divisible by 100). Print
"Century Year" or "Not a Century Year" accordingly.
20. Write a program that asks the user to input a number between 1 and 12. Print the
corresponding month (e.g., 1 for January, 2 for February, etc.).