You are required to write an application called Customer Billing System. This system will calculate water usage charges for a month that has been imposed by Syarikat Air Melaka Berhad. This system will categorise users into residential users and industrial users and calculate the charges based on data entered by the user. Data needed are the type of customer (Residential or Industrial), past meter reading and current meter reading.
Given the charge rate as follows:
For Residential:
0 – 15 m3 : RM 0.82 every m3
15.1 – 40 m3 : RM 0.65 every m3
40.1 m3 and above : RM 0.42 every m3
Minimum charge is RM 5.00
For Industrial:
0 m3 and above : RM 1.47 every m3
Minimum charge is RM15.00
Instruction:
The above application must be able to hold information for up to 5 customers. Use an array and repetition structure to store information about users such as type of customer, past meter reading, current meter reading and charges. Write a structured Java program to develop the above system by following the steps below:
a) Prompt the user to input the type of customer, past meter reading and current meter reading. Next, get the difference between current meter reading and past meter reading.
b) Separate them as either R/r for Residential or I/i for Industrial. You can use any one of the two selection structures.
c) Calculate the charges based on rates given above. If there is no water consumption, the minimum charge will be imposed. You can use any one of the two selection structures.
d) Display information about the type of customer, past meter reading, current meter reading and charges for each customer. Print the information in table format.
kannan_pahang
0
Newbie Poster
Recommended Answers
Jump to PostIf you are getting errors, please copy and paste the full text here.
Jump to PostDefine a class to hold the information for a Customer.
Prompt the user for all the Customer's data.
Create a Customer object with the new class and the data the user entered.
Save that object in the array:// Something like this: Customer[] customers = new Customer[5]; …
All 6 Replies
kannan_pahang
0
Newbie Poster
kannan_pahang
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
kannan_pahang
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
Wazzza95
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.