Question: Q: Asking for assistance in understanding and solving these examples on MIPS assembly programs (Digital Design and Computer Architecture) with the steps of the solution

Q: Asking for assistance in understanding and solving these examples on MIPS assembly programs (Digital Design and Computer Architecture) with the steps of the solution to better understand, thanks.

**Please give the step by steps with details to completely see how the solution came about.

Create two MIPS programs to solve the following problems:

Problem 1. An employer needs software that will calculate a single week's wage for an employee. The week's wage is calculated as the regular wage plus the overtime wage. If an employee works for 40 hours or less, then all those hours are considered regular time. If the employee works more than 40 hours, the extra hours over 40 hours are considered as overtime. The regular wage is regular time multiplied by the hourly wage rate, and the overtime wage is overtime multiplied with twice the hourly wage rate. Your program must take two inputs, both of which can be assumed to be integers: total hours worked in the week, and hourly wage rate. The output must be the total wage for the week as shown below in the samples.

Two sample input / outputs are shown below with computer output italicized and user input in bold and underline -

Enter hours worked in a week: 35 Enter hourly wage rate in dollars: 10 The total wage for the week is $350

Enter hours worked in a week: 50 Enter hourly wage rate in dollars: 20 The total wage for the week is $1200

Problem 2. Write a program for a company that loans trucks for moving heavy equipment. Every truck has a maximum weight carrying capacity. Your program must first ask the user to input this maximum weight. Next it should use a loop to input a sequence of weights of different equipment from the user. The loop should stop once the user inputs a negative number (a weight cannot be negative, so this is a sentinel value) or the sum total of the sequence of equipment weights exceeds the maximum weight capacity of the truck. The final output must be different for these two cases as shown below in the samples.

Two sample input / outputs are shown below with computer output italicized and user input in bold and underline -

Enter maximum weight carrying capacity in pounds: 5000 Enter the weight of an equipment in pounds: 1500 Enter the weight of an equipment in pounds: 1200 Enter the weight of an equipment in pounds: 1000 Enter the weight of an equipment in pounds: 1200 Enter the weight of an equipment in pounds: -1 The total weight of 4 items is 4900 lbs and this is within the maximum capacity of 5000 lbs, so the program has accepted all inputs.

Enter maximum weight carrying capacity in pounds: 6500 Enter the weight of an equipment in pounds: 2200 Enter the weight of an equipment in pounds: 1800 Enter the weight of an equipment in pounds: 4500 The total weight of 3 items you have entered so far is 8500 lbs and this exceeds the maximum capacity of 6500 lbs, so the program will not accept these inputs.

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!