Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is moral hazard and how might it affect entrepreneurial firms?

Answered: 1 week ago