The electricity accounts of residents in a very small town are calculated as follows: a) If 500 units or less are used the cost is 2 cents per unit; b) If more than 500, but not more than 1000 units...


Matlab


The electricity accounts of residents in a very small town are calculated as follows:<br>a) If 500 units or less are used the cost is 2 cents per unit;<br>b) If more than 500, but not more than 1000 units are used, the cost is $10 for the<br>first 500 units, and then 5 cents for every unit in excess of 500;<br>c) If more than 1000 units are used, the cost is $35 for the first 1000 units, plus 10<br>cents for every unit in excess of 1000;<br>d) In addition, a basic service fee of $5 is charged, no matter how much electricity is<br>used.<br>The five residents use the following amounts (units) of electricity in a certain month: 200,<br>500, 700, 1000, 1500. Write a program which uses logical vectors to calculate how much<br>they must pay.<br>

Extracted text: The electricity accounts of residents in a very small town are calculated as follows: a) If 500 units or less are used the cost is 2 cents per unit; b) If more than 500, but not more than 1000 units are used, the cost is $10 for the first 500 units, and then 5 cents for every unit in excess of 500; c) If more than 1000 units are used, the cost is $35 for the first 1000 units, plus 10 cents for every unit in excess of 1000; d) In addition, a basic service fee of $5 is charged, no matter how much electricity is used. The five residents use the following amounts (units) of electricity in a certain month: 200, 500, 700, 1000, 1500. Write a program which uses logical vectors to calculate how much they must pay.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here