need in matlab code please The electricity accounts of residents in a very small rural community are calculated as follows: If 500 or fewer units
The electricity accounts of residents in a very small rural community are calculated as follows: If 500 or fewer units are used, the cost is 2 cents per unit. If more than 500, but not more than 1000, units are used, the cost is $10 for the first 500 units and 5 cents for every unit in excess of 500. 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. A basic service fee of $5 is charged no matter how much electricity is used. Five residents use the following amounts (units) of electricity in a certain month: 200, 500, 700, 1000, and 1500. Write a program that uses logical vectors to calculate how much they must pay. Display the results in two columns: one for the electricity used in each case and one for the amount they should pay. Script name should be called electricity1.m
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started