Starting from:

$30

CSE230-Assignment 4 Solved

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.\n". 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 a month of June, July, August, or September, then the bill amount is computed by: bill amount= (KWH for the Month-250)/18 + 25;

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,

Use an integer between 1 and 12 (1 for January, etc.):

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,

Use an integer between 1 and 12 (1 for January, etc.):

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,

Use an integer between 1 and 12 (1 for January, etc.):

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,

Use an integer between 1 and 12 (1 for January, etc.):

4

No bill to pay this month.

More products