Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 323 | Replies: 4
![]() |
can anyone help me
i wanna calculate the total of electrical bill
this is my situation...
Rate 1 = 0.218 for first 0 – 200 KWh usage
Rate 2 = 0.289 for 201-1000 KWh usage
Electrical usage (KWh) = Latest Meter Reading - Previous Meter Reading
If electrical usage between 0 – 200 KWh,
Total payment = (Electrical usage x Rate 1) + arrears
If electrical usage between 201 - 1000 KWh,
Total payment = (Electrical usage x Rate 2) + arrears
can anyone help me on VB6 coding....
i wanna calculate the total of electrical bill
this is my situation...
Rate 1 = 0.218 for first 0 – 200 KWh usage
Rate 2 = 0.289 for 201-1000 KWh usage
Electrical usage (KWh) = Latest Meter Reading - Previous Meter Reading
If electrical usage between 0 – 200 KWh,
Total payment = (Electrical usage x Rate 1) + arrears
If electrical usage between 201 - 1000 KWh,
Total payment = (Electrical usage x Rate 2) + arrears
can anyone help me on VB6 coding....
•
•
Join Date: Feb 2008
Location: Cebu, Philippines
Posts: 122
Reputation:
Rep Power: 1
Solved Threads: 19
•
•
Join Date: Feb 2008
Location: Cebu, Philippines
Posts: 122
Reputation:
Rep Power: 1
Solved Threads: 19
here it is...
vb Syntax (Toggle Plain Text)
Dim Rate As Double Dim ElectricalUsage As Double Dim TotalPayment As Double 'get Electrical Usage ElectricalUsage = Val(txtLatestMeterReading.Text) - Val(txtPreviousMeterReading.Text) If ElectricalUsage <= 200 Then Rate = 0.218 ElseIf ElectricalUsage > 200 And ElectricalUsage <= 1000 Then Rate = 0.289 Else 'Electrical Usage is greater than 1000 End If 'calculate (what's arrears anyway?) TotalPayment = (ElectricalUsage * Rate) + arrears MsgBox TotalPayment
Proud to be Philippine made...
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





. thanx for helping me
Linear Mode