Sei sulla pagina 1di 4

JABATAN PERKHIDMATAN ELEKTRIK

NameTextBox
Calculate Bill
CalculateBillButton
NameLabel
bje
Clear Screen ClearScreenButton
Customer
Name:
ExitButton
Account Exit
No.:
AccountLabel CurrentUsageTextBox TotalBillLabel
Total Bill:
AccountTextBox
TotalBillLabel
Current Usage Amount:

CurrentUsageLabel

Previous Usage Amount:

PreviousUsageLabel

PreviousUsageTextBox

Task Object Event


Get the following information from the user:
Customer Name NameTextBox None
Account No. AccountTextBox None
Current Usage Amount CurrentUsageTextBox None
Previous Usage Amount PreviousUsageTextBox None

Calculate the total bill CalculateBillButton Click


Display the following:
Customer Name NameTextBox None
Account No. AccountTextBox None
Current Usage Amount CurrentUsageTextBox None
Previous Usage Amount PreviousUsageTextBox None
Total bill CalculateBillButton, TotalBillLabel Click, None

End the application ExitButton Click

Clear the screen for the next customer ClearScreenButton Click

1. Get inputs (Account Number, Name, Current Meter Reading, Previous Meter Reading)
2. Calculate Usage
a. Usage is equal to Current Reading minus Previous Reading
3. Calculate Bill Amount
a. IF Usage is greater than or equal to 100 THEN
i. Bill Amount = (10*0.25) + (50*0.15) + (40*0.1) + ((Usage-100)*0.05)
b. IF Usage is greater than or equal to 60 THEN
i. Bill Amount = (10*0.25) + (50*0.15) + ((Usage-60)*0.1)
c. IF Usage is greater than or equal to 10 THEN
i. Bill Amount = (10*0.25) + ((Usage-10)*0.15)
d. IF Usage is greater than 8 THEN
i. Bill Amount = Usage*0.25
e. Otherwise
i. Bill Amount = $2
4. Display Bill Amount
5. End

Potrebbero piacerti anche