🔒 Closed Pa tulong sa logic.

Status
Not open for further replies.

Netflix

Forum Veteran
So this is library system , na binibuild ko for capstone project namin using VB2010, I'm a little bit confused kong paano kunin yung penalty implementation.

I have 2 DatePicker one is for Date Borrowed second is for Date Due.
Penalty is 1 per day.

Paano ko po ba i sisetup code nito.
Assume ko lang po ganito.
Dim Penalty As Integer
If DateDue <= CurrentDate
Penalty+=1
End If

Paano po ba ang tamang logic /code nito, para makuha yung days na due date na yung book.

Ps. Tia
 
Penalty = (Current Date.subtract (Datedue))

If Penalty > 0
Print "Total penalty is:"&Penalty
*Blah blah. I forgot the codes to get the specific day in a date but you get the logic. Hehe

Else
Print "No Recorded Penalty."
 
Subtract mo lang yung days.
Yun na value ng Penalty.
--
DateDue = 04/18/2018

Penalty = CurrentDate - DateDue
Penalty = 04/18/2018 - 04/18/2018
Penalty = 0

--

DateDue = 04/15/2018

Penalty = CurrentDate - DateDue
Penalty = 04/18/2018 - 04/15/2018
Penalty = 3

Note: Not sure about VBCode.
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 2K
    Views
  • 4
    Participants
Last reply from:
vhin le

Online now

Members online
408
Guests online
891
Total visitors
1,299

Forum statistics

Threads
2,275,095
Posts
28,960,628
Members
1,233,594
Latest member
baam
Back
Top