This Visual Basic code asks the user to input their hours worked and calculates their vacation time based on that number. It checks if the hours are less than 40, in which case no vacation is allowed, or if the hours are 40 or more, it divides the hours by 40 to get the number of weeks of vacation to display.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
1K views1 page
Vacation Calculation in VB Code
This Visual Basic code asks the user to input their hours worked and calculates their vacation time based on that number. It checks if the hours are less than 40, in which case no vacation is allowed, or if the hours are 40 or more, it divides the hours by 40 to get the number of weeks of vacation to display.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Module Module1
Sub main() Dim h, w As Integer [Link]("Hours of Working: ") h = CInt([Link]()) If h < 40 Then [Link]("No vacation is allowed") ElseIf h >= 40 Then w = h / 40 [Link]("Vacation will be " + [Link]()) End If [Link]() End Sub End Module