RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 323 | Replies: 4
Reply
Join Date: Apr 2008
Posts: 5
Reputation: afan_ell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
afan_ell's Avatar
afan_ell afan_ell is offline Offline
Newbie Poster

calculation calculation hhmmmmm.....

  #1  
Apr 1st, 2008
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....
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Location: Cebu, Philippines
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: calculation calculation hhmmmmm.....

  #2  
Apr 1st, 2008
You got it already. The problem is you have to Code it. Lol. Let me look at this one.
Proud to be Philippine made...
Reply With Quote  
Join Date: Feb 2008
Location: Cebu, Philippines
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: calculation calculation hhmmmmm.....

  #3  
Apr 1st, 2008
here it is...

  1. Dim Rate As Double
  2. Dim ElectricalUsage As Double
  3. Dim TotalPayment As Double
  4. 'get Electrical Usage
  5. ElectricalUsage = Val(txtLatestMeterReading.Text) - Val(txtPreviousMeterReading.Text)
  6.  
  7. If ElectricalUsage <= 200 Then
  8. Rate = 0.218
  9. ElseIf ElectricalUsage > 200 And ElectricalUsage <= 1000 Then
  10. Rate = 0.289
  11. Else
  12. 'Electrical Usage is greater than 1000
  13. End If
  14.  
  15. 'calculate (what's arrears anyway?)
  16. TotalPayment = (ElectricalUsage * Rate) + arrears
  17. MsgBox TotalPayment
Proud to be Philippine made...
Reply With Quote  
Join Date: Apr 2008
Posts: 5
Reputation: afan_ell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
afan_ell's Avatar
afan_ell afan_ell is offline Offline
Newbie Poster

Re: calculation calculation hhmmmmm.....

  #4  
Apr 2nd, 2008
thanks cometburn.... thanx for helping me
Reply With Quote  
Join Date: Feb 2008
Location: Cebu, Philippines
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: calculation calculation hhmmmmm.....

  #5  
Apr 2nd, 2008
Glad to help and please mark the thread closed
Proud to be Philippine made...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:26 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC