Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using matlab write a code : You are working as a site engineer in NEPCO. Your colleague asked you to prepare a report related to
using matlab write a code : You are working as a site engineer in NEPCO. Your colleague asked you to prepare a report related to the electricity bills in a small neighbourhood in Amman. The electricity bills of residents are calculated as follows:
Taski You are working as a site engineer in NEPCO. Your colleague asked you to prepare a report related to the electricity bills in a small neighbourhood in Amman. The electricity bills of residents are calculated as follows: If 500 units or fewer are used the cost is 0.02 JOD per unit. If more than 500 but not more than 1000 units are used, the cost is 0.02 JOD per unit for the first 500 units and 0.05 JOD for every unit in excess of 500. If more than 1000 units are used the cost is 0.035 JOD per unit for the first 1000 units and 0.07 JOD for every unit in excess of 1000. A basic service fee of 5 JOD is charged, no matter how much electricity is used. A. Draw the flow chart for a system that calculates and displays the cost for electric bill of a resident with known consumption units. B. Following are the consumptions (units) for a number of residents: 200, 450, 501, 1010, 85, 700. Write a program that enters the previous consumptions into a vector then: I. Use a "for" loop to calculate and display the total cost for each resident II. Use a "while" loop to calculate and display the total cost for each residentStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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