The Universe Energy electric company calculates electricity charges based upon usage. The normal rate is RM0.50 per Kilowatt Hour (KWH) for the first 1000 KWH. If the number of KWH is above 1000, then the balance from normal rate is charged for RM0.40 per KWH. Write a CalculateBill class that consists of only one method named calculate() to calculate and return the electricity charge.
Then, write one other class named DemoCalculateBill to demonstrate the CalculateBill class. (Prompt the user to input the number of Kilowatt Hours used and then display the total of the electric bill). The example of input/output is shown below:
Enter the number of Kilowatt Hours used: 600
Electric bill is: RM300.00
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-5038.pdf
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment