MELJUN CORTES VB.NET Midterm Exercise 2

Embed Size (px)

Citation preview

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    1/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #2-1

    Timer Control, Date and Time Functions with Color and MouseMove Method

    FORM 1:

    Sample Interface / Form Layout: Sample Output:

    Instructions:

    Add five Labels to your form

    Use the default object name of each label (i.e.. Label1, Label2, Label3, Label4, Label5)

    Change Labels properties:

    o Label1, Label2, Label3 & Label4

    Font: 14

    o Label5

    Font: 48

    Add Timer object

    Note: Timer object will be displayed on the form but at the lower part of the screen.

    Change Timer properties:

    o Enable: TRUE

    o Interval: 1000

    Use Color and MouseMove Method/Event Procedure to change the background color of the form

    depending on the selected color.

    Note: Your output will be based on the computer system date.

    Page 1 of 23

    Red Green Yellow Blue Red Green Yellow Blue

    Tuesday November

    032009

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    2/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Page 2 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    3/23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    4/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Conditional Statement using Select Case with GroupBox Control

    Solution Name : MPSOL01 Example: MPSOL01RichardGwapoProject Name : MPPJT02 Example: MPPJT02RichardGwapo

    Form Name : MPFRM01 Example: MPFRM01RichardGwapo

    FORM 3: Sample Interface/Form Layout:

    Formula:

    Semestral Grade = 25% of Prelim + 25% of

    Midterm + 50% of Final

    Point Equivalent Table:

    Problems:

    For New Entry Button:

    Upon clicking displays this message box

    If Yes will clear all entries else nothing happen

    For Compute Button:

    Upon clicking displays this message box

    If Yes will display the results else nothing happen

    For Exit Button:

    Will close the program/application

    Page 4 of 23

    Sem Grade Pt. Equivalent

    100 1.00

    95-99 1.50

    90-94 2.00

    85-89 2.50

    80-84 3.00

    75-79 3.50

    74 below 5.00

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    5/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #3

    RadioButton and CheckBox Control with Variables and Constants

    FORM 1: Sample Interface/Form Layout:

    Form Name : MPFRM02 Example: MPFRM02RichardGwapo

    For Compute button:

    Sub-Total will display the amount based

    on the selected items (TV size)

    Discount will display the amount based

    on the selected discount (radio button)

    Net Amount get the difference of sub-

    total and discount amount.

    Note:

    You can select one or more items (check

    boxes) (see sample output below)

    If no selected discount percentage the

    computer will assume of 0% discount.

    If no item selected all labels will have a

    value of 0.00.

    For Clear All button:

    Will deselect all checkboxes and radio

    button.

    Will clear all labels. (i.e., Sub-Total,

    Discount & Net Amount)

    For Close Button:

    Will close the program/application

    Page 5 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    6/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    RadioButton and CheckBox Control

    FORM 2: Sample Interface/Form Layout:

    Form Name : MPFRM03 Example: MPFRM03RichardGwapo

    PRICES:

    Size:

    Small Php 100.00

    Medium 150.00

    Large 200.00

    Crust Type:

    Thin Crust same as size pricesThick Crust Plus 50% of size

    prices

    Drinks:

    Soft Drinks Php 20.00

    Fruit Juice 15.00

    Coffee/Chocolate 25.00

    Extra Toppings:

    Plus Php 10.00 per extra toppings

    Build Pizza Button: will display

    message box Your Pizza (seesample above)

    Clear Toppings Button: will uncheck all

    check boxes.

    Compute Button: will display all values

    under Amount frame

    Clear All Button: will clear all entries

    Exit Button: will close the program.

    Page 6 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    7/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #4

    Random Function

    FORM 1: Guessing Game

    Sample Interface/Form Layout

    Problems: Guess number should be from 0 9 only

    Prompt the user with invalid input

    Compare the users input and computer generated number then display a message box for correct and

    incorrect guess (see sample output)

    FORM 2: Lucky Seven

    Specification:

    Add 3 labels

    o Label1, Label2 & Label3

    Name: lblNum1, lblNum2, lblNum3

    BorderStyel: FixedSingle

    FontSize: 20 FontStyle: Bold

    Text: None

    TextAlign: MiddleCenter

    o Button

    Name: btnSpin

    Text: &SPIN

    Page 7 of 23

    Enter your guess number:

    Output: If one of the labels has a value 7

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    8/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Problems:

    Spin button, upon clicking will generate a random numbers to each label

    Random numbers should be from 0 to 9 only

    Display a message as shown in the sample message box (see above)

    FORM 3: Three (3) Digits Lotto

    Instructions:

    1. Your bet should not be less than 10 pesos, otherwise it will prompt you with Enter minimum amount of Php

    10.00

    2. Enter single digits for each of the text box

    3. If the content of the text box are all equal to the winning numbers (in order) it will prompt you with You have

    won 1 MILLION PESOS JACKPOT (see sample Message box below), otherwise it will prompt you with

    Sorry better luck next time4. But, if the content of the text box are equal to the winning numbers (but not in order) it will prompt you with

    You have won a consolation prize of ____. The consolation prizes will depend on the BET amount(Example: Bet is 100, multiply your bet to 1,000.00 to get the consolation amount.)

    Page 8 of 23

    Output: If no one has a value 7

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    9/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Output for Jackpot Output for Consolation prize

    GRADED EXERCISE #5

    ComboBox, ListBox & NumericUpDown Controls

    Form 1: Sample Program: without discount

    Specifications:

    ListBox

    o Name: lstParts

    o Items: see items in the figure

    ComboBox

    o Name: cboDisc

    o Items: 5%, 10%, 15% & No Discount

    Label (Name:)

    o lblUPrice

    o lblSubTot

    o lblDisc

    o lblTotAmt

    o TextAlign: Right

    Page 9 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    10/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Sample Output: with discount

    NumericUpDown

    o Name: nudQuan

    o Minimum: 0

    o Maximum: 100

    Button (Names:)

    o btnCompute

    o btnClear

    o btnClose

    Computer Parts Prices

    Monitor 2,000.00

    Keyboard 250.00

    Mouse 100.00

    Hard Disk 1,000.00Disk Drive 200.00

    ListBox Control with Double Click Method/Event Procedure

    and Looping Statement

    Form 2: ListBox to ListBox

    Sample Output:

    Page 10 of 23

    Underwear Selected Underwear

    Underwear Selected Underwear

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    11/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Specifications:

    2 list box (Name: lst1 & lst2 respectively)

    2 buttons

    Problems:

    Double Click items in the Underwear list box then will copied to the Selected Underwear list box

    Clear All button will clear all items in Selected Underwear list box

    Clear Selected Item button will clear only the selected item in Selected Underwear list box

    ComboBox, ListBox & NumericUpDown Controls

    FORM 3: Tuition Fee Computation

    Instructions:

    Define your own controls/objects name

    Course: (ComboBox)

    o Items: BSIT, BSCS, BSA, BSN

    Year Level: (ListBox)

    o Items: Freshem, Sophomore, Junior,

    Senior

    Total Units: (NumericUpDown)

    o Minimum: 3

    o Maximum: 30

    Lab. Units: (NumericUpDown)

    o Minimum: 0

    o Maximum: 3

    Tuition Fee per unit: Php 100.00

    Lab. Fee per unit: Php 1,000.00

    Problems:

    For Calculate button:

    o Will compute for Tuition Fee, Lab. Fee , Misc. Fee &

    Total Fee:Note:

    - If no selected Course and/or Year Level will display a message/prompt with No course selected

    and/or No year level selected- Label values will retain to empty.

    For Clear button:

    o Will clear Course ComboBox

    o Will deselect Year Level ListBox

    o Will clear all Labels

    o Will reset three(3) and zero(0) for NumericUpDown controls

    Page 11 of 23

    Miscellaneous Fees:

    Year Level BSIT/BSCS BSA/BSN

    Freshmen 1,000.00 2,000.00

    Sophomore 750.00 1,500.00

    Junior 500.00 1,000.00

    Senior 250.00 500.00

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    12/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    For Close button:

    o Will close the program/application

    Note: Format all values using any formatting numbers functions

    MIDTERM PERIOD

    GRADED EXERCISE #6FORM #1: Employee Payroll Computation

    Logical Problems & Formulas:

    Position Code Rate/Day Civil Status Basic Pay SSS Rate TAX Rate

    A 500.00 Single 10,000 & above 7% 10%

    B 400.00 Married 5,000 9,999 5% 5%C 300.00 Widowed 1,000 4,999 3% 5%

    below 1,000 1%

    Basic Pay = No. of Days Worked * Rate/Day

    SSS Contribution = Basic Pay * SSS RateWithholding Tax = Basic Pay * Tax Rate

    Net Pay = Basic Pay (SSS Contribution + Withholding Tax)

    Upon choosing the desired Employee Number, it will automatically display the Employee Name.

    Page 12 of 23

    EMPLOYEE PAYROLL COMPUTATION

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    13/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    For Compute Button, will compute the Basic Pay, SSS Contribution, Withholding Tax and Net

    Pay

    For Clear Button, will clear all entries

    For Quit Button, will close the program/application.

    GRADED EXERCISE #7

    DateTimePicker with DateDiff Function

    FORM #4: Hotel Billing System

    Room

    Capacity

    Room Type Rate/day Type of

    Payment

    Additional

    Charge

    Regular 100.00 Cash No addl charge

    Single De Luxe 300.00 Check + 5%

    Suite 500.00 Credit Card + 10%

    Regular 200.00

    Double De Luxe 500.00

    Suite 800.00Regular 500.00

    Family De Luxe 750.00

    Suite 1,000.00

    Page 13 of 23

    Problem:

    Compute for Total Amount based on the date of check-in and check-out.

    Select room capacity, room type and payment type before clicking Compute button otherwise, will

    prompt you with No selected room capacity or No selected room type or No selected type of

    payment

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    14/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #8

    FORM #4: Hotel Billing System

    FORM #1: Presidential Elections 2010

    Voters ID Entry

    For Validate button:

    o If the Voters ID is correct will display a message box

    as shown in the figure.

    o Click OK button to launch Form 2 (see form 2 below).

    FORM #2: Presidential Candidates

    Cast your vote by clicking the ComboBox

    and choose your desired candidate.

    For Vote button:

    o Click Vote button to confirm

    your vote

    o Then, the voted candidate will

    automatically display his votes as

    shown in the Actual Tally

    For Result button:

    o Click Result button to display the

    result. (see sample output below

    o o

    For Close button:

    o Click Close button to go back to the 1st form (Form #1)

    Page 14 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    15/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #9

    Array and MainMenu Control

    FORM 1: Password Entry

    Note: No limit for password, if incorrect password will prompt the user to RETRY & CANCEL and user name should

    have an entered value otherwise will prompt the user to enter value for user name.

    If the password is correct will display the 2nd form (MENU)

    FORM 2: (with File & Help Menu)

    Main Menu: File Help

    Sub Menus: Transaction AboutExit

    ,

    will display the Transaction Form (Form 3)

    For TRANSACTION Form:

    Initially; BUTTONS: New, Clear, Close & Compute are all in disabled layout (as shown below)

    will close the program

    Page 15 of 23

    Richard Gwapo

    * * * * *

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    16/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    FORM 3: Transaction

    Appliances/Items Unit Price Appliances/Items Unit Price

    Electric Fan 500.00 Television 5,000.00

    Refrigerator 9,000.00 Air Conditioner 10,000.00

    Washing Machine 4,000.00 Rice Cooker 600.00

    Oven Toaster 550.00 Electric Stove 1,000.00

    Flat Iron 350.00 Electric Pot 800.00

    VCD Player 1,200.00 Karaoke 2,500.00

    Mini Component 3,500.00 Microwave Oven 3,000.00

    Logical Problems:

    Double click Appliance item (List Box) then the selected item will be displayed to the Appliance Sold (List

    Box) and UnitPrice (List Box) (see example below)Note: Be sure that you have enter value in the Quantity

    If quantity is less than or equal to zero (0) it will prompt the user to input quantity.

    Amount Text Box will be based on the Appliance Unit Price * Quantity

    Example: Appliance Sold: Electric Fan, Unit Price: 500, Quantity: 2 (see example below)

    Sub-total Text Box will be based on the total item sold.

    Example: Appliance Sold: Air Conditioner 10,000.00 X 1 and Electric Fan 500.00 X 2

    (see example below);

    Choose Type of Payment: Cash or Charge then, will enable Compute button

    If Compute button is clicked; for CASH

    Total Amount = Sub-total less 5% discount

    Page 16 of 23

    User Name: Railee Darrel

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    17/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Page 17 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    18/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Output:

    For Cash Payment

    Then, will enable buttons; New, Clear & Close

    Enter value for Amount Tendered:

    Amount Tendered should be exact amount or should be greater than Total Amount otherwise, will prompt the

    user to enter valid amount.

    Click Change button to display the amount change.

    For New button, will clear all entries

    For Clear button, will clear Quantity, Appliance Sold, Unit Price and Type of Payment only.

    If Compute button is clicked; for CHARGE

    Total Amount = Sub-total + 5% additional charge

    For Close button, will close the transaction window only.

    Output:For Charge Payment.

    Page 18 of 23

    User Name: Richard Gwapo

    User Name: Richard Gwapo

    User Name: Richard Gwapo

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    19/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    Then, will hide all controls under Total Amount and displays 5% Additional to all Charge Payments (seeexample above)

    FORM 4:

    If Help then About is clicked

    will display a Form About the program

    If button OK is clicked

    will close the form window.

    If button AUTHOR is clicked

    will display programmers name

    Page 19 of 23

    ApplianceStore

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    20/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #10

    ListView Control and Array

    Sample Output:

    New button:

    o will clear all the textboxes and student number

    will be automatically generated (use 3 digits

    format)

    Save button:

    o will only save data if with complete

    information. (make a necessary prompt for

    incomplete entry)

    View Record button:

    o will display record on the listview

    Remove Record button:

    o will remove from the listview of the selected

    record.

    Page 20 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    21/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    FINAL TERM PERIOD

    GRADED EXERCISE #11

    Instructions: Design your own interface for login (password entry), main form, and searching form (see sample

    interface below)

    Design your database and table for user and Enrolment Monitoring System (EMS)

    Form 1: Login (password entry) Login Table:

    Main Form: Enrolment Monitoring System (EMS)

    EMS Table:

    Note:

    Initially, only Add and

    Search button are enabled

    (1st five buttons only) and

    set TextBox &

    ComboBox control to

    Enabled = False

    Upon clicking the Addbutton will enabled Save

    button only. Student

    number will be

    automatically generated

    with the required format

    Page 21 of 23

    Field Name Field Type

    UserID Text

    UserPassword TextUserName Text

    Note:

    use 08- for UserID

    Example: JRU-001

    Assign Password & UserName for each UserID

    Field Name Field Type

    studNum Text

    studName Text

    Course Text

    Year Text

    Section Text

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    22/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    The new record

    will not be saved if

    incomplete entries

    Upon clicking

    Save button will

    enabled again the New& Search button

    If Search button is

    clicked will display an

    InputBox and prompt

    the user to enter

    Student Number

    If found will

    display the

    information of theinputted Student

    Number & will

    disabled New &

    Save button and will

    enabled Edit &

    Delete button

    If not found will

    prompt the user

    Student Number

    not exists

    If Edit button is clicked,TextBox & ComboBoxand only Save button will

    be enabled

    Note: Set TextBox and

    ComboBox to Enabled

    = True Clicked Save

    button to update the

    record

    If Delete button is clicked

    will prompt the user to

    confirm the deletion of

    record Upon clicking the

    Advanced Search button

    will display new form

    (Advanced Search form)

    Upon clicking Exit button

    will close the program.

    Page 22 of 23

  • 7/27/2019 MELJUN CORTES VB.NET Midterm Exercise 2

    23/23

    JOSE RIZAL UNIVERSITY Computer Science Department

    ITC 23 Object Oriented Design and Development

    LABORATORY EXERCISES

    GRADED EXERCISE #12

    Instructions: Design user interface for Advanced Search Form

    Add the following items for the three (3) frames

    Sort by: (items)

    Search only by and

    Search by block

    ComboBox items:

    Course

    o ACT

    o BSIT

    o BSCS

    Yearo 1 to 4 only

    Section

    o A to C only

    Event Procedure for:

    Sort by GroupBox

    Name

    Course

    Year