Sunteți pe pagina 1din 2

NAME: COURSE / YEAR:

DATE: ______________ SCORE: _____________

PRACTICAL #1 DECLARING VARIABLES Objectives: This exercise aims to teach students how to: 1. declare variables 2. write assignment statements

Follow the directions below and create the expected output. In this activity you will use variables to code an application. Scenario: APC Sales needs an application in which they can enter the sales made in three towns of Cavite. The application should calculate the total sales and the commission.

* Final Output

Textboxes

Labels

1. Firstly open a new project. Choose New Project from the File menu, and select Standard EXE. Change the caption of your form into your last name instead of APC Sales. Ex: Almarez Sales 2. Make the Commission button the default button. Select the cmdCommission, on the properties window select the property default. Change the value to TRUE. 3. Code the Exit button so that it ends the application when it is clicked. 4. Code the Clear Screen button so that it clears the screen when it is clicked. Send the focus to the Indang sales text box. Example: txtIndang.Text = . 5. To send the focus to a certain object after an event, you can use the .SetFocus method. Example: txtIndang.SetFocus 6. Code the Print button so that it prints the form when it is clicked. Send the focus to the Clear Screen button. To print the form use the code frmAPC.PrintForm. 7. Code the Commission button using the following requirements: Declare variables for the three towns, the total sales and the commission Assign values to the variables Calculate Total sales = Indang sales + Ternate sales + Silang sales Calculate commission = total sales * 5% Display total sales and commission in lblTsales and lblComm Send the focus to the Print button 8. Save and run the application. Use the filenames practical_1.frm and practical_1.vbp and save the application on the folder you have created earlier. 9. Enter the following information to test your application.

10. Click Exit button to end the application. SAVE BOTH FILES IN CD, LABEL YOUR CD: PRACTICAL1, COMPLETE NAME. CD WILL BE SUBMITTED ON THURSDAY, AUGUST 23, 2012.

OTHER CONDITIONS: 1. Form not resizable 2. All buttons are working.

Sample output:

S-ar putea să vă placă și