Results 1 to 5 of 5
  1. #1
    shugi99's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    Philippines
    Posts
    20
    Reputation
    10
    Thanks
    0

    Help me with 2 basic problems.

    First problem.
    Determining the if the year is a leap year or not. Whenever I try to put a year (leap year and non leap years), they all appear to be leap year. lol
    We can say a year is a leap year when it is not a multiple of 100 and is divisible by four, and when a year is a multiple of 100 and is divisble by 400.
    eg.
    4 = leap year
    6 = not leap year
    1900 = not leap year
    1600 = leap year

    Second problem.
    Determining the quadrant where the x and y variable lies. Example if x = 1 and y = 1, then a message box will appear telling its on Quadrant 1.
    We can say a its on Q1 when x and y are >0, Q2 when x is >0 and y <0, Q3 when x and y are >0 and Q4 when x >0 and y <0.

    Really need help. Can you please reply with the codes?

    Thanks

  2. #2
    willrulz188's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Ohio?
    Posts
    1,786
    Reputation
    35
    Thanks
    231
    My Mood
    Amazed
    Code:
    If Date.IsLeapYear(Now.Year) Then
                MsgBox("true")
            Else
                MsgBox("false")
            End If
    Alt:
    Code:
    Public Function blnLeapYear( _
    intYear As Integer) As Boolean
    blnLeapYear = False
    If intYear Mod 4 = 0 Then
    blnLeapYear = True
    If intYear Mod 100 = 0 Then
    If (intYear Mod 400) _
    Then blnLeapYear = False
    End If
    End If
    End Function
    
    'action
    if blnLeapYear(Now.year) = true
     msgbox("It is leap year")
    else
    msgbox("It's not leap year")
    end if
    _____________

    Code:
    If x >= 0 Then
                If y >= 0 Then
                    msgbox("I -Quadrant")
                Else
                    msgbox("IV-Quadrant")
                End If
        else
                    If y >= 0 Then
                    msgbox("II- Quadrant")
                    Else
                    msgbox("III-Quadrant")
                End If
            End If
    @shugi99 Bored so here you go
    Question ALL statements! ?
    You're in denial that you're in denial. ?
    [img]https://i360.photobucke*****m/albums/oo45/blood188/Untitled-3.jpg?t=1284590977[/img]

  3. #3
    shugi99's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    Philippines
    Posts
    20
    Reputation
    10
    Thanks
    0
    I still can't get the first problem. Stupid me. And on the second one, whenever I put different variables on x and y, message box always say the point lies on Quadrant I. ><

  4. #4
    willrulz188's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Ohio?
    Posts
    1,786
    Reputation
    35
    Thanks
    231
    My Mood
    Amazed
    Quote Originally Posted by shugi99 View Post
    I still can't get the first problem. Stupid me. And on the second one, whenever I put different variables on x and y, message box always say the point lies on Quadrant I. ><
    I've test both and they work
    first one I gave you two optional ways of doing it

    second one if y equals or is greater than 0 it will be a I-Quadrant
    if y = -5 | x = 5 (example) it will be a IV-Quadrant

    make sure your not just doing all positives
    Question ALL statements! ?
    You're in denial that you're in denial. ?
    [img]https://i360.photobucke*****m/albums/oo45/blood188/Untitled-3.jpg?t=1284590977[/img]

  5. #5
    shugi99's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    Philippines
    Posts
    20
    Reputation
    10
    Thanks
    0
    I tried using negatives. I just copied and pasted your codes and we tend to get different results. Is my visual basic in fault?

Similar Threads

  1. Can anyone help me with my problem?
    By alicianed in forum Vindictus Help
    Replies: 4
    Last Post: 04-29-2011, 11:38 PM
  2. Help me With That Problem
    By xSoulReapeRx in forum CrossFire Help
    Replies: 10
    Last Post: 04-20-2011, 03:58 PM
  3. help please with this problem
    By yomo710 in forum Combat Arms Help
    Replies: 3
    Last Post: 08-04-2010, 04:08 PM
  4. please help me with crosshair problem
    By Luyolo in forum Call of Duty Modern Warfare 2 Help
    Replies: 2
    Last Post: 07-14-2010, 05:05 AM
  5. [Help] Help me with this problem warrcok
    By destruidor in forum WarRock Discussions
    Replies: 2
    Last Post: 09-23-2009, 04:55 PM