Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 3:04 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ]  Bookmark and Share
Author Message
 Post subject: I desperately need help with a problem
PostPosted: Wed Oct 07, 2009 7:23 pm 
Offline

Joined: Wed Oct 07, 2009 7:15 pm
Posts: 1
Someone is hired for a job and agrees to pay one penny for the first day, two pennies for the second day, four pennies for the third day, and continuing to double each day. I need an application that allows the user to select/enter from a combo box the number of days the person will work and calculates the total pay.


Top
 Profile  
 
 Post subject: Re: I desperately need help with a problem
PostPosted: Fri Oct 09, 2009 1:10 am 
Offline

Joined: Thu Oct 08, 2009 9:18 pm
Posts: 6
This is simple:

1. add a combo box to your form (combobox1)
2. double click your form and add the following to the form load event

'This will add the numbers from 1 to 100 to the combo box for selection
For x = 1 To 100
ComboBox1.Items.Add(x)
Next

3. add a text box (TextBox1) to your form
4. double click on your combobox1 control and add the following script to the ComboBox1_SelectedIndexChanged event

Dim x, y, z As Integer
x = ComboBox1.Text
x = x - 1
If x >= 2 Then
z = 1
For y = 1 To x
z = z * 2
Next
ElseIf x = 0 Then
z = 1
ElseIf x = 1 Then
z = 2
End If
TextBox1.Text = z

5 Test it !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley