Question: Write a MIPS assembly language program that computes the total amount that a customer needs to pay when purchasing T-shirts. The program needs to read

Write a MIPS assembly language program that computes the total amount that a customer needs to pay when purchasing T-shirts. The program needs to read in a number of T-shirts and asks a user to enter 1 if they have a discount coupon. If a user enters a number of T-shirts that is less or equals to 0, then the program needs to print out the message Invalid Number of T-shirts. and exits. If a user enters a number of T-shirts between 1 and 49, then each T-shirt costs $7 each. If a number of T-shirts is between 50 and 99, then each T-shirt costs $6 each. If a number of T-shirts is 100 or greater than 100, then each T-shirt costs $5 each. If a user has a discount coupon, they gets a discount of $5. The program needs to compute each users total payment amount and to print it out.

Here is a sample output (user input is in bold):

-----------------------------------------------

How many T-shirts would you like to order?

43

Do you have a discount coupon? Enter 1 for yes. (any other integer will indicate no discount)

0

Your total payment is $301

-----------------------------------------------

Here is another sample output (user input is in bold):

-----------------------------------------------

How many T-shirts would you like to order?

67

Do you have a discount coupon? Enter 1 for yes. (any other integer will indicate no discount)

1

Your total payment is $397

-----------------------------------------------

Here is another sample output (user input is in bold):

-----------------------------------------------

How many T-shirts would you like to order?

133

Do you have a discount coupon? Enter 1 for yes. (any other integer will indicate no discount)

1

Your total payment is $660

-----------------------------------------------

Here is another sample output (user input is in bold):

-----------------------------------------------

How many T-shirts would you like to order?

-5

Invalid Number of T-shirts.

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!