1 ASSIGNMENT OBJECTIVES LEARN TO USE: 1. Textboxes, labels, butttons, picture boxes, properties, radio buttons, checkbox, and methods, group boxes 2.Arithmetic.

Slides:



Advertisements
Similar presentations
1.
Advertisements

Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Example 2.
Control Structures: Getting Started Sequence and Selection also arithmetic operators, data types, logical operators.
Chapter 7: Sub and Function Procedures
Chapter 7 – Control Structures A payroll company calculates the gross earnings per week of employees. Employees’ weekly salaries are based on the number.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Program 04 (Fall 2014) VB Auto Center Problem Purpose: You are to add Arguments and Parameters to Program 03. See slides 3, 4, and 5 for additional details.
ACCESS 2007 ASSIGNMENT SPRING 2014 Purpose: To give students a basic understanding of ACCESS 2007 by constructing a database using the Ready2Read bookstore.
Apply Sub Procedures/Methods and User Defined Functions
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
3-1 Chapter 3 Variables, Assignment Statements, and Arithmetic.
Chapter 6 Procedures and Functions Instructor: Bindra Shrestha University of Houston – Clear Lake CSCI
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Using the ACCESS 2007 Ready2Read example as a model for your database assignment you are to do the following: 1.Set up a database for a gold, silver, and.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Chapter 4: The Selection Process in Visual Basic.
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.
COMPUTER PROGRAMMING I Objective 7.03 Apply Built-in Math Class Functions.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
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 Spring 2006: Dr. David Scanlan, CSUS ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form.
Programming Assignment 05 Blue Jet Flight Information with Class and Inheritance General and specific program requirements: 1. Problem: Blue Jet has just.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
IMS 3253: Subroutines 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Procedures Subroutines Parameters –By Value.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
ASSIGNMENT OBJECTIVES TO PRACTICE OR USE THE FOLLOWING: 1.CONTROLS: - buttons, labels, picture boxes, groupboxes, and a form 2. EVENTS: - Click, MouseDown,
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 10: Chapter 6: Slide 1 Unit 10 Sub Procedures and Functions Chapter 6 Sub.
ASSIGNMENT OBJECTIVES 1. To learn how to use these controls: - buttons, labels, picture boxes, and a form. 2. To learn how to use these events: - Click,
ASSIGNMENT OBJECTIVES TO PRACTICE OR USE THE FOLLOWING: 1.CONTROLS: - buttons, labels, picture boxes, groupboxes, and a form 2. EVENTS: - Click, MouseDown,
4-1 Chapter 4 The Selection Process in VB.NET. 4-2 Learning Objectives Understand the importance of the selection process in programming. Describe the.
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 2010: Dr. David Scanlan, CSUS OBJECTIVES: How to write classes How to create an object from a class using the "New" keyword. How to communicate.
Program 03 Fall 2014 VB Auto Center Problem Purpose: VB Auto Center has ask you to write a program that will calculate the typical values involved in the.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 7 Where Can I Store This?
31/01/ Selection If selection construct.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
110 E-1 Variables, Constants and Calculations(2) Chapter 3: Operations on variables, scope of a variable, formatting data Doing Arithmetic.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 3: Chapter 3: Slide 1 Unit 3 Formatting Chapter 3 Input, Variables, Constants,
1 ASSIGNMENT OBJECTIVES LEARN TO USE: 1. Textboxes, labels, buttons, picture boxes, properties, and methods 2.Arithmetic computations 3.Variables and constants.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Controlling Program Flow with Decision Structures.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
ASSIGNMENT OBJECTIVES TO PRACTICE OR USE THE FOLLOWING: 1.CONTROLS: - buttons, labels, textbox for password, picture boxes, groupboxes, and a panel. 2.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3 Variables and Calculations.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Computer Science Up Down Controls, Decisions and Random Numbers.
Use TryParse to Validate User Input
Visual Basic Fundamental Concepts
A variable is a name for a value stored in memory.
ASSIGNMENT OBJECTIVES
Data Types, Arithmetic Operations
Single Dimensional Arrays
The Selection Structure
Use TryParse to Validate User Input
Introduction to VB programming
CS 2340: Programming in VB Instructor: Dr. Qi Yang Office: 213 Ullrich
Variables and Arithmetic Operations
Visual Basic..
ASSIGNMENT OBJECTIVES
Presentation transcript:

1 ASSIGNMENT OBJECTIVES LEARN TO USE: 1. Textboxes, labels, butttons, picture boxes, properties, radio buttons, checkbox, and methods, group boxes 2.Arithmetic computations 3.Variables and constants 4.IF THEN ELSE statements and CASE logic 5. Me.Close() 6. txtTextBox.Clear() and lblLabel.Text = “” 7. Procedures, Arguments and Parameters, ByVal and ByRef 8.FormatCurrency() and FormatNumber() functions 9.Use Google for help on FormatCurrency and FormatNumber. DIFFICULTY LEVEL:DIFFICULT TUTORING CENTER IS NOW OPEN START ON THE PROGRAM NOW. Know Chapters 1, 2, 3, 4 and 6 for this program. Spring 2015

2 GETTING HELP: You may ask another student for help, but you must not copy their code. Failure of the course will result for the person giving the code and the person receiving the code. REMEMBER: THE GRADES IN THIS COURSE ARE CURVED. I can get limited help from other students. For additional help, I need to see Dr. Scanlan, or the tutoring center.

3 1. The GUI MUST look almost exactly like the one displayed below. 2. Use FormatCurrency() and FormatNumber() functions to display the amounts. Use dollar signs for Gross and Net pay and Totals only. 3.Use Me.Close to close the program 5.Use any picture of a coffee shop you can find by searching Google Images. 6.If Hours worked are over 40 then the employee receives time and one-half for the hours over Note: There are changes on the form from Program #2. 8.The Clear Button clears all amounts, Radio Buttons, and CheckBoxes. 9.Be sure to use dollar signs for Totals, Gross Pay and Net Pay. Due Date: April 16, 2015 Points: 60 Late penalty: 50% per class day Programs are ONLY accepted at the START of the class period on the date due. General Requirement: Create a payroll calculator for a Coffee Shop Specific Requirements: Modularize Program

4 10. You are to modularize the program according to the hierarchy chart below. The code for the Main Module and the Validate Data modules are given on the following slides. 11. Use lblLabel.Text = “” and txtTextBox.Clear() to clear labels and textboxes. 12. You may NOT use module-level variables. You must communicate between modules using arguments and parameters. 13. Use ByRef only when you are passing a value back to the calling module. 14. You must add a range test to the Validate Data module: Range: Hours Worked: 1 through 60 Range: Pay Rate: 10 through You must use the code supplied on the next slides. Boss Module

5 Option Strict On 'You must use Option Strict On Public Class CalculateForm Inherits System.Windows.Forms.Form 'CONSTANT DECLARATIONS Const decFEDERAL_TAX_RATE As Decimal = 0.2D Const decSTATE_TAX_RATE As Decimal = 0.1D Const decCARBON_TAX_RATE As Decimal = 0.1D Const decMEDICAL_INSURANCE_RATE_PLAN_A As Decimal = 0.05D Const decMEDICAL_INSURANCE_RATE_PLAN_B As Decimal = 0.02D Const decMEDICAL_INSURANCE_RATE_PLAN_C As Decimal = 0.01D Const decDENTAL_INSURANCE_RATE_PLAN_A As Decimal = 0.05D Const decDENTAL_INSURANCE_RATE_PLAN_B As Decimal = 0.02D Const decDENTAL_INSURANCE_RATE_PLAN_C As Decimal = 0.01D Const decEYE_GLASSES As Decimal = 10D Const decEYE_EXAM As Decimal = 5D

6 'MAIN MODULE Private Sub btnCalcGrossPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalcGrossPay.Click 'VARIABLE DECLARATIONS Dim decHoursWorked As Decimal Dim decPayRate As Decimal Dim decGrossPay As Decimal Dim decFederalTax As Decimal Dim decStateTax As Decimal Dim decCarbonTax As Decimal Dim decMedicalInsurance As Decimal Dim decDentalInsurance As Decimal Dim decVisionInsurance As Decimal Dim decNetPay As Decimal Dim decTotalTaxes As Decimal Dim decTotalHealthDeductions As Decimal Dim blnErrorFlag As Boolean = False Call ValidateData(blnErrorFlag, decHoursWorked, decPayRate) If blnErrorFlag = True Then Exit Sub End If Call CalculateGrossPay(decHoursWorked, decPayRate, decGrossPay) Call CalculateTaxes(decGrossPay, decFederalTax, decStateTax, decCarbonTax, decTotalTaxes) Call CalculateHealthInsurance(decGrossPay, decMedicalInsurance, decDentalInsurance, _ decVisionInsurance, decTotalHealthDeductions) Call CalculateNetPay(decGrossPay, decTotalTaxes, _ decTotalHealthDeductions, decNetPay) Call DisplayDeductions(decFederalTax, decStateTax, decCarbonTax, decTotalTaxes, _ decMedicalInsurance, decDentalInsurance, decVisionInsurance, _ decTotalHealthDeductions) Call DisplayGrossPayAndNetPay(decGrossPay, decNetPay) End Sub

7 'VALIDATE DATA Private Sub ValidateData(ByRef blnErrorFlag As Boolean, _ ByRef decHoursWorked As Decimal, _ ByRef decPayRate As Decimal) Try decHoursWorked = CDec(txtHoursWorked.Text) Catch ex As InvalidCastException MsgBox("Hours worked must be numeric.", MsgBoxStyle.Information, "Input Error") txtHoursWorked.BackColor = Color.Yellow txtHoursWorked.Focus() blnErrorFlag = True Exit Sub End Try Try decPayRate = CDec(txtPayRate.Text) Catch ex As Exception MsgBox("Pay rate must be numeric.", MsgBoxStyle.Information, "Input Error") txtPayRate.BackColor = Color.Yellow txtPayRate.Focus() blnErrorFlag = True Exit Sub End Try End Sub Don’t forget to add the range tests for Hours Worked and Pay Rate.

8 Warning: Attend to these grading criteria. Failure to organized program according to Hierarchy chart - 60 _____________ Failure to use ByVal and ByRef appropriately- 40 _____________ Inputted Pay Rate or Hourly Rate values outside of Validate Data module- 60 _____________ Failure to use Option Strict On - 40_____________

9 Form-A GRADER FILLS IN THIS PAGE: PRINT LAST NAME:_______________________________ PRINT FIRST NAME:________________________ PROGRAM (Circle) DATE DUE:_____________________ DATE SUBMITTED:___________________ GRADER FILLS IN THESE BLANK DESCRIPTIONPOINTSPOINTS EARNED Appropriate GUI: 0 OR 5_____________ Used Variable names and constants correctly0 OR 5_____________ Failure to organized program according to Hierarchy chart - 20_____________ Failure to use ByVal and ByRef appropriately (-20 for each failure-20 to -60_____________ Inputted Pay Rate or Hourly Rate values outside of Validate Data module- 30 to -60_____________ Failure to use Option Strict On- 40_____________ Program runs correctly: -20 to -60_____________ Late penalty: -30 pts/class day_____________ Zero points if the program fails to compile_____________. TOTAL POINTS OUT OF A POSSIBLE 60:_____________ FAILURE TO HAND IN THE PROGRAM ACCORDING TO THE REQUIRED PROCEDURE: see next slide: -5 points Additional comments below: ATTENTION SPRING 2015

10 Form-B STUDENT FILLS IN THESE BLANKS: LAST NAME:_______________________________ FIRST NAME:_______________________________ PROGRAM (Circle) DATE DUE:_________________ DATE SUBMITTED:__________________ PLACE A CHECK NEXT TO THE FOLLOWING: 1.____Saved the Program on a CD-R or DVD-R using the following directory and sub-directory: Drive Letter:\Your Name\Program2 2.____Printed your full name and program number on the CD or DVD-R using a permanent black marker. 3.____Submitted the CD or DVD-R in an envelope not to much larger than the CD. 4.____Placed the CD or DVD-R in the envelope.. 5.____Cut out this form along dotted edges and securely tape it to the envelope. CUT OUT THIS FORM ALONG THE DOTTED EDGES AND TAPE IT TO AN ENVELOPE ABOUT THE SIZE OF A CD or DVD-R. Be careful: Do not save your program on your DVD-R or CD using the USB format.. YOU MUST USE THIS STYLE THAT IS ABOUT THE SIZE OF YOUR CD. Do not lick to seal. Use metal clip.