CIS 115 lab3-vb app(09spring) - School of Computer and Information

advertisement
CIS 115 Introduction to Problem Solving and Programming
Instructor: Overstreet
Lab 3 (VB - Application)
Due: Week 5 - Friday, February 13
Create a Windows-based application that will calculate the Gross Pay earned for a worker, given
the number of hours worked and hourly pay rate. Let user choose when to close/exit the
application. Be sure to place the text “CIS115-???_LAB3_‘your full name’ ” in the title bar of
the form.
For this exercise, you will submit your completed solution page (inputs, outputs, processes, TOE
Chart, algorithm and test design), a printed copy of your Visual Basic Application (a screen shot
of your running program), and a printed copy of your code. If you do not include the completed
solution page and both the screen shot and the code, your assignment will be counted as
incomplete.
Staple your grade sheet (on top), the solution page, the screen shot, and the code together and
make sure to write your name, jnumber and section number at the top of your grade sheet. No
envelope necessary.
Name___________________________________JNumber________________Section________
CIS 115 Introduction to Problem Solving and Programming
Instructor: Overstreet
Lab 3 (VB - Application)
Solution Sheet
Inputs:
Hours Worked  Textbox, Label (title/prompt)
Hourly Pay Rate  Textbox, Label (title/prompt)
Outputs:
Gross Pay Earned  Label (display result), Label (title)
Processes:
Calculate Gross Pay  Button(click)
Gross Pay = hoursWorked * hourlyPayRate
Exit Program  Button(click)
End
Solution (TOE Chart/Algorithm):
Tasks
Objects
Events
Input Hours Worked
Textbox (txtHoursWorked), Label (prompt)
None
Input Pay Rate
Textbox (txtPayRate), Label (prompt)
None
Output Gross Pay
Label (lblGrossPay), Label (caption)
None
Calculate Gross Pay
Button (btnCalcGrossPay)
Click
Exit Program
Button (btnExit)
Click
Event
Event Procedure Code Algorithm
btnCalcGrossPay_Click
1.
2.
3.
4.
btnClose_Click
1. End the application
Get hours worked from txtHoursWorked
Get hourly pay rate from txtPayRate
Multiply hours worked by hourly pay rate
Assign result to lblGrossPay
Test Design:
Inputs
Test Case
Expected Outputs
hours
pay rate
gross pay
1
40
5.00
200.00
2
20
10.50
210.00
3
30.5
7.25
221.125
4
5
Observed Outputs
gross pay
Name___________________________________JNumber________________Section________
CIS 115 Introduction to Problem Solving and Programming
Instructor: Overstreet
Lab 3 (VB - Application)
Due: Week 5 - Friday, February 13
Grade Sheet
_____(20pts)
Completed solution sheet (correctness of design)
_____(40pts)
Screen shots (correctness of interface)
_____(40pts)
Code listing (correctness of algorithm implementation)
_____(100pts) Total Score
Download