Problem making program...

jtm0n3y

New member
Joined
Sep 27, 2006
Messages
1
Programming Experience
Beginner
I am trying to make a program to help me out in math class. I want a basic form with two buttons - One that says Enter Numbers and another that says Exit. I am fine with making the form. However, I'm not quite sure how to code what I want the program to do. I want the program to, when you click on the Enter Numbers button, pop up with an input box with the title "Input Needed" and body that says "Enter a positive integer value." I also want the box to have a default value of 10. After you enter a value and hit the OK button, a message box should pop up stating that "The sum of the numbers between 1 and [whatever number was inserted] is [answer]" It's a basic factorial operation but I'm not sure how to go about coding it. If someone could help me out here I would be greatly appreciative. Thanks!
 
hi mate

i think this would be the code you could use

private x as integer=txtInput.text
private sum as integer

for i as integer=1 to x
sum += i

next

hope that helps mate

regards
adam
 
Last edited:
Back
Top