MIPS assembly language please help  Write a program for a grocery store to calculate the total charge for customers. In the main:Your program should ask customer the number of items that he/she is purchasing and it should check to see it is less than or equal to 20 items , then your program should passthan number to FillPriceArray subroutine.FillPriceArray subroutine fills the array, accumulate the prices and returnthe sumto main.In the main you get the number of couponsform user (it should be the same as the number of items)and pass the coupon number to FillCouponArray  function.FillCouponArray function gets 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 0 in the CouponArray for that coupon. Also the FillCouponArray function accumulates the coupons and return it to main. Finally your main program should calculate the total charge by subtracting the total price from total discount coupons and out put the total charge with a thank you massage on the screen. Sample Output: Please enter the number of item you are purchasing(should be less than or equal to 20)        21       Sorry too many items to purchase!! Please enter number of items you are purchasing        3         Please enter the price of item 1            10        Please enter the price of item 2            10        Please enter the price of item 3            20         Please enter the number of coupons that you want to use.        4        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.

Question
Asked Oct 9, 2019
66 views

MIPS assembly language please help

 

 Write a program for a grocery store to calculate the total charge for customers.

 In the main:

Your program should ask customer the number of items that he/she is purchasing and it should check to see it is less than or equal to 20 items , then your program should passthan number to FillPriceArray subroutine.

FillPriceArray subroutine fills the array, accumulate the prices and returnthe sumto main.

In the main you get the number of couponsform user (it should be the same as the number of items)and pass the coupon number to FillCouponArray  function.

FillCouponArray function gets 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 0 in the CouponArray for that coupon. Also the FillCouponArray function accumulates the coupons and return it to main. Finally your main program should calculate the total charge by subtracting the total price from total discount coupons and out put the total charge with a thank you massage on the screen.

 Sample Output:

 Please enter the number of item you are purchasing(should be less than or equal to 20)

        21

       Sorry too many items to purchase!! Please enter number of items you are purchasing

        3

 

        Please enter the price of item 1   

        10

        Please enter the price of item 2   

        10

        Please enter the price of item 3   

        20

 

        Please enter the number of coupons that you want to use.

        4

        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.

check_circle

Expert Answer

Step 1

Some definitions required to know before doing this program: -

1.What is Mars?

2.What is MIPS?

3.What is MARS MIPS Simulator

Let’s us explain one by one-

Mars: It’s an Integrated Development Environment for Mips (Microprocessor without Interlocked Pipelined Stages) Assembly Language Programming to perform the mips various tasks in the Processor.

Mips (Microprocessor without Interlocked Pipelined Stages): Its used to measure the computer performance, how much a computer can do a work more than one simultaneously in same time. It’s also used to calculate the measurement of cost of computing. The speed of the computer is measured by the MIPS.

MARS MIPS Simulator is an assembly language editor, or you can say it’s an IDE for the MIPS instructions.

Questions asked:

  1. To ask customer the number of items that is purchasing and check that is it less than or equal to 20 items or not and after then it should bs pass to FillPriceArray subroutine.
  2. FillPriceArray should be fills the array accumulate the price of the items and then its return to the main fu...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Computer Architecture

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: The code you will need for this assignment is here (in C file)   /* YOUR NAME HERE* CSCI 4100* Progr...

A: C shell is a type of command processor which enables user to write and modify commands .It can also ...

question_answer

Q: What can you show me about Python rules and methods?

A: Note:The following summary is about some syntax rules followed in python and rules to define a metho...

question_answer

Q: How would I go about writing this program?

A: Create a class and get int type data from a user, to print the number of lines on console.Use three ...

question_answer

Q: Describe the process of how to solve the substitution cipher below and solve it: ZFSZB YESUK SQYDJ S...

A: The process is as follows:scan to look for single letter words – they would most likely correspond t...

question_answer

Q: Briefly discuss the advantages and disadvantages off frequent software upgrades

A:  Advantages of frequent software upgrades:Software upgrades can increase the performance of the syst...

question_answer

Q: Please explain all steps: What Boolean equation is represented by the following K-Maps: a)    ...

A: K-Map simplificationFor 3 variables adjacent groups of 2 cells, or 4 cells (1 x4 or 2 x 2), for 4 va...

question_answer

Q: The category of operating system used for handheld devices.

A:  Handheld DevicesA handheld device is an electronic or a computing device that can be carried in our...

question_answer

Q: What is it when they say 4g or 5g phone network

A: The usage of 4G or 5G defines that the mobile phone includes 4G or 5G network for the communication....

question_answer

Q: Describe an application where smart cards provide sufficient security but magnetic stripe cards do n...

A: Smart Card A smart card, ICC (integrated circuit card) is a plastic card. A smart card may have a ma...