Problem: Assume that you have been hired at Oman Investment and Finance Co. SAOG (OIFC) to write a java program that prints a summary of customers' bills for water and electricity. Each bill has type, account number, consumption amount (kilowatt/gallon) and the month of the bill. Each bill charges an amount of 16.78 OMR as supply service charges. Electricity bill is either industrial or residential. The electricity total energy charge is computed based on the type of the usage. For industrial each kilowatt consumed costs 12 Baisa while for residential it costs 10 Baisa per kilowatt consumed. The total amount is the sum of the energy charges plus the bill charges. Water bill applies different rates based on the water consumption where the first 5000 gallons cost 2 Baisa per gallon and any gallon more than 5000 costs 2.5 Baisa. Water bill also includes sewage charges which is one third the water charges. The total amount is the sum of the water charges, sewage charges and the bill charges. Bill Water Electricity According to the description above, you are asked to develop an OOP solution that includes the following: [6.25 points] Class Bill which has: Variables to store bill information as described above. A constructor with parameters to initialize bill information. Accesor method for the consumption amount. getCharges() method that returns the supply service charges. Override toString() method to return a bill information line as shown in the sample output. (Check Figure 2 below) [6.75 points] Class Water which has: A constructor with parameters to initialize a water bill information. Override the getCharges method to compute the total amount according to the description above. [5.75 points] Class Electricity which has: Variables to store whether the usage is industrial or residential. A constructor with parameters to initialize an electricity bill information. Override the getCharges method to compute the total amount according to the description above. Write the code for the tester class yourNameOIFC which has: o [5.75 points] readBills method that accepts a scanner object and returns a list of bills. It reads each line from the input file and construct the corresponding bill type. [6 points] printBillsSummary method that accepts a list of bills and prints the summary including the total charges as shown in the sample output (check Figure 2 below). You should replace the string "Ahmed" with your first name. [6.5 points] main method that asks a user for input file name checks whether the file exist read from the input file objects of type Water or Electricity into an array list by calling readBills. The line for water objects starts with "W" while for electricity objects it starts with "E". Check Figure 1 for a sample input file, "bills.txt", which is also available on Moodle. calls printBillsSummary method to print the output shown in Figure 2 after reading the whole input file. Bonus (Optional) [1 point]: Print all water bills before the electricity bills as shown in Figure 3. o o
Problem: Assume that you have been hired at Oman Investment and Finance Co. SAOG (OIFC) to write a java program that prints a summary of customers' bills for water and electricity. Each bill has type, account number, consumption amount (kilowatt/gallon) and the month of the bill. Each bill charges an amount of 16.78 OMR as supply service charges. Electricity bill is either industrial or residential. The electricity total energy charge is computed based on the type of the usage. For industrial each kilowatt consumed costs 12 Baisa while for residential it costs 10 Baisa per kilowatt consumed. The total amount is the sum of the energy charges plus the bill charges. Water bill applies different rates based on the water consumption where the first 5000 gallons cost 2 Baisa per gallon and any gallon more than 5000 costs 2.5 Baisa. Water bill also includes sewage charges which is one third the water charges. The total amount is the sum of the water charges, sewage charges and the bill charges. Bill Water Electricity According to the description above, you are asked to develop an OOP solution that includes the following: [6.25 points] Class Bill which has: Variables to store bill information as described above. A constructor with parameters to initialize bill information. Accesor method for the consumption amount. getCharges() method that returns the supply service charges. Override toString() method to return a bill information line as shown in the sample output. (Check Figure 2 below) [6.75 points] Class Water which has: A constructor with parameters to initialize a water bill information. Override the getCharges method to compute the total amount according to the description above. [5.75 points] Class Electricity which has: Variables to store whether the usage is industrial or residential. A constructor with parameters to initialize an electricity bill information. Override the getCharges method to compute the total amount according to the description above. Write the code for the tester class yourNameOIFC which has: o [5.75 points] readBills method that accepts a scanner object and returns a list of bills. It reads each line from the input file and construct the corresponding bill type. [6 points] printBillsSummary method that accepts a list of bills and prints the summary including the total charges as shown in the sample output (check Figure 2 below). You should replace the string "Ahmed" with your first name. [6.5 points] main method that asks a user for input file name checks whether the file exist read from the input file objects of type Water or Electricity into an array list by calling readBills. The line for water objects starts with "W" while for electricity objects it starts with "E". Check Figure 1 for a sample input file, "bills.txt", which is also available on Moodle. calls printBillsSummary method to print the output shown in Figure 2 after reading the whole input file. Bonus (Optional) [1 point]: Print all water bills before the electricity bills as shown in Figure 3. o o
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
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education