Username:   Password:   
   
   Is it in your blood?
Index  FAQ  Search  Memberlist  Usergroups  Profile  Join! (free)
 Log in to check your private messages
Welcome
Guest
Current Time
Log in
   Username:
   Password:
   Log me on automatically each visit
  
Top Posters
Badie05 6237
Phatkav 3685
bashmo 2678
Zaraki Kenpachi 1597
Deat401 822
HungryHungryHippo 721
rasengan232 694
Latest Articles
How to Rickroll an Entire Country
Goodbye HCG?
Mamba Wireless Gaming Mouse
2009 Gaming Wishlist
Well I am back...
New Modern Warfare 2 Release
Internal PSP Camera Mod
We Will Return
Battlefield Returns with Two New Games
Uncharted 2 Mega Blog SNEAK PEAK


  Visual Basic Help
Jump to:    
  Post new topic   Reply to topic HardCore Gamer Networks Forum Index » Support & Suggestions     
Author Message
Badie05
Administrator
Administrator



Joined: 15 Oct 2006
Posts: 6237
Credits: 825.9


Location: Ottawa, Canada
PostPosted: Wed Mar 05, 2008 8:09 pm Reply with quote

I need help with my freaking code. It's a time conversion application. It's supposed to convert minutes to seconds and minutes to hour and seconds. The application uses Modulus Division and Integer Division.

Code:

Public Class Form1

    Private Sub radHour_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles radHour.Click
        Dim x As Decimal
        Dim q As Decimal
        Dim d As Decimal

        x = (Me.txtMinutes.Text)
        q = x / 25
        d = x - q * 25 / 10

        Me.lblTimeIs.Text = "The time in hour:minute format is"
        Me.lblTimeIs.Text = x / 60
        Me.lblTimeIs3.Text = x Mod 60

    End Sub

    Private Sub radSeconds_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles radSeconds.Click
        Dim x As Decimal
        x = (Me.txtMinutes.Text)

        Me.lblTimeIs2.Text = "The time in seconds format is"
        Me.lblTimeIs2.Text = x * 60
    End Sub

    Private Sub radHour_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radHour.TextChanged
        Me.lblTimeIs.Text = ""
        Me.lblTimeIs2.Text = ""
        Me.lblTimeIs3.Text = ""
    End Sub
End Class




_________________

PLAYING:
GTA IV (PC)
Halo 3 (X360)
COD4: MW (PC)
Fallout 3 (PC)
Prince of Persia (PC)
AIM Address Yahoo Messenger MSN Messenger ICQ Number
View user's profile Send private message Send e-mail Visit poster's website
Zaraki Kenpachi
Extreme User 2
Extreme User 2



Joined: 07 May 2007
Posts: 1597
Credits: 287.6



PostPosted: Thu Mar 06, 2008 3:02 am Reply with quote

did you ask DNG??since he alreay did excercises 7 and 9 while I'm doing them today and maybe Phatkav can help you since he learned about visual basic last semester.....

_________________
I'm obssessed now over something you'll never find out =P
MSN Messenger
View user's profile Send private message Send e-mail
Badie05
Administrator
Administrator



Joined: 15 Oct 2006
Posts: 6237
Credits: 825.9


Location: Ottawa, Canada
PostPosted: Thu Mar 06, 2008 9:54 am Reply with quote

I GOT IT Very Happy

Code:

Public Class Form1

    Private Sub btnCoins_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCoins.Click
        Dim change As Integer
        Dim Quaters As Integer
        Dim Dimes As Integer
        Dim Nickels As Integer
        Dim Pennies As Integer

        change = Val(Me.txtChange.Text) 'Display Answer
        Quaters = change \ 25
        Dimes = (change Mod 25) \ 10
        Nickels = ((change Mod 25) Mod 10) \ 5
        Pennies = (((change Mod 25) Mod 10) Mod 5) \ 1

        Me.lblQuaters2.Text = Quaters
        Me.lblPennies2.Text = Pennies
        Me.lblNickels2.Text = Nickels
        Me.lblDimes2.Text = Dimes
    End Sub
End Class

_________________

PLAYING:
GTA IV (PC)
Halo 3 (X360)
COD4: MW (PC)
Fallout 3 (PC)
Prince of Persia (PC)
AIM Address Yahoo Messenger MSN Messenger ICQ Number
View user's profile Send private message Send e-mail Visit poster's website
Phatkav
Main Moderator
Main Moderator



Joined: 10 Jan 2007
Posts: 3685
Credits: 444.72


Location: Ontario, Canada
PostPosted: Fri Mar 07, 2008 3:09 pm Reply with quote

LMAO

This is hilarious because I remember that we did the same exercise and my code as similar to the one Badie posted.

_________________
"Anything that humans can imagine is a possibility in reality" - Physicist Willy Karen
Yahoo Messenger MSN Messenger
View user's profile Send private message Send e-mail
HungryHungryHippo
Extreme User 1
Extreme User 1



Joined: 16 Nov 2007
Posts: 721
Credits: 156



PostPosted: Fri Mar 07, 2008 5:06 pm Reply with quote

Visual basic....? isn't that a program that you draw pictures with?

_________________
View user's profile Send private message
Zaraki Kenpachi
Extreme User 2
Extreme User 2



Joined: 07 May 2007
Posts: 1597
Credits: 287.6



PostPosted: Sat Mar 08, 2008 7:09 am Reply with quote

not really pictures>..>it's all about functions of labels/buttons/....etc on a form and application and then you have to code them,to do some certain function...,(we learn these /in programming class....except we don't since our teacher is horrible at teaching us, in the class he says okay you guys are nerds....read the book and teach yourself:(.....so many are failing lol..)

_________________
I'm obssessed now over something you'll never find out =P
MSN Messenger
View user's profile Send private message Send e-mail
bashmo
Main Moderator
Main Moderator



Joined: 17 Oct 2006
Posts: 2678
Credits: 108.72


Location: Ottawa,ON
PostPosted: Sat Mar 08, 2008 10:07 am Reply with quote

OMG badie i got that question in like 10 minutes done lol, youre so noob >.<

_________________


Yahoo Messenger MSN Messenger
View user's profile Send private message Send e-mail Visit poster's website
Zaraki Kenpachi
Extreme User 2
Extreme User 2



Joined: 07 May 2007
Posts: 1597
Credits: 287.6



PostPosted: Sun Mar 09, 2008 9:46 pm Reply with quote

first Bashmo that wasn't an easy question>..>and you copied the code.......

_________________
I'm obssessed now over something you'll never find out =P
MSN Messenger
View user's profile Send private message Send e-mail
Phatkav
Main Moderator
Main Moderator



Joined: 10 Jan 2007
Posts: 3685
Credits: 444.72


Location: Ontario, Canada
PostPosted: Mon Mar 10, 2008 3:18 pm Reply with quote

That is an easy code if you know what you are doing.

_________________
"Anything that humans can imagine is a possibility in reality" - Physicist Willy Karen
Yahoo Messenger MSN Messenger
View user's profile Send private message Send e-mail
Zaraki Kenpachi
Extreme User 2
Extreme User 2



Joined: 07 May 2007
Posts: 1597
Credits: 287.6



PostPosted: Mon Mar 10, 2008 6:39 pm Reply with quote

come no you finished the course give us a break our teacher depends on us learning these ourselves>.<(he teaches us nothing!!..)

_________________
I'm obssessed now over something you'll never find out =P
MSN Messenger
View user's profile Send private message Send e-mail
Phatkav
Main Moderator
Main Moderator



Joined: 10 Jan 2007
Posts: 3685
Credits: 444.72


Location: Ontario, Canada
PostPosted: Mon Mar 10, 2008 7:13 pm Reply with quote

Zaraki Kenpachi wrote:
come no you finished the course give us a break our teacher depends on us learning these ourselves>.<(he teaches us nothing!!..)


But still I don't remember having any difficulty with that certain assignment when we got it. Though my code had some messed up formula but it still worked.



_________________
"Anything that humans can imagine is a possibility in reality" - Physicist Willy Karen
Yahoo Messenger MSN Messenger
View user's profile Send private message Send e-mail
Display posts from previous:   
  Post new topic   Reply to topic HardCore Gamer Networks Forum Index » Support & Suggestions     

    

  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 

phpBB skin developed by: John Olson
Powered by phpBB © 2001, 2005 phpBB Group
 

[ Copy this | Start New | Full Size ]