Question: Write code in MIPS Assembly please... Write a program for a grocery store to calculate the total charge for customers following this algorithm: 1. In

Write code in MIPS Assembly please...

Write code in MIPS Assembly please... Write a program for a grocery

Write a program for a grocery store to calculate the total charge for customers following this algorithm: 1. In the main: a) ask customer for the number of items that they are purchasing b) check to see it is less than or equal to 20 items c) pass than number to FillPriceArray subroutine and call FillPriceArray subroutine. 2. FillPriceArray subroutine: a) fill the array and accumulate the prices sub total b) return the sub total to main. 3. In the main: a) ask customer for the number of coupons (it should be the same as the number of items) b) pass the coupon number to FillCouponArray subroutine and call FillCouponArray subroutine to fill the CouponArray. 4. FillCouponArray subroutine: a) fills the array and accumulate the discount total *get the coupon amount: The coupon should be less than item price and coupon should not be more than $10 if the coupon is more than item price or exceed $10 then you place in the CouponArray for that coupon. b) return coupon sum to main 5. In the main: a) calculate the total charge by subtracting the total price from total discount coupons b) out put the total charge with a thank you massage on the screen. Example: Please enter the number of item you are purchasing: Sorry, too many items to purchase!! Please enter number of items you are purchasing: 21 3 10 Please enter the price of item 1: Please enter the price of item 2: Please enter the price of item 3: 10 20 Please enter the number of coupons that you want to use. Too many coupons!! Please enter the number of coupons that you want to use. 3 Please enter the amount of coupon 1: 15 This coupon is not acceptable Please enter the amount of coupon 2: 5 Please enter the amount of coupon 3: 5 Your total charge is: $30 Thank you for shopping with us

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!