🔒 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

Trending Topics

Online now

Members online
1,283
Guests online
1,961
Total visitors
3,244

Forum statistics

Threads
2,286,250
Posts
29,036,609
Members
1,217,847
Latest member
19drk
Back
Top