1. Engineering
  2. Computer Science
  3. to approve a single suggestion mouse over it and click...

Question: to approve a single suggestion mouse over it and click...

Question details

Write a MIPS assembly language program that reads in a sales type (1 or 2) and an amount of some sales If 0 or a negative integer is entered, then the program should print out No commission for the sales.n, and exit. Otherwise, if a sale type is 1, and the amount is less than 10000 then the commission number will be 2, otherwise, it wil1 be 4 If a sale type is not 1 (ie., 2), and the amount is less than 10000 then the commission number will be 3, otherwise, it will be 5 After getting a commission number, it should compute the total commission that is computed by totalCommission = (totalSales/1000)commissionNum then it should print out the total commission, along with its sales amount Name your source code file Assignment4.s The following shows how it looks like in a C program int salesType int comumissionWm int totalSales int totalCommission printf(What is your sales type (1 or 2)?n); f/read an integer from a user input and store it in salesType sca㎡(%d, &salesType) printf(How much was the sales?n) /fread an integer from a user input and store it in totalSales scarf(%d, &tota!Sales) if (totalSales 0) printf (No commission for the sales. n) else if (salesType-1) if totalSales 10000) commissionNum2 commissionNum- 4; else if totalSales < 10000) commissionNum3 else commissionNum-5 //compute its total commission totalCommission (totalSales/1000) *commissionNum //print out the total commission along with its sales printf(Your total comunission is %d for the sales of %d \n, totalCommission, totalSales) l /fend of elseHere is a sample output (user input is in bold): What is your sales type (1 or 2)? How much was the sales? 12000 Your total commission is 48 for the sales of 12000 Here is another sample output (user input is in bold) What is your sales type (1 or 2)? How much was the sales? 1400 Your total commission is 3 for the sales of 1400 Here is another sample output (user input is in bold): What is your sales type (1 or 2)? How much was the sales? No commission for the sales.

To approve a single suggestion, mouse over it and click "✔"
Click the bubble to approve all of its suggestions.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution