May 28th, 2013, 11:27 AM
Need help understanding Sub procedures
I've been trying to learn Visual Basic from online tutorials and searches and am stuck on a group of problems...
For each problem write a program that displays the output shown in a list box. The last two lines of the output should be displayed by one or more Sub procedures using data passed by variables from an event procedure.
1. (Assume that the following is displayed.)
According to a 2008 survey of college freshmen taken by the Higher
Education Research Institute:
16.7 percent said they intend to major in business.
1 percent said they intend to major in computer science.
2. (Assume that the current date is 12/31/2010, the label for txtBox reads “What is your date
of birth?”, and the user enters 2/3/1984 into txtBox before btnDisplay is clicked.)
You are now 26 years old.
You have lived for 9824 days.
3. (Assume that the label for txtBox reads “What is your favorite number?”, and the user types
7 into txtBox before btnDisplay is clicked.)
The sum of your favorite number with itself is 14.
The product of your favorite number with itself is 49.
4. (Assume that the following is displayed.)
In a recent year,
823 thousand college students took a course in Spanish
206 thousand college students took a course in French
I know from the above directions that I will need a ListBox to display the output but I'm having a hard time understanding sub precedures and as such I'm not sure how to go about creating these programs... Any help is greatly apprecated.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!