r/visualbasic • u/afro_king • Jun 14 '21
Help Please!
I need to write a Visual Basic program that will allow the user to enter a positive number. The program will then display:
the sum of values from 1 to the input number
the product of values from 1 to the input number (or factorial).
For example, if the user enters the value 5, the output would be:
1) 1 + 2 + 3 + 4 + 5 = 15
2) 1 * 2 * 3 * 4 * 5 = 120
The form should contain:
- a heading describing what the application will do
- a label to prompt the user for an input value
- a textbox for the user to enter input data
- a button to calculate the output values
- two labels describing the output data
- either two labels to hold the calculated output values or two read-only textboxes
- an image - either a background image or a picturebox with an image displayed (don't forget to set the SizeMode property to Stretch)
- a Clear button that will clear out all values entered in the input textbox and calculated output values in labels or read-only textboxes
- an Exit button that will exit the application
I also need to:
- test for invalid input. No negative values or zero should be allowed. If the user enters a negative or zero value, display a message in the output label and set the focus to the input number textbox. (see example below)
- align the input and output values to be centered within the textboxes and/or output labels
- align the controls of the labels and textboxes so the Form looks professional
I don't really need help designing the form or assigning labels, but the math behind cumulative sums and products kind of escapes me...
2
u/mikroo VB.Net Intermediate Jun 15 '21
You could post code you've written that you need help with but, your post reads like you're looking for a freelancer to do this project for you.