| Author | Message | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| visual basic 2010
One of my friends is trying to create this program in visual basic 2010, he has no idea where to even start. I took a look at it and couldn't help either so maybe somewhere here can help us out? i appreciate any help.
|
| Re: visual basic 2010
All the work would be in the 'Calculate reward points' button. In the buttons onclick event have it do something like: if chkBasic.checkstate = checked and text1.text < 75 then RewardPoints = text1.text * 1.05 end if if chkBasic.checkstate = checked and text1.text > 75 and text1.text < 149.99 then RewardPoints = text1.text * 1.075 end if text1 would be the input textbox for the total monthly purchase. chkBasic would be the basic membership checkbox. RewardsPoints would be the box/label or whatever that displays the points. I typed that code entirely freehand so dont expect to be able to copy/paste as i havnt even looked at a vb.net source in months so my syntax is probably all over the place. Hope this helps though.
|
| Re: visual basic 2010
I did it for you, enjoy. Full source and all. Preview:
Download: Source: https://tehsausage.com/paste/lab4b-source Could you possibly tell me where you're getting these labs? I would love to get some tasks to do in VB, I'm kinda stuck at doing nothing..
|
| Re: visual basic 2010
its from the Microsoft vb 2010 book. i used to do some vb6 so i told him i would take a peak at it. Thanks guys.
|
| Re: visual basic 2010
Loading.. posted: (30th Mar 2012, 12:43 am)Not to put a man down when he's done good work or anything but you could've just declared "Equation" beneath public class form1 or whatever it is then instead of using Dim Equation As Integer = whatever, you'll be able to code it like this: Equation = whatever It just makes your code easier to look at and it's good programming habit :)
--- If money doesn't grow on trees, then why do banks have branches?
|
| Re: visual basic 2010
It doesn't really matter when it comes to this, even if I publicly declared Equation, the equation is different every time. There for I would have to type what the Equation equals under every if statement. So yes it could of been done either way but it still would of required the same amount of code. So in my opinion I don't see anything wrong with the way it was done. When I don't have to type what a variable equals under multiple IF statements then I publicly
declareit.
|


