| Author |
Message |
Badie05
Administrator


 Joined: 15 Oct 2006
Posts: 6237 Credits: 825.9
Location: Ottawa, Canada 
|
Posted: Wed Mar 05, 2008 8:09 pm |
 |
|
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) |
|
 |
|
 |
Zaraki Kenpachi
Extreme User 2


 Joined: 07 May 2007
Posts: 1597 Credits: 287.6
|
Posted: Thu Mar 06, 2008 3:02 am |
 |
|
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 |
|
|
|
 |
Badie05
Administrator


 Joined: 15 Oct 2006
Posts: 6237 Credits: 825.9
Location: Ottawa, Canada 
|
Posted: Thu Mar 06, 2008 9:54 am |
 |
|
I GOT IT
| 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) |
|
 |
|
 |
Phatkav
Main Moderator


 Joined: 10 Jan 2007
Posts: 3685 Credits: 444.72
Location: Ontario, Canada
|
Posted: Fri Mar 07, 2008 3:09 pm |
 |
|
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
 |
|
|
|
 |
HungryHungryHippo
Extreme User 1


 Joined: 16 Nov 2007
Posts: 721 Credits: 156
|
Posted: Fri Mar 07, 2008 5:06 pm |
 |
|
Visual basic....? isn't that a program that you draw pictures with? _________________
 |
|
| |
|
 |
Zaraki Kenpachi
Extreme User 2


 Joined: 07 May 2007
Posts: 1597 Credits: 287.6
|
Posted: Sat Mar 08, 2008 7:09 am |
 |
|
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 |
|
|
|
 |
bashmo
Main Moderator


 Joined: 17 Oct 2006
Posts: 2678 Credits: 108.72
Location: Ottawa,ON
|
Posted: Sat Mar 08, 2008 10:07 am |
 |
|
OMG badie i got that question in like 10 minutes done lol, youre so noob >.< _________________
 |
|
|
|
 |
Zaraki Kenpachi
Extreme User 2


 Joined: 07 May 2007
Posts: 1597 Credits: 287.6
|
Posted: Sun Mar 09, 2008 9:46 pm |
 |
|
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 |
|
|
|
 |
Phatkav
Main Moderator


 Joined: 10 Jan 2007
Posts: 3685 Credits: 444.72
Location: Ontario, Canada
|
Posted: Mon Mar 10, 2008 3:18 pm |
 |
|
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
 |
|
|
|
 |
Zaraki Kenpachi
Extreme User 2


 Joined: 07 May 2007
Posts: 1597 Credits: 287.6
|
Posted: Mon Mar 10, 2008 6:39 pm |
 |
|
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 |
|
|
|
 |
Phatkav
Main Moderator


 Joined: 10 Jan 2007
Posts: 3685 Credits: 444.72
Location: Ontario, Canada
|
Posted: Mon Mar 10, 2008 7:13 pm |
 |
|
| 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
 |
|
|
|
 |
|