I am new to visual basic 6.0 and kinda behind in my class, and am having
trouble coding this application.
Scenario: IMY Industries needs an application that their personnel clerks
can use to calculate the new hourly pay, given the current hourly pay for each
or three job codes and the raise percentage (entered as a decimal). They also
want to display the message "Raise percentage: XX" on the screen. The XX in
the message should be replaced by the actual raise percentage, formatted to
a. Open the Lb4 (Lb4.vbp) project, which is located in the Tut03 folder on
your Student Disk. b. Save the form and the project as lb4Done in the Tut03
folder on your Student Disk. c. Use the Properties window to verify that
the New Hourly Pay button is the default button. d. Code the Exit button so
that it ends the application when it is clicked. e. Code the Print button
so that it prints the form when it is clicked. Send the focus to the Job Code
1 text box. f. Use the InputBox function to prompt the personnel clerk to
enter the raise percentage at the beginning of the application; in other
works, when he or she runs the application. The raise percentage will be used
to calculate the new hourly pay for each job code. (You may want to refer to
this tutorial's Debugging section for hints on using the InputBox
function.) g. Use the pseudocode shown in Figure 3-36 to code the New
Hourly Pay button. Assign the "Raise percentage: " message to a constant.
Format the new hourly pays to standard. Format the raise rate (in the message)
Figure 3-36. New Hourly Pay Button.
1. Declare variables and constant 2. Assign values to
variables 3. Calculate new hourly pay = current hourly pay * raise
rate + current hourly pay 4. Display new hourly pay in appropriate
label control 5. Display message and raise rate in lblMsg
control 6. Send the focus to the Print button
h. Save and run the application. Enter the following information. (Enter
the raise percentage when prompted by the InputBox function. Enter the current
hourly pay for each job code in the appropriate text boxes.)
Raise percentage (in decimal form): .05 Job Code 1's current
hourly pay: 5 Job Code 2's current hourly pay: 6.50 Job Code 3's
current hourly pay: 8.75
i. Calculate the new hourly pay, then print the form with the test data
showing. j. Click the Exit button to end the application. k. Print the
code. l. Modify the application's code so that it asks the personnel clerk
to enter the raise for each job code separately. Remove the InputBox function
from the form's Load event. Replace it with three InputBox functions in the
New Hourly Pay button's Click event. m. Change the message so that each
rate appears on a separate line in the label control as follows:
Job Code 1: XX% Job Code 2: XX% Job Code 3: XX%
Assign each message to a constant. n. Format the current hourly pay and
the new hourly pay to standard. o. Save the form and the project as
lb4Done2 in the Tut03 folder on your Student Disk, then run the application.
Enter the following information:
Job Code 1's current hourly pay: 5 Job Code 2's current
hourly pay: 6.50 Job Code 3's current hourly pay: 8.75
p. Click the New Hourly Pay button, then enter the following
Job Code 1 raise percentage: .03 (The decimal equivalent of
3%.) Job Code 2 raise percentage: .05 (The decimal equivalent of
5%.) Job Code 3 raise percentage: .045 (The decimal equivalent of 4.5%.)
q. Print the form with the test data showing, then click the Exit button to
end the application. r. Print the code. s. Submit the printouts from
steps i and q, and the code from steps k and
I hope the following answers help you, but I'm can't be sure unless I see the actual project:
c. Change the Default property to True.
d. The code for this is:
e. The code to print the form is:
To set focus to a textbox, use this code:
f. The code for an InputBox is:
Dim s As String
s = InputBox("Prompt", "[Title]", "[Default]") 'Title and Default are optional
If s <> "" Then
My Name Is Alaa , From Egypt
I Love Always To Help VB Programers To Get Stronger Because I Used To Program With Old Basic :'( When I Was Kid , Followed It With VB , And I Respect This Language Programers Too Much , And Always Feel Proud With Thier Exitance , I Always Was Facing Problems With My Old Age Professors In My College(Computer Science ) Because They Was Saying Shit About VB And Think That Only Old Staff Like C++ & Pascal Is A Real Programming Language , As I Said I Am Ready To Aid Any Body Like Language And For Free , With One Condition , Please Dont Ask Me To Make A Program For U , JUst Ask Me How To Program It
When Need Mail Me With Comment That U Are From Here Guys : BlackFox1234@hotmail.com
my name is Ahmed from Pakistan and I also visual basic programmer and i would like to friendship with you please inform me can u friendship with me because I proud of this website really iam very empress you .
Thankx to you
I am in 9th grade...taking Computer 1...and we are doing Visual Basic...as i read all this stuff...i realize "hey i know how ta do that now" and its so awesome! my friend and i are creating a game and coding it, its pretty neat!
My name is Kimberly. The only thing stopping me from graduating is my visual basics class.
I have 6 more projects to complete. Each project takes about 10 minutes (if you know what you're doing)!
I will pay someone $25.00 per project if they do it for me. Please help!
I have a question, how do i include other information in the inputbox function (i.e. integers or multiple numbers.)
The InputBox function only returns strings. If you want to get a number
from it, you need to ask the user to put in a number and then use the
Val function to get the number. Also use the IsNumeric function to
determine whether the user has entered a number or not.