Вы находитесь на странице: 1из 8

Project 1 Danilo Pizza

Write a VB Program to create an order processing application for a pizza restaurant.

1. Start Microsoft Visual Basic and create a Standard EXE application

2. Save the application in a new folder named Danilo Pizza 3. Save the form as Main and save the project as DaniloPizza 4. Design the form Right-click the form and click View Code

5. Define the procedure 6. On the form double-click each radio button and each check box 7. In their implementation, simply call the CalculatePrice() function: 8. Test the application and close the form 9. In the Objects combo box, select the txtQtyWings 10. In the Procedure combo box, select LostFocus 11. In the same way, initiate the LostFocus event of each Qty text box 12. Implement the events . 13. In the form, double-click the Close button and implement its Click event.

14. Test the application


Control Frame OptionButton TextBox OptionButton TextBox OptionButton TextBox Frame Label Label Label Label TextBox TextBox TextBox Label TextBox TextBox TextBox Frame CheckBox CheckBox CheckBox CheckBox CheckBox Caption or Text Pizza Size Small 8.95 Medium 10.75 Large 12.95 Side Orders Qty Unit Price Sub Total Buffalo Wings 0 3.25 0.00 Bread Sticks 0 2.15 0.00 Toppings Pepperoni Sausage Extra Cheese Olives Onions chkPepperoni chkSausage chkExtraCheese chkOlives chkOnions Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtyBread txtPriceBread txtTotalBread Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtyWings txtPriceWings txtTotalWings Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify optSmall txtSmall optMedium txtMedium optLarge txtLarge Alignment: 1 - Right Justify Alignment: 1 - Right Justify Value: True Alignment: 1 - Right Justify Name Additional Properties

Label TextBox Frame Label Label Label Label TextBox TextBox TextBox Label TextBox TextBox TextBox Label TextBox TextBox TextBox Label TextBox TextBox TextBox Label TextBox TextBox TextBox Button Label Text Box

Each Topping 0.45 Drinks Qty Unit Price Sub Total Soda Can 0 1.45 0.00 Soda 20 Oz. 0 1.45 0.00 Soda 2L Bottle 0 1.45 0.00 Orange Juice 0 2.25 0.00 Water 0 1.25 0.00 Close Total Price 0.00 txtTotalPrice Alignment: 1 - Right Justify txtQtyWater txtPriceWater txtTotalWater cmdClose Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtyOJ txtPriceOJ txtTotalOJ Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtySoda2L txtPriceSoda2L txtTotalSoda2L Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtySoda20 txtPriceSoda20 txtTotalSoda20 Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtQtyCan txtPriceCan txtTotalCan Alignment: 1 - Right Justify Alignment: 1 - Right Justify Alignment: 1 - Right Justify txtEachTopping Alignment: 1 - Right Justify

Project 2 Pledge Distribution


Write a program to create an application to raise money for three educational institutions. To proceed, we will call people on the phone or post the application in an intranet's directory. When the application starts, an amount of money will be entered.

Then, the person who is pledging money will specify the percentage of money that can be allocated to each institution. We will use three up down buttons to set the percentages. We must synchronize them so that the total values of the up down buttons must not exceed 100. The amount pledged is then converted with regards to each up down.

1. Start Microsoft Visual Basic and double-click Standard EXE


2. Save the project in a new folder named Pledge1 3. Save Form1 and Project1 in it

4. Right-click the Toolbox and click Components 5. In the Controls property page of the Components dialog box, click the check mark of the Microsoft Windows Common Controls-2 6.0 (SP4)

6.

Click OK Pledged text box, and the Close button

7. Design the form as follows Double-click each up down control, the Amount
8. Implement the events 9. Test the application

Control Label TextBox Label TextBox UpDown Label TextBox Label TextBox UpDown Label TextBox Label TextBox UpDown Label TextBox Label Button

Text Amount Pledged: 0.00 Rotherham College: 50

Name

Additional Properties

txtAmountPledged Alignment: 1 - Right Justify txtRate1 updAmount1 Alignment: 1 - Right Justify BuddyControl: txtRate1 SyncBuddy: True Alignment: 1 - Right Justify

% 0.00 Leicester University: 25 txtRate2 updAmount2 % 0.00 Lars Union Academy: 25 txtRate3 updAmount3 % 0.00 Message Close txtAmount3 lblMessage cmdClose Alignment: 1 - Right Justify BuddyControl: txtRate3 SyncBuddy: True txtAmount2 Alignment: 1 - Right Justify BuddyControl: txtRate2 SyncBuddy: True txtAmount1

Project 3 CD Publisher

Develop an application for a small CD publishing company. The owner wants the prices to be calculated so a customer would get a discount if he orders more. To attract customers and encourage them to order more, she has decided to fix the prices so that the customer would pay: $20/CD if she orders less than 20 units $15/CD if she orders less than 50 units $12/CD if she orders less than 100 units $8/CD if she orders less than 500 units $5/CD if she orders more than 500 units

1. Start Microsoft Visual Basic and create a Standard EXE application

2. Save the application in a new folder named CD Publisher 3. Save the form as frmMain and save the project as CDPublisher
4. To use the needed spin button, on the main menu, click Project -> Components... 5. In the Components dialog box, click the Microsoft Windows Common Controls 6.0 (SP4) check box

6. Click OK

7. Design it as follows
8. Double-click the Close button and implement its Click

9.

Double-click the UpDown control and implement its Change event

10. To allow the user to enter a quantity value, access the LostFocus event of the txtQuantity text box and implement it

Control Form

Properties Name: frmMain Border Style: 3 - FixedDialog Caption: CD Publisher Caption: Number of CDs: Name: txtQuantity Alignment: 1 - Right Justify Name: updQuantity Alignment: 1 Buddy Control: txtQuantity Max: 10000 Caption: Unit Price: Name: txtUnitPrice Alignment: 1 - Right Justify Caption: Total Price: Name: txtTotalPrice Alignment: 1 - Right Justify

Label TextBox UpDown

Label TextBox Label TextBox

CommandButton Name: cmdClose Caption: Close

Вам также может понравиться