You are on page 1of 9

RAHMAD BIN SUDIRMAN

TA12016
MANUFACTURING COMPUTER APPLICATION (BTM3234)
LAB2
DR. ARIFPIN & MISS NADIA








Lab Sheet 2

Task 1.
Create an apps as shown in Figure 4.9 in how to program visual basic 2012.


Step by step how to do this:
1. Open visual basic 2012, click new project then windows forms application
2. At the properties click text. Change form1 to Powers of 2. Then press enter.
3. Toolbox > Label. Then at the properties click text. Change label 1 to Enter
integer exponent:
4. Toolbox > Textbox.
5. Toolbox > button. Then at the properties, click text. Change button 1 to
calculate power of 2.
6. Toolbox > result label. Then at properties, border style > arrow displays >
Fixed3D and auto size > arrow displays > false.
7. Then double click on button calculate to enter the coding,

Thats it.
8. Click start to run the form (design).

















Task 2
Create an apps as shown in Figure 4.10

Step :
1. Open visual basic 2012, click new project then windows forms application
2. At the properties click text. Change form1 to Class Average. Then press enter.
3. Toolbox > Label. Then at the properties click text. Change label 1 to Grades:
4. Toolbox > List box .
5. Toolbox > Label. Then at the properties, click text. Change label 2 to Enter
grade:
6. Toolbox > Textbox.
7. Toolbox > button. Then at properties, click text. Change button 1 to Submit
Grade
8. Toolbox > button. Then at properties, click text. Change button 2 to Calculate
Average
9. Toolbox > label. Then at the properties, click text. Change label 3 to Results:
10. Toolbox > label. Then at properties, border style > arrow displays > Fixed3D
and auto size > arrow displays > false.
11. Toolbox > button. Then at properties, click text. Change button 3 to Clear
Grades.
12. Then insert the main coding in calculate average(button2).Others button also
need coding like submit, clear and exit (x)

13. Click start to run the form (design).



















Task 3
Complete exercise 4.11

Step :
1. Open visual basic 2012, click new project then windows forms application
2. At the properties click text. Change form1 to Wage Calculator. Then press
enter.
3. Toolbox > Label. Then at the properties click text. Change label 1 to Hourly
Wage:
4. Toolbox > Label. Then at the properties, click text. Change label 2 to Weekly
Hours:
5. Toolbox > Textbox. (textbox 1)
6. Toolbox > Textbox. (textbox 2)
7. Toolbox > Label. Then at the properties click text. Change label 3 to Gross
earnings:
8. Toolbox > Label. Then at the properties, click text. Change label 4 to Less
FWT:
9. Toolbox > Label. Then at the properties, click text. Change label 5 to Net
earnings:
10. Toolbox > label. Then at properties, border style > arrow displays > Fixed3D
and auto size > arrow displays > false.
11. Toolbox > label. Then at properties, borderstyle > arrow displays > Fixed3D
and autosize > arrow displays > false.
12. Toolbox > label. Then at properties, borderstyle > arrow displays > Fixed3D
and autosize > arrow displays > false
13. Toolbox > button. Then at properties, click text. Change button 1 to Clear
14. Toolbox > button. Then at properties, click text. Change button 2 to Calculate
15. Draw the function exactly in exercise.
16. Then, times for coding,in this design we only code the button1 as calculate,
and button2 as clear.
17. Insert this coding in button calculate .

Then in clear button,insert this coding to make sure all value on form are reset.
WageTextBox.Text = ""
HoursTextBox.Text = ""

earningsResultLabel.Text = ""
fwtResultLabel.Text = ""
netResultLabel.Text = ""

18. Click start to run the form (design).










Task 4
Complete exercise 4.14

Step :
1. Open visual basic 2012, click new project then windows forms application
2. At the properties click text. Change form1 to Miles per Gallon. Then press
enter.
3. Toolbox > Label. Then at the properties click text. Change label 1 to Enter
miles driven:
4. Toolbox > Label. Then at the properties, click text. Change label 2 to Enter
gallons used:
5. Toolbox > button. Then at properties, click text. Change button 1 to Calculate
6. Toolbox > Label. Then at the properties click text. Change label 3 to Miles:
7. Toolbox > ListBox.
8. Toolbox > Label. Then at the properties click text. Change label 4 to Gallons:
9. Toolbox > ListBox
10. Toolbox > label. Then at the properties, click text. Change label 5 to MPG:
11. Toolbox > ListBox
12. Toolbox > label. Then at the properties, click text. Change label 6 to Totals:
13. Toolbox > label. Then at properties, borderstyle > arrow displays > Fixed3D
and autosize > arrow displays > false.
14. Same like task 3, we only insert the coding in button which calculate our main
purpose of this application.

Then, Click start to run the form (design).

You might also like