Chapter 8 Classes and Objects: A Deeper Look. The Time Object.

Slides:



Advertisements
Similar presentations
Context Diagram Yong Choi BPA CSUB.
Advertisements

Inventory Management & Administration System Tourism suite A powerful computer software application handling carefully your inventory department activity.
Learning Targets Chapter 10
Merchandising Operations
Journalizing Purchases Using a Purchases Journal.
Section 16.1 Cash Registers
GOALS BUSINESS MATH© Thomson/South-WesternLesson 12.1Slide Cash Sales and Sales on Account Complete a cash proof form Calculate sales invoice and.
Mid-Semester Examination Information. When:Friday, March 6, 2009 Coverage: Chapters Format: Part A: multiple choice (20 points) Part B: 4 short.
Data Flow Diagramming. Data Flow Diagrams Data Flow Diagrams are a means to represent data transformation processes within an information system.
© 2014 Cengage Learning. All Rights Reserved. Learning Objectives © 2014 Cengage Learning. All Rights Reserved. LO4Record cash and credit card sales using.
1 Business Math Chapter 6: Percents. Cleaves/Hobbs: Business Math, 7e Copyright 2005 by Pearson Education, Inc. Upper Saddle River, NJ All Rights.
STUDENT ORGANIZATION TRAINING DEPOSIT FORMS Effective January, 2015.
Warm Up  Write the percent as a fraction and decimal  5%  6%  12%  6.5%  8%
Warm Up Write the percent as a fraction and decimal 5% 6% 12% 6.5% 8%
Advanced Entity Relationship Concepts. Advanced Concepts UIDs Intersection Entities Recursive Relationships Roles Subtypes Exclusivity Historical Fan.
The Systems House, Inc. 06/11/12. Setup Drug Types, Pharma Records Pedigree Printing Options Pedigree How it Works Updating Reporting ARCOS Reporting.
Indicator 4.05 Process sales documentation. Identify types of information contained in sales documentation The document types can be tailored to meet.
Learner’s Permit And Driver’s License
Glenn David Blank Computer Science & Engineering Department Lehigh University, Bethlehem, PA, USA With support from the National Science Foundation (Grants.
Recording Transactions in a General Ledger. Journal – a form for recording transactions in chronological order. Journaling – recording transactions in.
Chapter 24 Stock Handling and Inventory Control 1 Marketing Essentials Chapter 24 Stock Handling and Inventory Control Section 24.1 The Stock Handling.
A Second Look at Classes and Objects. Contents A.Stock Purchase Problem B.Employee Problem C.Drawing Lines D.Exercises.
 Lessons are about £20 per hour. You can get discounts if you book (and pay for!) 10, 15 or 20 lessons in advance. There are national companies (eg BSM,
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
Needles Powers Principles of Financial Accounting 12e Accounting for Merchandising Operations 6 C H A P T E R ©human/iStockphoto.
Bell Work Movie tickets used to cost $5, now cost $7. Find the percent of change. A percent of change tells how much a quantity has increased or decreased.
UNIT E SELLING FASHION 5.03 Perform various mathematical calculations in retail sales.
Chapter 6 Review Part 2: Sales, Discount, and Tax.
© 2014 Cengage Learning. All Rights Reserved. Learning Objectives © 2014 Cengage Learning. All Rights Reserved. LO4Record cash and credit card sales using.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
5 Minute Check Complete in your notes. MegaMart collects a sales tax equal to 1/16 of the retail price of each purchase. The tax is sent to the government.
© South-Western Educational Publishing GOALS LESSON 3.4 PRICING MERCHANDISE  Describe the methods buyers use to calculate the cost of merchandise  Calculate.
1) Get out your homework from 3.2 2) Start Warm up: Green Book Pg 11 #’s ) Get out a book and READ!!! Woundeful Wednesday.
Microsoft Access 2007 Tutorial (Part II) CIS*1000*DE.
A Second Look at Classes and Objects. Contents A.Stock Purchase Problem B.Employee Problem C.Drawing Lines D.Exercises.
Chapter 10 Object-Oriented Programming: Polymorphism.
POS Order Process Jennifer Perez Jun Park. Merchant Application Service Agreement Voided Check or Bank letter Two forms of business ID Copies of two consecutive,
Click to edit Master title style 1 Lesson Click to edit Master title style 2 Job Order Cost Systems 19.
University of Southern California Enterprise Wide Information Systems Customer Order Management Instructor: Richard W. Vawter.
Homework #3: Classes and Constructors By J. H. Wang Apr. 14, 2014.
Objective: Process the sale to complete the exchange.
W HAT I S A S ALES R ECEIPT ? Proof of purchase. C ASH R EGISTER R ECEIPTS A receipt is printed by the business register that lists all items purchased,
CHAPTER 9 VEHICLE INFORMATION. TITLE & REGISTRATION NJ RESIDENTS ARE REQUIRED TO TITLE AND REGISTER EACH VEHICLE WITHIN 60 DAYS OF MOVING INTO NJ TO AVOID.
Jenny’s Clothing Line By Jenny Lei Period 6 2/6/08 Exercise 25.
© 2014 Cengage Learning. All Rights Reserved. Learning Targets © 2014 Cengage Learning. All Rights Reserved. Lesson 10-1 Accounting for Sales on Account.
Revision lecture. Q1 – Q3 Q1. What is 20% of £140? Q2. What percentage of £20 is £3? Q3. How much would 12 DVDs cost at £5 each plus 20% VAT? = (20/100)

Chapter 9 Vehicle Information.
CHAPTER 9 Vehicle Information.
Job Order and Process Costing
LESSON 6-1 The Nature of Merchandise Inventory
Bell Work From 5 to = 5 40% increase
LESSON 19-1 Determining the Quantity of Merchandise Inventory
LESSON 9-1 Journalizing Purchases Using a Purchases Journal
ER MODEL Lecture 3.
5 Accounting for Merchandising Operations
© 2014 Cengage Learning. All Rights Reserved.
© 2014 Cengage Learning. All Rights Reserved.
© 2014 Cengage Learning. All Rights Reserved.
FLOW OF INVENTORY COSTS
Chapter 9 Vehicle Information.
PRICING OUT MY FUTURE! Name: Hour:.
© 2014 Cengage Learning. All Rights Reserved.
LESSON 9-1 Journalizing Purchases Using a Purchases Journal
Software Engineering Lecture # 19
LESSON 10-3 Accounting for Cash and Credit Card Sales
Two methods to observe tutorial
CHAPTER 40 FINAL ACCOUNTS 1
PRICING OUT MY FUTURE! Name: Hour:.
Recursive Relationship and Weak Entity Examples
Presentation transcript:

Chapter 8 Classes and Objects: A Deeper Look

The Time Object

Problem Description Time consists of hour (0 - 23), minute (0 - 59), and second (0 - 59). Develop the JTime class to represent time. JTime should have the following behaviors –Set a new time according to the new hour, minute, and second. Do not forget to validate these new values –Return a string to represent itself in the universal-time format: HH:MM:SS –Return a string to represent itself in the standard-time format: HH:MM:SS AM or PM

Questions 1.What is a valid hour? Minute? Second? 2.What is the universal-time format? 3.What is the standard-time format?

Answers 1.Valid hour: Valid minute: Valid second: Universal-time format: HH:MM:SS 3.Standard-time format: H:MM:SS AM or PM –If hour is 0 or 12, H will be 12. Otherwise, H will be (hour % 12) –If hour less than 12, it’s AM. Otherwise, it’s PM

Class Diagram

Developing the Constructor Without Input Data Validation

Adding Input Data Validation to the Constructor

Setting New Time

Getting the Universal-Time Format

Getting the Standard-Time Format

Exercise Compare our solution with the Deitel’s solution (in the next slides)

The Date Object

Problem Description Date consists of month (1 - 12), day (1 - 31), and year. Develop the JDate class and its constructor to represent a date. Do not forget to check the validity of input data Develop the toString() method for the JDate class according to the MM/DD/YYYY format

Question Q: How can we know that a year is leap year? A: A year is leap year if 1)It is divisible by 400, OR 2)It is divisible by 4 but not divisible by 100

Class Diagram To be filled

Step 1. Developing Constructor Without Input Validation

Validating the Month

Validating the Day

The Employee Object

Problem Description Info of an employee includes: First name, last name, birth date, and hire date. Develop the Employee class

Example First name: Sue Last name: Jones Birthday: Sept 5, 1986 Hire date: Jan 1, 2007

Class Diagram

A Better Design

An Even Better Design

Drawing Random Lines

Problem Draw a random number of lines (at least 1 and at most 5) inside a frame

Exercise Exercise 8.6

The Stock Problem A company’s stock consists of –The trading symbol. A short series of characters that are used to identify the stock on the stock exchange –The current price per share of the stock A stock purchase has the following information –The stock that was purchased –The number of shares Calculate the cost of the purchase

The Course Problem A course holds the following information: –The course name –The instructor’s last name, first name, and office number –The textbook’s title, author, and publisher

The Sports Car Problem A sports car has the following information: –The type (make) –The color –The price The type is either Porsche, Ferrari, or Jaguar The color is either red, black, blue, or silver

The Retail Problem An item in a retail store holds the following information –A brief description of the item –The number of units currently in inventory –The item’s retail price For example DescriptionUnits on HandPrice Item #1Jacket Item #2Designer Jeans Item #3Shirt

A cash register is a sale of a retail item Given the quantity of items being purchased, the cash register provides the sale’s subtotal, amount of sales tax, and total –The subtotal is the quantity multiplied by the price –The sales tax rate is 6% of a retail sale –The total is the subtotal plus the sales tax

The Parking Problem This problem is about a police officer issuing a parking ticket A parked car holds the following information –The car’s make (for example Toyota) –The model (for example, Nissan Z28) –The color –The license number (for example XY-1234) –The number of minutes that the car has been parked A parking meter records the number of minutes of parking time that has been purchased A parking ticket is responsible for –Reporting the make, model, color, and license number of the illegally parked car –Reporting the amount of the fine, which is $25 for the first hour or part of an hour that the car is illegally parked, plus $10 for every additional hour or part of an hour that the car is illegally parked –Reporting the name and badge number of the police officer issuing the ticket A police officer inspecting parked cars is responsible for –Telling his/her name and badge number –Examining the parked car and the parking meter, and determining whether the car’s time has expired –Issuing a parking ticket if the car’s time has expired