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.

Slides:



Advertisements
Similar presentations
Introduction to Programming and Visual Basic 2005
Advertisements

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
An Introduction to Visual Basic Terms & Concepts.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter Introduction to Programming and Visual Basic
Chapter 2: Designing Applications
Creating an OOED Application
IMS1906 Programming in VB.NET Week 3 – Lecture 1 Application Development © Angela Carbone Monash University School of Information Management.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1.
Chapter 7: Sub and Function Procedures
Chapter 1 Introduction to Programming and Visual Basic 2005 Lecture Notes Chapter 1 (CSIT 105)
Chapter Introduction to Programming and Visual Basic
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
CIS 115 Lecture 2.  Visual Studio 2005 Professional Edition (Requires Windows XP Pro)  MSDN Library for Visual Studio 2005 Available from MSDNAA.
Introduction to Programming and Visual Basic
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Programming and Visual Basic.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 1: Chapter 2: Slide 1 Unit 1 Introduction to Programming Using VB.NET Chapter.
CS 0004 –Lecture 8 Jan 24, 2011 Roxana Gheorghiu.
Overview-An Overview of Visual Basic.NET1 An Overview of Visual Basic.NET.
Intrinsic Functions Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
CSCI Chapter 2 Creating Application with Visual Basic Instructor: Bindra Shrestha University of Houston – Clear Lake.
CIS 115 Lecture 4.  Create a Windows-based application that will calculate the Gross Pay earned for a worker, given the number of hours worked and hourly.
Clearly Visual Basic: Programming with Visual Basic 2008
Programming with Microsoft Visual Basic 2012 Chapter 2: Designing Applications.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 2 Creating Applications With Visual Basic.NET.
Visual Basic Week 2
Starting Out with Visual Basic.NET 2 nd Edition Chapter 1 Introduction to Programming and Visual Basic.NET.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Copyright © 2014 Pearson Education, Inc. Chapter 1 Introduction to Programming and Visual Basic.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
Visual Basic.NET BASICS Lesson 5 Exponentiation, Order of Operations, and Error Handling.
Visual Basic.net Textbox & Label Controls. Textbox Naming convention (txt) Primary use (user input) Can except numeric and character values.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Managing Controls Lab 2 2 All Rgihs ReservedIsmail M. Romi – PPu: IT DEpt.
What is Visual Basic.NET? 110 B-1 e.g. a word processor doesn’t do anything until the user clicks on a button, types text... A programming language that.
Copyright © 2011 Pearson Addison-Wesley What is a Program Made Of? Keywords (Reserved Words) – Words with special meaning that make up a high-level programming.
Chapter One An Introduction to Programming and Visual Basic.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Programming and Visual Basic.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
You should unzip and download the beginning programs.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
VAT Calculator program Controls Properties Code Results.
CS 2340: Programming in VB Lab 2 Due 9 pm, Friday, September 14 1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
5.01 Understand Different Types of Programming Errors
2c – Textboxes and Buttons Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Steps for Developing a Visual C# 2010 Application MIT By: S. Sabraz Nawaz.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
More Visual Basic!. Creating a Standalone Program A standalone program will allow you to make a program file that can be run like other Windows programs,
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Using Forms and Form Elements In Visual Basic.NET.
Chapter 1 Introduction to Programming and Visual Basic.
5.01 Understand Different Types of Programming Errors
Introduction to Programming and Visual Basic
An Introduction to Visual Basic
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Introduction to Programming and Visual Basic
5.01 Understand Different Types of Programming Errors
Simple Windows Applications
STARTING OUT WITH Visual Basic 2008
Chapter One: An Introduction to Programming and Visual Basic
Tutorial 11 Using and Writing Visual Basic for Applications Code
Presentation transcript:

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.

Problem Solving Input (controls): Hours Worked Hourly Pay Rate Process (event handling): Calculate Gross Pay Gross Pay = hoursWorked * hourlyPayRate Output (controls): Gross Pay

Creating the Visual Basic Application Event Driven Programming Create the Interface / Window first Input Output Then Code the Application Process Event Handing Methods

Creating the Interface Input Hours Worked  Textbox, Label Hourly Pay Rate  Textbox, Label Output Gross Pay Earned  Label (title), Label (display info) Events Calculate Gross Pay  Button Exit Program  Button

Design the Interface – TOE Chart Task (T)Object (O)Event (E) Input Hours WorkedTextbox, LabelNone Input Pay RateTextbox, LabelNone Output Gross PayLabel (display), Label (title) None Calculate Gross PayButtonClick Exit ProgramButtonClick

Create Your Interface Label Text Box Label 2 Buttons

Properties Form1 Name = frmWageCalculator Text = “Wage Calculator” Label1 No Need to Rename (Display Only – will not use) Text = “Number of Hours Worked” Label2 No Need to Rename (Display Only) Text = “Hourly Pay Rate” Label3 No Need to Rename (Display Only) Text = “Gross Pay Earned”

Properties Textbox1 Name: txtHoursWorked Text: Textbox2 Name: txtPayRate Text: Label4 Name: lblGrossPay (needs name because will will use this label) Text: Autosize: Off BorderStyle: FixedSingle Button1 Name: btnCalculate Text: “&Calculate Gross Pay” Button2 Name: btnExit Text: “E&xit”

Process – Event Handling btnCalculate 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 field Val changes the text input from the text box into a number

Event Handling btnExit Button Click Event End

Run & Test Program Syntax Errors – Language Errors Caught by the Compiler & Interpreter Visual Basic – wavy line under problem code Run-Time Errors Causes Program to Crash Logic Errors Program Runs but gets “Wrong Answer”

Run & Test Program Must test for expected and unexpected input

Homework Create 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)