Write an interface named electricity Bill that will calculate and print bills for the city power...
Fantastic news! We've Found the answer you've been seeking!
Question:
![Write an interface named electricity Bill that will calculate and print bills for the city power company. The](https://dsd5zvtm8ll6.cloudfront.net/questions/2023/12/6572c41758900_1702110090512.jpg)
Transcribed Image Text:
Write an interface named electricity Bill that will calculate and print bills for the city power company. The rates vary depending on whether the use is residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. The rates are computed as follows: R: RM6.00 plus RM0.052 per kwh used C: RM60.00 for the first 1000 kwh and RM0.045 for each additional kwh wwwwwww I: Rate varies depending on time of usage: Peak hours: RM76.00 for first 1000 kwh and RM0.065 for each additional kwh Off peak hours: RM40.00 for first 1000 kwh and RM0.028 for each additional kwh. Note that if the code is I, an additional input to determine whether it is peak or off peak is required. The interface should display the amount due from the user, rounded to 2 decimal points. Example usage of the interface should be looks like this (example shown in PHP): electricity Bill bill = new electricity Bill(); bill->code('R') bill->amountOfElectricity (50) bill->amountDue(); // output RM 8.60 bill->code('C') bill->amountOfElectricity (800) bill->amountDue(); // output RM 60.00 Your task is to implement an electricity billing system that fulfills the requirements described above. Write an interface named electricity Bill that will calculate and print bills for the city power company. The rates vary depending on whether the use is residential, commercial, or industrial. A code of R means residential use, a code of C means commercial use, and a code of I means industrial use. The rates are computed as follows: R: RM6.00 plus RM0.052 per kwh used C: RM60.00 for the first 1000 kwh and RM0.045 for each additional kwh wwwwwww I: Rate varies depending on time of usage: Peak hours: RM76.00 for first 1000 kwh and RM0.065 for each additional kwh Off peak hours: RM40.00 for first 1000 kwh and RM0.028 for each additional kwh. Note that if the code is I, an additional input to determine whether it is peak or off peak is required. The interface should display the amount due from the user, rounded to 2 decimal points. Example usage of the interface should be looks like this (example shown in PHP): electricity Bill bill = new electricity Bill(); bill->code('R') bill->amountOfElectricity (50) bill->amountDue(); // output RM 8.60 bill->code('C') bill->amountOfElectricity (800) bill->amountDue(); // output RM 60.00 Your task is to implement an electricity billing system that fulfills the requirements described above.
Expert Answer:
Answer rating: 100% (QA)
Creating an electricity billing system involves setting up an interface and implementing its functionality Below is an example of how this can be done ... View the full answer
Related Book For
Legal Environment of Business A Managerial Approach Theory to Practice
ISBN: 978-1259686207
3rd edition
Authors: Sean Melvin, Enrique Guerra Pujol
Posted Date:
Students also viewed these programming questions
-
Our hero, Phreddie Physics, visits Vancouver so he can drop a small iron bolt from Lion's Gate bridge to the water 65 m below. a) With what speed will the bolt hit the water? b) What should be the...
-
What you know about benefits plans and options, as well as costs and factors for designing a benefits plan, draft a basic plan for a start-up company of fewer than 100 employees in your local...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
12 7. In a group of 7 employees and 5 non-employees, four people must be chosen to ride together in a company vehicle with four seats. How many seating arrangements are possible if at least two...
-
Makers Corp. had additions to retained earnings for the year just ended of $395,000. The firm paid out $195,000 in cash dividends, and it has ending total equity of $5.3 million. If the company...
-
KidCo. Inc. is a manufacturer of furnishings for children. The company uses a job-order costing system. KidCo's work-in-process inventory on November 30 consisted of the following jobs. The company's...
-
The following balance sheet is for Ditbit Co. Ltd as at June 2006: During the following month, just completed, the company had the following transactions: a Sold stock for cash $30,000 (cost...
-
Why is an accurate and complete requirements definition especially critical when using the SDLC waterfall approach?
-
Diamond Brands manufactures rice, wheat, and oat cereals. Sanders Company has approached Diamond Brands with a proposal to sell the company the rice cereals at a price of $22,000 for 20,000 pounds....
-
Suppose that the point spread for a particular sporting event is 10 points and that with this spread you are convinced you would have a 0.60 probability of winning a bet on your team. However, the...
-
Global Filter Corp. established a $220.00 petty cash fund on April 15, 2023. On April 30, 2023, the fund was reimbursed and increased by $25.00 when it had $50.00 remaining in cash and receipts for...
-
1 . Janey purchased machinery on April 8 of the current year. The relevant costs for the year are as follows: machinery for $ 1 2 , 0 0 0 , $ 8 0 0 shipping, $ 1 7 5 for delivery insurance, $ 6 2 5...
-
suppose an individual now decides to give one-eighth of a percent (0.125%) of her new net worth to charity. how many dollrs are given to charity, being that her net work is 7.52x10^10 dollars.
-
The Roman numerals in the reaction given represent the coefficients in the balanced chemical equation. What are the values of the coefficients?
-
Sea salt is formed by natural evaporation of ocean water andcontains 98% sodium chloride. The remaining 2% are natural mineralssuch as iron and sulfur. Consider a 48.4?g sample of sea salt. Whatis...
-
Sodium hydroxide reacts with sulfuric acid according to the following balanced chemical equation: 2 NaOH + H2SO4 2 H2O + Na2SO4 How many mL of 0.400 M H2SO4 solution are required to completely...
-
What 3 things about Cattell's work specifically influenced American psychology the most? (Select 3 that apply) measurement of individual differences mental testing operant conditioning promotion of...
-
On April 29, 2015, Auk Corporation acquires 100% of the outstanding stock of Amazon Corporation (E & P of $750,000) for $1.2 million. Amazon has assets with a fair market value of $1.4 million (basis...
-
1. Why was this case considered a misappropriation theory case rather than a traditional insider-trading case? 2. If McGee had disclosed his trading to Maguire, would that have relieved him from...
-
1. Why did the Supreme Court apply the strict scrutiny standard to the California statute? 2. If the expert testimony had been conclusive and scientifically proven, would the Courts decision be...
-
1. After one week on the worksite, Ishmael finds that he is devoting more time to Export than he initially believed was necessary, so he attempts to convince Export to pay him $6,000 per month for...
-
What role does growth-need strength play in the job characteristics model?
-
Explain the difference between halo errors and recency errors in performance appraisal.
-
When is a team effective?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App