VB 6.0 collge help

Happy new Year Everyone! I am currently a 2 year ISM major and I am having trouble answering 9 exercise questions. These questions are very short and simple but for an advance programmer but extremely difficult to me. I need help writing these simple textbook generic codes. If anyone can help me I would greatly appreciate it. I have then on file and the can be emailed for review upon request.

Thanks again,
MsTee
[433 byte] By [tpryce] at [2007-11-15 17:38:08]
# 1 Re: VB 6.0 collge help
I'm willing to have a look

Tom Cannaerts
slisse@planetinternet.be.remove.this.bit
Moderator on http://www.vbcodelibrary.co.uk/board

A bottomless pit, I'm sure it came with the place, who would dig one on purpose?
Cakkie at 2007-11-10 0:43:57 >
# 2 Re: VB 6.0 collge help
First, let me thank you for responding so quickly. Any help you can offer will be greatly appreciated. The following are the exercises that are giving me much difficulty:

2.4 You have a form with a text box, txBox, and a command button, cmdButton1. Write instructions such that when the button is selected, the words Button Pressed appear in the text box.

2.5 You have a form with two text boxes, txtBox1 and txtBox2, and two command buttons, cmdButton1 and cmdButton2. Write the instructions such that when cmdButton1 is selected, the contents of txtBox1 are copied to txtBox2, and when cmdButton2 is pressed, the contents of txtBox2 are copied in txtBox1.

2.6 You have a form with two text boxes, txtBox1 and txtBox2. Write the instructions such that the text box with focus has bold text, and the text box without focus has normal (not bold) text.

2.7 You have a picture box, picOutput, and command button, cmdCompute. Write the instructions such that when cmdCompute is selected, the answer to the following problem is displayed: If 30 people eat 45 hamburgers, how many hamburgers will 50 people eat?

2.8 You have a form with three boxes, txtBox1, txtBox2 and txtOutput, and a command button, cmdCompute. Write instructions such that when the button is selected, the numerical values in txtBox1 and txtBox2 are multiplied together and the result is displayed in txtOutput.

2.9 You have a form with three text boxes, txtBox1, txtBox2 and txtOutput, and a command button cmdCompute. Write the instructions such that when the button is selected, the strings in tctBox1 and txtBox2 are concentrated and the results is displayed in txtOutput.

2.10 You have a form with a text box, txtBox, a label, lblOutout, and a command button, cmdbutton, cmdCompute. Write the instructions such that the user can enter a value in the text box representing an amount of money, click on the button, and then the label displays the amount of money that would be earned in three years of compound interest at 5%.

3.6 Write a program that reads three strings from a data file and displays the first three letters of each string.

4.5 You have a command button, cmdShowerLength, and two text boxes, txtInput and txtDisplay. Write code such that when cmdShowerLength is clicked, txtDisplay shows the number of characters in the txtInput. The output in txtDisplay should be produced by a call to Sub procedure named Length.

4.6 You have a command button, cmdShow, and a picture box, picOutput. Write Sub procedure, called Doubler, that takes a parameter and doubles it. Use this Sub to write code such that when cmdShow is clicked, the first four powers of 2 ( that is 2,4,8,16) are displayed in picOutput.

5.5 Write a function that takes a number of years and returns the equivalent number of months. Write another function that takes a number of years and returns the equivalent numbers of days (ignore the possibly of leap years). Combine these functions in a program that has a text box, a command button, and a picture box. When the command button is clicked, the number of years in the text box is converted to months and days and displayed in the picture box.

6.5 Suppose, in a certain country, income tax is computed as follows: 18% of income, with a minimum of $1,000. Write a program that takes an income as input and produces the tax amount as output.

6.6 Suppose the country in the previous question modifies its income tax law. People earning less than $35,000 pay the same as before, 18% with a minimum of $1,000. However, people earning $35,000 or more now pay $6,800 + 25% of the income over $35,000. Modify your previous program to account for this change.

6.7 Write a program that makes an abbreviation from the following list of computer terms, and displays the full term. Make use of the Select-Case.
CS Computer Science
CD Compact Disc
DTP Desktop Publishing
OCR Optical Character Recognition

7.7 Suppose the population of a certain country was 125,000 at the beginning of the year 1995. The population is growing at a rate of 4.3% per year. Write a program that determines in what year the population will reach or exceed 200,000.

7.8 Write a program that receives an initial amount, a percentage of yearly compound interest, and a number of years, and then computes how much money would e in the account after that number of years. Make use of a For loop in your calculations.

8.4 Write a Sub called AddTitle that takes an array of Strings as a parameter and, for each String, adds the prefix Dr. Use Lbound and Ubound so that your SUB works on any size array. Write a test program for your Sub that crates an array of the following strings, calls the Sub, and then displays the results.

Kildar, Zhivago, Spocks, Roberts

8.5 You have a form with a control array of four text boxes, txtInput, a command button, cmdAverage, and a label, lblAverage. Write code such that when cmdAverage is clicked, lblAverage is displays the average of the numbers in the four text boxes. Use a loop in performing the calculation.
tpryce at 2007-11-10 0:44:57 >
# 3 Re: VB 6.0 collge help
2.4 answer:

Private Sub cmdButton1_GotFocus()
txBox.Text = "Button Pressed"
End Sub

2.5 answer:

Private Sub cmdButton1_GotFocus()
txBox2 = txBox1
End Sub

Private Sub cmdButton2_Click()
txBox1 = txBox2
End Sub

halforc
halforc at 2007-11-10 0:46:01 >
# 4 Re: VB 6.0 collge help
private Sub Text1_GotFocus()
Text2.FontBold = false
Text1.FontBold = true
End Sub
'
private Sub Text2_GotFocus()
Text1.FontBold = false
Text2.FontBold = true
End Sub
Andrew R. at 2007-11-10 0:46:58 >
# 5 Re: VB 6.0 collge help
I strongly believe that this excersize should be done by the student himself.
It is not fair to answer these questions as that wouldn't help the student. These are very fundamental questions in VB and answering them should be very easy for one who had attended a week lab or went through first few chapters in any VB book.
lolla at 2007-11-10 0:47:57 >