Search for question
Question

(where X stands for the portion of the assignment to follow)

Section

Enter the comment with the section title.

Request the user to enter two whole numbers and store those whole numbers in two appropriately defined variables.

Using separate and independent if statements, compare the two whole numbers with each of the following comparison operators. ==, !=, <, >, <=₁

Each if statement that proves true should print to the console the numbers compared and the comparison made. e.g., “5 > = 2â€

Hint: If the user enters the numbers 5 and 2, then the expected output would be:

52

5 > 2

5 >= 2

Section 2:

1:

Enter the comment with the section title.

Request the user to enter a grade.

Using an if statement with an else clause, compare the user input with the number 60.

If the grade entered is greater than or equal to 60, then print to the console, “Congratulations, you passed.â€

If the grade is below 60, then print to the console, “Sorry, you failed. â€

Section 3:

Enter the comment with the section title.

Request the user to enter a number, 1 through 12, which will represent the month of the year.

Using an if statement with a series of elif statements, determine which month was entered.

Print the name of the month to the console.

Include a final else and print an error message if the number proves to be invalid.

Section 4:

Enter the comment with the section title.

Request the user to enter a number, 1 through 7, which will represent the day of the week.

Using Python’s match statement, determine which day of the week was entered.

Print the name of the day of the week to the console.

Print an error message if the number proves to be invalid. (Hint: use the case unknown-command as the final case to catch any values out of the specified range.)

POSSIBLE EXPECTED OUTPUT

Enter first integer: 3

Enter second integer: 9

3 <> 9

3 < 9

3 <= 9

Enter grade and determine whether you passed: 60

Congratulations, you passed

Enter the number of the month: 7

The month is July.

Enter the number of the day of the week: 1

Sunday

Fig: 1