Starting from:

$34.99

CSE230 Assignment 4 Solution




Important: This is an individual assignment. Please do not collaborate.
Make sure to follow the academic integrity policies.
It must be submitted on-line (course website).
Go to "GradeScope" tab on Canvas -> CSE/EEE230 -> Assignment4, and upload your program file.
No late assignment will be accepted


Minimal Submitted Files

You are required to turn in the following source file:
assignment4.s
Objectives:

-write assembly language programs to:
-perform decision making using branch instructions.
-use syscall operations to display integers and strings on the console window
-use syscall operations to read integers from the keyboard.

Assignment Description:
Write a MIPS assembly language program that reads a customer's current and previous meter readings of electricity and a month to compute its electricity bill.
If a customer spent 0 or less (technically this should not happen, though) KWH (kilowatt-hours) that is computed by current meter reading - previous meter reading, then the program should print out "No bill to pay this month. ". If a customer spent less than or equals to 250 KWH in a month, then the payment should be 25 dollars.
If a customer spent more than 250 KWH in any other month, then the payment is compute by: bill amount= (KWH for the Month-250)/20 + 25;
Then if the payment is greater than 0, it should print out the payment amount, along with its used KWH.


Name your source code file Assignment4.s.

The following shows how it looks like in a C program:






Here is a sample output (user input is in bold):

Please enter the new electricity meter reading:
15430
Please enter the old electricity meter reading:
15105
Please enter a month to compute their electricity bill,
5
Your total bill amount for this month: 28 dollar(s) for 325 KWH
-----------------------------------------------

Here is another sample output (user input is in bold):

Please enter the new electricity meter reading:
23705
Please enter the old electricity meter reading:
22190
Please enter a month to compute their electricity bill,
8
Your total bill amount for this month: 95 dollar(s) for 1515 KWH
-----------------------------------------------
Here is another sample output (user input is in bold):
-----------------------------------------------
Please enter the new electricity meter reading:
34525
Please enter the old electricity meter reading:
34291
Please enter a month to compute their electricity bill,
6
Your total bill amount for this month: 25 dollar(s) for 234 KWH
-----------------------------------------------
Here is another sample output (user input is in bold): -----------------------------------------------
Please enter the new electricity meter reading:
53205
Please enter the old electricity meter reading:
53205
Please enter a month to compute their electricity bill,
4
No bill to pay this month.



What to turn in:

Go to "GradeScope" tab on Canvas -> CSE/EEE230 -> Assignment4, and upload your program file.

Grading Criteria:
____/ 5 Documentation (header with your name, your information, and program description and comments within your code)
____/ 1 Indentation and spacing (easy to read)
____/ 6 Required functions and functionalities implemented
____/ 8 Produces correct results?
Total points: 20


ASU disclaimer (http://www.asu.edu/asuweb/disclaimer/)
Copying any content of this page will be a violation of the copy right.

More products