Question: Phase 1 (3 points): Implement the following program in MIPS: . In the main program: switch(month) o o o get month from the user if

 Phase 1 (3 points): Implement the following program in MIPS: .

Phase 1 (3 points): Implement the following program in MIPS: . In the main program: switch(month) o o o get month from the user if the user enters 0, exit the program if the month is not 1-12, print an error message and repeat case 4: case 6: case 9: case 11: o print the month and number of days as shown in the sample run . Write a function to determine the number of days by days=30; break; implementing the switch statement shown in the box in MIPS case 1: case 3: case 5 case 7: case 8: case 10: case 12: Sample Phase 1 run: Please enter the month 1 - 12, enter 0 to quit: 1 Number of days in month 1 is: 31 Please enter the month 1 12, enter 0 to quit: 5 Number of days in month 5 is: 31 Please enter the month 1 12, enter 0 to quit: 12 Number of days in month 12 is: 31 Please enter the month 1 12, enter 0 to quit: 13 Month must be between 1 and 12 Please enter the month 1 - 12, enter 0 to quit: -5 Month must be between 1 and 12 Please enter the month 1 - 12, enter 0 to quit: 0 days 31; break; case 2: days = 28; break; Phase 2 (2 additional points): Instead of printing the number of the month, print the 3 character abbreviation as shown in this sample run: Please enter the month 1 12, enter 0 to quit:2 Number of days in Feb is: 28 Please enter the month 1 - 12, enter 0 to quit: 4 Number of days in Apr is: 30 Please enter the month 1 - 12, enter 0 to quit:8 Number of days in Aug is: 31 Please enter the month 1 - 12, enter 0 to quit: 0 program is finished running- Phase 1 (3 points): Implement the following program in MIPS: . In the main program: switch(month) o o o get month from the user if the user enters 0, exit the program if the month is not 1-12, print an error message and repeat case 4: case 6: case 9: case 11: o print the month and number of days as shown in the sample run . Write a function to determine the number of days by days=30; break; implementing the switch statement shown in the box in MIPS case 1: case 3: case 5 case 7: case 8: case 10: case 12: Sample Phase 1 run: Please enter the month 1 - 12, enter 0 to quit: 1 Number of days in month 1 is: 31 Please enter the month 1 12, enter 0 to quit: 5 Number of days in month 5 is: 31 Please enter the month 1 12, enter 0 to quit: 12 Number of days in month 12 is: 31 Please enter the month 1 12, enter 0 to quit: 13 Month must be between 1 and 12 Please enter the month 1 - 12, enter 0 to quit: -5 Month must be between 1 and 12 Please enter the month 1 - 12, enter 0 to quit: 0 days 31; break; case 2: days = 28; break; Phase 2 (2 additional points): Instead of printing the number of the month, print the 3 character abbreviation as shown in this sample run: Please enter the month 1 12, enter 0 to quit:2 Number of days in Feb is: 28 Please enter the month 1 - 12, enter 0 to quit: 4 Number of days in Apr is: 30 Please enter the month 1 - 12, enter 0 to quit:8 Number of days in Aug is: 31 Please enter the month 1 - 12, enter 0 to quit: 0 program is finished running

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!