Problem Create a Windows-based application that will calculate the Gross Pay earned for a worker,...
-
Upload
monica-davis -
Category
Documents
-
view
213 -
download
0
Transcript of Problem Create a Windows-based application that will calculate the Gross Pay earned for a worker,...
![Page 1: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/1.jpg)
![Page 2: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/2.jpg)
ProblemCreate a Windows-based application that will
calculate the Gross Pay earned for a worker, given the number of hours worked and hourly pay rate.
![Page 3: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/3.jpg)
Problem SolvingInput (controls):
Hours WorkedHourly Pay Rate
Process (event handling):Calculate Gross Pay
Gross Pay = hoursWorked * hourlyPayRate
Output (controls):Gross Pay
![Page 4: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/4.jpg)
Creating the Visual Basic ApplicationEvent Driven Programming
Create the Interface / Window first Input Output
Then Code the Application Process Event Handing Methods
![Page 5: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/5.jpg)
Creating the InterfaceInput
Hours Worked Textbox, LabelHourly Pay Rate Textbox, Label
OutputGross Pay Earned Label (title), Label
(display info)Events
Calculate Gross Pay ButtonExit Program Button
![Page 6: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/6.jpg)
Design the Interface – TOE ChartTask (T) Object (O) Event (E)
Input Hours Worked Textbox, Label None
Input Pay Rate Textbox, Label None
Output Gross Pay Label (display), Label (title)
None
Calculate Gross Pay Button Click
Exit Program Button Click
![Page 7: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/7.jpg)
Create Your Interface
LabelLabelLabel
Text Box Text Box
Label
2 Buttons
![Page 8: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/8.jpg)
PropertiesForm1
Name = frmWageCalculatorText = “Wage Calculator”
Label1No Need to Rename (Display Only – will not use)Text = “Number of Hours Worked”
Label2No Need to Rename (Display Only)Text = “Hourly Pay Rate”
Label3No Need to Rename (Display Only)Text = “Gross Pay Earned”
![Page 9: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/9.jpg)
Properties Textbox1
Name: txtHoursWorked Text: <blank>
Textbox2 Name: txtPayRate Text: <blank>
Label4 Name: lblGrossPay (needs name because will will use this label) Text: <blank> Autosize: Off BorderStyle: FixedSingle
Button1 Name: btnCalculate Text: “&Calculate Gross Pay”
Button2 Name: btnExit Text: “E&xit”
![Page 10: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/10.jpg)
Process – Event HandlingbtnCalculate
Button Click Event
Assignment statement Gets the data from the text field of the txtHoursWorked
textbox and the txtPayRate textbox. Assign the calculation data from the textboxes into the
lblGrossPay text fieldVal changes the text input from the text box into a
number
![Page 11: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/11.jpg)
Event HandlingbtnExit
Button Click EventEnd
![Page 12: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/12.jpg)
Run & Test ProgramSyntax Errors – Language Errors
Caught by the Compiler & InterpreterVisual Basic – wavy line under problem code
Run-Time ErrorsCauses Program to Crash
Logic ErrorsProgram Runs but gets “Wrong Answer”
![Page 13: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/13.jpg)
Run & Test ProgramMust test for expected and unexpected input
![Page 14: Problem 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.](https://reader036.fdocuments.in/reader036/viewer/2022070409/56649e915503460f94b96063/html5/thumbnails/14.jpg)
HomeworkCreate a “Multiplication Tables” application.
The program should allow the user to input 2 numbers and then display the product of those 2 numbers. (Remember to use the val function)