nd customer code (either R for residential, C for commercial) for each row. For residential customers: If the KWH is less than or equal to 100 multiply it by 1.50; if the KWH is more than 100 but less than or equal to 200 multiply it by 2.00; for more than 200 KWH multiply it by 2.50. For commercial customers: if the KWH is less than or equal to 100 multiply it by 3.00; If the KWH is more than 100 but less than or equal to 200, multiply it by 4.00; for more than 200 KWH multiply it by 5.00. Display in a window the following information: meter number, customer code, previous meter reading, present meter reading, the kilowatt-hour used or KWH, and the amount to be paid. If no match is found in the 2d-ArrayList, add a new element the meter number, and the meter reading to the 2d-ArrayList. Note: You must put i

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a Java program that would resemble a power utility billing system. There will be an input window that would enter or input the meter number (5 numeric digits) and the present meter reading in kilowatt-hours, the maximum would be 9999 kilowatts. A search from a 2d-ArrayList would be made in order to get the previous meter reading of a particular meter number. The 2d- ArrayList consists of meter number (5 numeric digits) and the previous meter reading in kilowatt-hours (4 numeric digits with 9999 as a maximum value). Provide at least 5 sample data or 5 rows with meter numbers and previous meter reading for each row for the 2d-ArrayList. When an input of meter number and present meter reading is made, search the 2d-ArrayList for the equivalent meter number. If a match is found, get the kilowatt-hour used (KWH) by subtracting the previous meter reading from the present meter reading. Note that if the present meter reading is less than the previous meter reading, add 10000 first to the present meter reading before subtracting the previous meter reading. To compute the amount to be paid, check first if the customer is residential or commercial. This checking is to be done through another 2d-ArrayList which contains the meter number and the customer code. Provide also at least 5 test data or 5 rows with meter numbers (must be the same as the meter numbers of the previous 2d-ArrayList) and customer code (either R for residential, C for commercial) for each row. For residential customers: If the KWH is less than or equal to 100 multiply it by 1.50; if the KWH is more than 100 but less than or equal to 200 multiply it by 2.00; for more than 200 KWH multiply it by 2.50. For commercial customers: if the KWH is less than or equal to 100 multiply it by 3.00; If the KWH is more than 100 but less than or equal to 200, multiply it by 4.00; for more than 200 KWH multiply it by 5.00. Display in a window the following information: meter number, customer code, previous meter reading, present meter reading, the kilowatt-hour used or KWH, and the amount to be paid. If no match is found in the 2d-ArrayList, add a new element the meter number, and the meter reading to the 2d-ArrayList. Note: You must put initial values in the 2d-array lists required in this program, at least 10 test data for each 2d-ArrayList. Before exiting the program replace the previous meter reading in the 2d-ArrayList with the present meter reading in preparation for the next billing period. Show also the updated 2d-ArrayList by displaying the elements. (USE OOP CONCEPT JFRAME)

 

 

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education