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:
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
-
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...
-
A cataract-impaired lens in an eye may be surgically removed and replaced by a manufactured lens. The focal length required for the new lens is determined by the lens-to-retina distance, which is...
-
Leslie works for Blanck Corporation. His annual salary is $57,285.50. a. What is Leslie's annual Social Security deduction? b. What is Leslie's annual Medicare deduction? c. Leslie is paid every...
-
Jerome M. Eisenberg is an antiquities dealer and a self-proclaimed expert in classical antiquities with a doctorate in Roman, Egyptian, and Near Eastern art. Maurice E. Hall Jr. is an art dealer who...
-
Ling, an audit manager, is planning the audit of Modern Technologies, Inc., (MT, Inc.) a manufacturer of electronic components. This is the first year that Lings audit firm has performed the audit...
-
Engineers at electronic company use special wire to manufacture fuzzy logic circuit boards. The wire comes in 1,260 foot rolls that cost $2,700 each. Each board requires 4 1/5 feet of wire. How many...
-
Assume you have an graph as following. Use Dijkstra Algortihm to calculate shortest path from vertex A to every vertex (manuel calculation). Write the Dijkstra code to generate this graph and find...
-
You can use this class to display dialog boxes. a. JOptionPan b. BufferedReader c. InputStreamReader d. DialogBox
-
Generally, new shell entities inserted into existing group structures as part of the corporate reorganization process will meet the definition of business under IFRS 3.
-
If the number of blood donors is n = 20, find the probability that the number with Group O blood is x = 16. Assume that when blood donors are randomly selected, 45% of them have blood that is Group O...
-
If the number of blood donors is n = 16, find the probability that the number with Group O blood is x = 6. Assume that when blood donors are randomly selected, 45% of them have blood that is Group O...
-
If the number of blood donors is n = 8, find the probability that the number with Group O blood is x = 3. Assume that when blood donors are randomly selected, 45% of them have blood that is Group O...
-
A Marist poll survey showed that 47% of respondents chose whatever as the most annoying phrase used in conversation. What is the probability of randomly selecting someone choosing something different...
-
Note: 1. Assume any suitable values for missing data. 2. For students with Odd roll number(1, 3, 5 ..) the direction of survey is clockwise. - dination at 4. WCB of Line AB = X * 5 (X is Roll No.) Q....
-
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...
-
A runner is moving at a constant speed on level ground. Chemical energy in the runner's body is being transformed into other forms of energy. Most of the chemical energy is transformed into A....
-
According to Table 11.4 , cycling at \(15 \mathrm{~km} / \mathrm{h}\) requires less metabolic energy than running at \(15 \mathrm{~km} / \mathrm{h}\). Suggest reasons why this is the case. TABLE 11.4...
-
You have driven your car for a while and now turn off the engine. Your car's radiator is at a higher temperature than the air around it. Considering the radiator as the system, as the radiator cools...
Study smarter with the SolutionInn App