Programming Assignment 05 Blue Jet Flight Information with Class and Inheritance General and specific program requirements: 1. Problem: Blue Jet has just.

Slides:



Advertisements
Similar presentations
Working with Intrinsic Controls and ActiveX Controls
Advertisements

ARDUINO CLUB Session 1: C & An Introduction to Linux.
Lecture Set 4 Data Types and Variables Part B – Variables, Constants, Expressions Conversion Rules Options Strict, Option Explicit Scope of Definition.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
1 ASSIGNMENT OBJECTIVES LEARN TO USE: 1. Textboxes, labels, butttons, picture boxes, properties, radio buttons, checkbox, and methods, group boxes 2.Arithmetic.
Introduction to a Programming Environment
Modules, Hierarchy Charts, and Documentation
Viewbox 4 Tutorial How to create a Template Please view this tutorial as a Slide Show in PowerPoint, because it contains animations that will not appear.
 Visual Basic is an object-oriented language used to write application programs that run in Windows or on the Internet using a graphical user interface.
STAR PORTAL GRADEBOOK. Let’s Get Into the Gradebook! At the Teacher Schedule page, click once on the Gradebook link to open to the page for the corresponding.
Chapter Three Using Variables and Constants Programming with Microsoft Visual Basic th Edition.
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.
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
ACCESS 2007 ASSIGNMENT SPRING 2014 Purpose: To give students a basic understanding of ACCESS 2007 by constructing a database using the Ready2Read bookstore.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
Variables, Constants, Methods, and Calculations Chapter 3 - Review.
Chapter 3: Using Variables and Constants
Programming with Microsoft Visual Basic th Edition CHAPTER THREE USING VARIABLES AND CONSTANTS.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Chapter 4: The Selection Structure
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
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.
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.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
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.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Page 1 Non-Payroll Cost Transfer Enhancements Last update January 24, 2008 What are the some of the new enhancements of the Non-Payroll Cost Transfer?
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
ASSIGNMENT OBJECTIVES TO PRACTICE OR USE THE FOLLOWING: 1.CONTROLS: - buttons, labels, picture boxes, groupboxes, and a form 2. EVENTS: - Click, MouseDown,
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Introduction to Database using Microsoft Access 2013 Part 6.1 November 18, 2014.
1 Flight Times. 2 Problem Specification 3 Additional Specifications You may assume that the input is a valid 24 hour time. Output the time entered by.
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,
Welcome to State of Michigan Time & Expense Processing Employee Expense Modification (No Advance) Tutorial Brought to you by the Office of Financial Management.
ASSIGNMENT OBJECTIVES TO PRACTICE OR USE THE FOLLOWING: 1.CONTROLS: - buttons, labels, picture boxes, groupboxes, and a form 2. EVENTS: - Click, MouseDown,
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Three Memory Locations and Calculations.
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.
Programming with Microsoft Visual Basic th Edition
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
The Hashemite University Computer Engineering Department
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
1 ASSIGNMENT OBJECTIVES LEARN TO USE: 1. Textboxes, labels, buttons, picture boxes, properties, and methods 2.Arithmetic computations 3.Variables and constants.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
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.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
ASSIGNMENT OBJECTIVES
Chapter 4: The Selection Structure
Functions CIS 40 – Introduction to Programming in Python
Using Procedures and Exception Handling
Variables and Arithmetic Operations
HOW TO CREATE A CLASS Steps:
ASSIGNMENT OBJECTIVES
Presentation transcript:

Programming Assignment 05 Blue Jet Flight Information with Class and Inheritance General and specific program requirements: 1. Problem: Blue Jet has just established flights to three cities from Sacramento. Blue Jet wants you to design and program a system to display flight information. (Yes, I know the real name is jetBlue.) 2.Your GUI must look like the one below. 3.Get a picture of any Blue Jet plane by searching Google using Image and the key words “jetBlue” 4.You are to create a Class with the Class Name, Properties and Method shown in the diagram below. The class “clsFlightInformation” must be in a separate file within your solution. Class Name Properties Method 5.You are to use a ComboBox to select the destination city. 6.Place the word Destination in the Text property of the ComboBox as seen. ComboBoxes are covered in Chapter 5 (Gaddis) Due Dec 4, 2014 Get started now.

Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 7. Place the three city-state items in the ComboBox as shown below. See the next slides for the directions.

Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 8. Select the ComboBox and Click on the Items’ (Collections) property button. Select Click here.

Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 9. Enter the City-State values into the “String Collections Editor” EXACTLY as shown. There is one space after the comma. 10.Click OK (The ComboBox is now loaded and ready to use.) Enter these items here. Click OK when done.

The arrows show direction of the flow of data between the Object and Form1’s code. Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 11. You are to code the class and then use its object in Form1’s code. 12.The object and Form1’s GUI communicate as shown below: a.The City-State from Form1’s GUI Sets the Destination Property in the Object. b.The Form1 GUI then Gets these three Properties values from the object: ArrivalTime, DepartureTime, and Gate. c.The TicketPrice Method calculates TicketPrice by adding 15% (Tax) to the Flight Price. That Method is used by Form1’s GUI, but the calculations are done within the TicketPrice Method within the Object. 12.5You must use Option Strict On in the Form1 code, and in both classes. Form1 code Object Code

Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 13.You MUST use the values below for each of the three City-State Items. Washington, DCVancouver, WAChicago, IL Price 300DPrice 100DPrice 200D Tax Rate 0.15DTax Rate 0.15DTax Rate 0.15D Departure Time 7:00 amDeparture Time 8:00 amDeparture Time 9:00 am Arrival Time 3:00 pmArrival Time 10:00 amArrival Time 2:00 pm Gate 10Gate 20Gate The partial code below is how I programmed the class. This will serve as a template. YOU MUST DOCUMENT THIS CODE, AS YOU WOULD THE CODE ON FORM1. I DID NOT DOCUMENT IN ORDER TO SAVE SPACE. Public Class clsFlightInformation Private mstrDestination As String Private mstrDepartureTime As String Private mstrArrivalTime As String Private mstrGate As String Private Const mdecWASHINGTON_DC_PRICE As Decimal = 300D Private Const mdecVANCOUVER_WA_PRICE As Decimal = 100D Private Const mdecCHICAGO_IL_PRICE As Decimal = 200D Private Const mdecTAX_RATE As Decimal = 0.15D Public WriteOnly Property Destination() As String Set(ByVal Value As String) mstrDestination = Value I USED IF-THEN-ELSE CASE LOGIC HERE. THIS IS WHERE I SET THE VALUES OF mstrDestination, mstrDepartureTime, mstrArrivalTime, and mstrGate. End Set End Property Public ReadOnly Property DepartureTime() As String Get Return I HAD CODE HERE. End Get End Property Public ReadOnly Property ArrivalTime() As String Get Return I HAD CODE HERE. End Get End Property Public ReadOnly Property Gate() As String Get Return I HADE CODE HERE. End Get End Property Public Function TicketPrice() As String I USED IF-THEN-ELSE CASE LOGIC HERE. USE THE CONSTANTS ABOVE TO CALCULATE THE TicketPrice. Use FormatCurrency() function here and return the value as a string so that it can be assigned, without conversion, to a label text property in the Form Code. End Function End Class

Programming Assignment 05 Blue Jet Flight Information with Class General and specific program requirements: 15. Now that you have coded your class, Sacramento International Airport decided to temporarily add a $10 gate fee. Since you don’t want to rewrite your base class, you are to write another class which will add $10 to the ticket price of each flight. You must use inheritance for this. Below is a diagram of how this will function. 16.IMPORTANT: I think it best to get your program running without using inheritance, then add it as a last step. You will need to make minor modifications to the Form1 code when you add a derived class. 17.Both classes MUST be written as two separate files within the solution. You will get a ZERO grade if you code the classes within the code of the Form. Again, the Classes below, must be written as two separate files. 18.The method in the derived class only needs one line of code within it. clsRevisedFlightInformatiion will inherit the four properties and the single method from clsFlightInformation. Note that there are no properties and only one method in clsRevisedFlightInformation. Your Form1 code must now use clsRevisedFlightInformation and not clsFlightInformation; and there is no need to change objFlightInfomation to objRevisedFlightInformation unless you want to. Remember, this $10 gate fee is temporary. Base class Derived class IMPORTANT: GET THE PROGRAM RUNNING WITHOUT clsRevisedFlightInformation, THEN ADD IT. No Properties One Method

Additional Requirements for Program05 PROGRAM REQUIREMENTS: 1.Use good internal documentation in Form1 code and the Class code. See example on the later slides. Don't forget to use single-line comments within the program code, IF they add to comprehension of how the program functions. 2.Be sure to use the FormatCurrency function to display the ticket price. In this program, use it in the Class. In other words the ticket price will be sent back to the Form code all ready to be displayed in a label. 3.You must use Option Strict On in the Form1 code and the two classes 4. You must use the appropriate three-letter prefixes for variables and constants. If a variable or constant is declared at the module level, you must add an "m" to the beginning of the three-letter prefix. Example: mstrDepartureTime. See the example on the previous slide. A variable declared WITHIN a subroutine (sub-procedure) does not need the "m" and it must not be used. 5.All variable names must use the "Pascal" method; That is, begin every word in the variable name with a capital letter. All other letters are lowercase. Example: mstrDepartureTime (The prefix must be in lower case.) 6.Constant names must be in all caps. Separate each word with an underscore, and use the appropriate prefixes. Example: mdecVANCOUVER_WA_PRICE Use good identifiers (constant names and variable names.) These must be as meaningful as possible, as short as possible, and as meaningful as possible. 7.There is no need to validate data in this program. 8. Your user interface must look very similar to the one on the first slide. 9.Use pseudocode to design the program. That is, write down each step necessary to solve the programming problem. The steps must be in the appropriate order. Don't worry about the syntax of the code. You will write the code later to match the steps you have written down. Remember, never start coding until you know the steps necessary to solve the programming problem. You must fully understand the requirements of the program before you start coding. 10.Always use a "D" after a literal numeric constant which is used to calculate money values. Example: Private Const mdecCHICAGO_IL_PRICE As Decimal = 200D 11.Be sure that you use internal documentation within your class as well as the code on the form. 12.The class must use WriteOnly and ReadOnly for properties if appropriate. 13.Calculations of the TicketPrice with currency formatting must be done in the Class Method, not in Form1 code. 14.All procedures and methods MUST do a SINGLE FUNCTION. Use the “and” & “or” test You must use Region/End Region on Form1 code, and both classes. Use Regions on Variable/Constant section, each property procedure, and each method.

Additional Requirements for Program05 (Continued) PROGRAM REQUIREMENTS: 15.The Classes MUST be written as separate files within the solution. You will get a ZERO grade if you code the classes within the code of the Form. Again, the Classes must be written as separate files. 16. You are to design this program yourself. Do your best to modularize it.

DOCUMENTATION EXAMPLE ONLY YOU MUST FOLLOW THE DOCUMENTATION CHARACTERISTICS OF THE PROGRAMS ON THE NEXT FOUR SLIDES. DOCUMENTATION EXAMPLE ONLY

Below is an example of how documentation must be done. Don't forget to add comments in the code where appropriate. Don't forget to document all button subroutines (sub-procedures). DOCUMENTATION EXAMPLE ONLY

(Print) Last ____________________________First_________________ FOLD HERE MIS 15 section: Noon Program number GRADING STANDARDS POINTS POINTS Documentation was done according to guidelines: (0 OR 1 point)__________ GUI is reasonably correct:(0 OR 1 point)__________ Followed rules for forming constant names & variable names:(0 OR 1 point)__________ Used Option Strict On in the Form code and the two class:(0 OR 1 point)__________ Use FormatCurrency for displaying Ticket Price.(0 OR 1 point)__________ Ticket price is correct for all cities. (be sure to add tax (.15) and gate charge ($10))(0 OR 20 points)__________ SET and GET used correctly for properties.(0 OR 10 points)__________ Correctly used inheritance in the derived class that added the gate charge.(0 OR 10 points)__________ Regions were used on all modulesincluding the two classes. (0 OR 5 points)__________ ANY CALCULATIONS DONE IN THE FORM CODE (-50 POINTS) (All calculations MUST be done in the classes.) The base and derived classes not in two files in project files. (-50 POINTS) TOTAL POINTS: 50 pts. possible __________ Form-A Programming Assignment 05 Blue Jet Comments:

Program #2 Fall 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 using the following directory and sub-directory: Your Name\Program 05 2.____Printed your full name and program number on the CD using a permanent black marker. 3.____Submitted the CD in required envelope style not much larger than the CD. 4.____Placed the CD in the envelope. 5.____Cut out this form along dotted edges and TAPE it to the envelope. CUT OUT THIS FORM ALONG THE DOTTED EDGES AND TAPE IT TO THE ENVELOPE. YOU MUST USE THIS STYLE THAT IS ABOUT THE SIZE OF YOUR CD. Do not lick to seal. Use metal clip. Program 5 Blue Jet Program