Intro to Programming and Visual Basic .NET

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.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter Introduction to Programming and Visual Basic
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1.
Chapter 1 Introduction to Programming and Visual Basic 2005 Lecture Notes Chapter 1 (CSIT 105)
Chapter Introduction to Programming and Visual Basic
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
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.
CSCI Programming with Visual Basic Instructor: Bindra Shrestha University of Houston – Clear Lake.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Chapter Introduction to Computers and Programming 1.
Visual Basic Chapter 1 Mr. Wangler.
Overview-An Overview of Visual Basic.NET1 An Overview of Visual Basic.NET.
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1 P. 1 Writing Windows applications with Visual Basic Figure 1.1 The first program works as follows: (These operations can be performed in any.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Copyright © 2012 Pearson Education, Inc. Chapter 1 Introduction to Computing and Programming.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3 Part 21 Displaying Output Chapter 3 Section 3.5Output Formatting Chapter 3 Section 3.6Group Boxes, etc. Chapter 3 Section 3.7Sample Program Chapter.
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.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Visual Basic Week 2
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 1 Introduction to Programming and Visual Basic.NET.
Copyright © 2014 Pearson Education, Inc. Chapter 1 Introduction to Programming and Visual Basic.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
COPYRIGHT 2007: Dr. David Scanlan, CSUS 010-HELLO WORLD VB-Express.ppt Purpose: A "Hello World" program's purpose is to eliminate as much complexity as.
Managing Controls Lab 2 2 All Rgihs ReservedIsmail M. Romi – PPu: IT DEpt.
Chapter 2 – Introduction to the Visual Studio .NET IDE
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.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
1.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 1 Introduction to Programming and Visual Basic.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
The Hashemite University Computer Engineering Department
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Steps for Developing a Visual C# 2010 Application MIT By: S. Sabraz Nawaz.
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.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 1: Introduction to Computers and Programming.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 1 Introduction to Programming and Visual Basic.
Visual Basic.NET Windows Programming
Chapter 2: The Visual Studio .NET Development Environment
Introduction to Programming and Visual Basic
Chapter 2 – Introduction to the Visual Studio .NET IDE
1. Introduction to Visual Basic
Program and Graphical User Interface Design
CIS16 Application Development Programming with Visual Basic
STARTING OUT WITH Visual Basic 2008
Presentation transcript:

Intro to Programming and Visual Basic .NET Chapter 1 Chapter 1

Program Set of instructions a computer follows to perform a task Examples Calculate gross pay, taxes, and net pay Print past-due notices to credit card holders Drop the lowest homework assignment score Chapter 1

Computer Programs Used in most industries Accounting Human Resources Education Aviation Marketing Chapter 1

Program Acquisition Shrink-Wrap Software In-house Development Very available Lower cost Standardized, not customizable In-house Development Higher cost Customizable to specific needs Outsourcing Customizable Chapter 1

Methods of Programming Procedural Statements executed by the computer, one after another, in sequential order from start to termination of a program Typical of text-based terminal User responds to program Object-Oriented GUI interface consisting of a set of objects Program responds to user Chapter 1

Procedural Program Example Display onscreen message: "How many hours did you work?" Allow the user to enter the number of hours worked Once the user enters a number, store it in memory Display onscreen message: “What is your hourly pay rate?" Allow the user to enter an hourly pay rate Multiply the two numbers stored in memory and store the result in memory Display a message on the screen that shows the gross pay. The message must include the result of the calculation performed in step 7 Chapter 1

Procedural Program Example How many hours did you work? 10 What is your hourly pay rate? 15 Your gross pay is $150.00 C>_ Chapter 1

Object-Oriented Programming (OOP) Centered on object creation. Object: element containing data & actions Examples Form (window) object Label (descriptions) object Text Box (data entry) object Button (event driven) object Attributes (Properties) Text property (e.g., Hourly Pay Rate) Size (Height & Width) Location (Vertical & Horizontal Position) Chapter 1

Event-Driven Programming Responds to events Action or occurrence that takes place in the program. User Action Examples Click or double-click a button Press a key on the keyboard System Occurrences Examples Timer Sits idle until an event occurs—again program responds to user (or system). Chapter 1

Events Button Object (Control) responds to a Click event. Text Box Object (Control) responds to data entry, which is a TextChanged event. Chapter 1

Event Procedure Algorithm that executes when the event occurs. Not triggered until event occurs. Chapter 1

Algorithm* Formula or set of steps for solving a particular problem Characteristics: Unambiguous Well-defined Clear Fewest steps possible Terminal *Adapted from webopedia.com’s definition. Chapter 1

Algorithm Example *Example for algorithm definition on webopedia.com. Chapter 1

Pseudocode* Outline of a program No real formatting or syntax rules Cross between human language and programming language. Human readable Basis for algorithm development No real programming language skills needed *Adapted from webopedia.com’s definition and Gaddis’ definition. Chapter 1

Pseudocode Example Store hours worked from user input into memory Store hourly pay rate from user input into memory Multiply value of hours worked (in memory) by the hourly pay rate (in memory)* Store result into memory Display result (in memory) as output *Simple gross pay calculation ignoring overtime rates. Chapter 1

Controls (Objects) Control Prefix Example Description Form frm frmMain GUI interface Button btn btnClose Rectangular object that triggers event procedure when clicked Label lbl lblGrossPay Box displaying text that user can’t change (descriptions & output) Text txt txtPayRate Rectangular area for data input by user Chapter 1

Control Prefixes (p. 9) chk Check Box cbo Combo Box btn Button frm Form grp Group Box lbl Label lst List Box mnu Menu rad Radio Button pic Picture Box txt Text Box Chapter 1

Download Student Chapter 1 Files Run Program2\bin\Program2.exe See p. 10 Chapter 1

Measures of Quality Must fulfill users’ needs. Include required functionality. Perform functions correctly. Should be easy to use with little training. Design for clarity. Should be understandable looking at coding. Should have flexibility integrated for future versions of application. Chapter 1

System Development Life Cycle Involves joint effort of users & programmers. Identify user requirements. Design the application. Construct the application. Implement the system. Chapter 1

Step 1: Identify User Requirements Review request forms from users. Communicate with users. Identify current problems & concerns. Determine users’ needs: Features Method of operation Obtain contract if you are the outsource for another organization. Chapter 1

Step 1, continued Clearly define what the program should do. Purpose To calculate the user’s gross pay. Input # of hours worked Hourly pay rate Process Multiply # of hours worked by the hourly pay rate to obtain gross pay. Output Display a message indicating the user’s gross pay. Chapter 1

Step 2: Design (Plan) the Application Create blueprint of application. Sketch components for each user interface, similar to storyboarding. Chapter 1

Step 2, continued List needed controls (text boxes, labels, & buttons). Specify properties/attributes (Text) for each control. Specify methods/events (Click) for each control. Write pseudocode &/or flowchart Show design to users & obtain their feedback (very critical). Revise design based on feedback and continue cycle of user input. Chapter 1

Step 2 (List Controls Needed) Type Name Description TextBox txtHoursWorked Allows the user to enter the number of hours worked. TextBox txtPayRate Allows the user to enter the hourly pay rate Label lblGrossPay Displays the gross pay, after the btnCalcGrossPay button has been clicked Button btnCalcGrossPay When clicked, multiplies the number of hours worked by the hourly pay rate Button btnClose When clicked, terminates the application Chapter 1

Step 2 (Define Control Property Values) Property—characteristic, such as control name Value—specific attribute, such as lblGrossPay Control Type Control Name Text Form (Default) "Wage Calculator" Label (Default) "Number of Hours Worked" Label (Default) "Hourly Pay Rate" Label (Default) "Gross Pay Earned" Label lblGrossPay "$0.00" TextBox txtHoursWorked "" TextBox txtPayRate "" Button btnCalcGrossPay "Calculate Gross Pay" Button btnClose "Close" Chapter 1

Step 2 (List Methods for Controls) Methods—specific actions to perform based on specific user action, such as mouse click Method Description btnCalcGrossPay_Click Multiplies the number of hours worked by the hourly pay rate These values are entered into the txtHoursWorked and txt-PayRate TextBoxes The result is stored in the lblGrossPay Text property btnClose_Click Terminates the application Chapter 1

Step 2 (Write Pseudocode) Create a pseudocode version of each method: Pseudocode is a combination of English and a programming language Critical to effect planning; saves valuable time when you start actual programming; minimizes errors as you program. For this application: Store Number of Hours Worked times Hourly Pay Rate in grossPay. Store the value in grossPay in lblGrossPay.Text. Chapter 1

Step 2 (Continued) Check the code for errors: Go step by step through the code, running it in your head as though the computer is running it. Keep track of where in the code is being executed. Keep track of the values of all of the variables. Chapter 1

Begin Program Input hourly rate Input # of hours worked Are the # of hours > 40? No Multiply the hours worked by the hourly rate. Yes Multiply 40 by the hourly rate to get the regularly weekly pay. Subtract 40 from the total hours worked to find the OT hours. Multiply the pay rate by 1.5 to get the OT rate. Multiply the OT hours by the OT rate to get the amount of OT pay. Add the regular weekly pay and the OT pay. Display gross pay End Program Chapter 1

Begin Program Input hourly rate Input # of hours worked Are the # of hours > 40? No Multiply the hours worked by the hourly rate. Yes Multiply 40 by the hourly rate to get the regularly weekly pay. Subtract 40 from the total hours worked to find the OT hours. Multiply the pay rate by 1.5 to get the OT rate. Multiply the OT hours by the OT rate to get the amount of OT pay. Add the regular weekly pay and the OT pay. Display gross pay End Program Chapter 1

Step 3: Construct the Application Use VB to create the application. Create one piece (form) at a time. Create form (user interface window) and set its properties. Insert controls based on design specs. Set properties for all controls. Write code for the event procedures. Use pseudocode to create event procedures into correct syntax. Chapter 1

Step 3 (continued) Run the program. Test and debug the application throughout development. Correct syntax errors, incorrect use of the language, such as keyword. Correct logic errors, errors that don’t crash the program but produce inaccurate results, such as adding instead of multiplying. Use various examples of test data (different numbers, names, etc.). Chapter 1

Getting Started Create folder on H drive: ISYS1200 Create subfolders w/ in ISYS1200 Practice Assignments Slide Shows Chapter 1

Visual Basic .NET Interface Start program (see p. 22). Specify folder and subfolder location (Location text box). Type program name (Name text box). Chapter1GrossPay MulberyAssignment1 (for assignments) Folder created within location based on project name typed Chapter 1

Project Numerous files to run program Keep in same folder; do not copy/paste program files. Can copy/paste image files (bmp) into project folder if need images Chapter 1

Visual Basic .NET Environment Project name Mouse over to see Toolbox Design window (displays form) Form(s) within Solution Explorer Form (interface) Property window for selected object (currently the form) Chapter 1

Design Window Application’s forms Area where you design the interface Grid visible for programmer (not user) Chapter 1

Solution Explorer Window Solution (container for storing project files) Chapter 1

Properties Window Displays settings for currently selected object Changes based on what is selected Currently shows properties for form object Second example when a Label control object is selected Note: Some properties set at Design Time in Properties window. Other properties set with programming code. Chapter 1

Form Properties Text StartPosition MaximizeBox and MinimizeBox Icon Appears on title bar StartPosition Form location onscreen WindowsDefault (default setting) CenterScreen (typical) MaximizeBox and MinimizeBox True (Default) False (Dims or hides) Icon Symbol in top left corner (left of Text property) Chapter 1

ToolBox Unpinned Pinned (stays onscreen) Chapter 1

Textbook Reference USE IT—YOU PAID FOR IT!!!! Read information (pp. 16-19). Complete tutorials (pp. 28-29). Answer Check Points (p. 34). Check answers in back of book (p. 819) Note key terms (pp. 36-37) Answer Review Questions (pp. 37-39). Sometimes these make good test questions! Check answers from ftp site Chapter 1

Reminder Send e-mail to mulberke@uvsc.edu by 5 p.m. today (January 8). Chapter 1