1. Match$each$of$the$three$relationships$on$the$left$to$one$terminology$on$the$right:$ HASCA$ Inheritance$ e.g.,$a$library$has$a$book$

Size: px
Start display at page:

Download "1. Match$each$of$the$three$relationships$on$the$left$to$one$terminology$on$the$right:$ HASCA$ Inheritance$ e.g.,$a$library$has$a$book$"

Transcription

1 COSC121:ReviewExercisesonInheritanceandInterfaces 1. Matcheachofthethreerelationshipsonthelefttooneterminologyontheright: HASCA Inheritance e.g.,alibraryhasabook ISCA Aggregation e.g.,acarisavehicle USESCA Dependency e.g.,adogusesascanner 2. Whataresomeofthebenefitsofsoftwarereuse?Listatleastonethatrelatestothe organizationofyourprogram,andonethatrelatestothemaintenanceofyourprogram. 3. Whyaretheconstructormethodsinaparentclassnotinheritedbyachildclass? 4. Inthefollowingexample,listallthreeISCArelationshipsdefined: public class Mammal { } public class Bird extends Mammal { } public class Penguin extends Bird { } 5. WhatproblemarisesifmultipleinheritancewereallowedinJava?Giveanexampleto illustratethissituation. 6. Whatissomethingyoucandobyextendingaclassthatyoucannotdobyimportingit instead? 7. Whatistherootclassofeveryclasshierarchy? 8. SupposeyoudefinedaDogclassandcreatedtwoDogobjects.Whatcriteriashouldbe usedtodetermineifthetwodogobjectsareequalornot? 9. Ifyouweretodefinetheequal()methodfromQuestion8,inwhichclasswouldyou needtodefineit? 10. Definetheequal()methodyousuggestedinQuestion8.

2 COSC121:ReviewExercisesonInheritanceandInterfaces 11. Fillintheblanksusingthefollowingdiagram: a. ClassAisa ofclassc. b. ClassBisa ofclassc. c. ClassEisa ofclassa. d. ClassDisa ofclassb. e. ClassAisa ofclassd. 12. Drawtheinheritancediagramforthefollowingclasses:Reading,Newspaper,Novel, Textbook. 13. BasedonyourdiagramfromQuestion12,whichclass(es)maymakesensetobedefined asanabstractclass?why? 14. Whenwedefineamethodinsideaclass,howisanabstractmethoddifferentfromanonC abstractmethod? 15. Listthedifferencesbetweenoverridingandoverloading. Overriding: Overloading: 16. Listthedifferencesbetweeninheritanceandinterfaces. Inheritance: Interfaces:

3 COSC121:ReviewExercisesonInheritanceandInterfaces 17. Listthedifferencesbetweenabstractclassesandinterfaces. Abstractclasses: Interfaces: 18. Trueorfalse? a. ImplementinginterfacesisgoodobjectCorientedprogrammingpractice. b. Anyclasscanextendfromanyotherclass. c. Aparentclassisthesameasasuperclass,andachildclassisthesameasa subclass. d. Achildclassmaydefineamethodwiththesamenameasamethodintheparent class. e. Achildclasscanoverridetheconstructoroftheparentclass. f. Achildclasscannotoverrideafinalmethodoftheparentclass. g. Itisconsideredpoordesignwhenachildclassoverridesamethodfromtheparent class. h. Achildclassmaydefineanattributewiththesamenameasanattributeinthe parentclass. i. Toreferenceaparentmethod,thechildclasscanusesuper()ifitisthe constructormethoditwantstocall,orsuper.methodname()ifitisanyother methoditwantstocall. j. Toreferenceaparentattribute,thechildclasscanusesuper.attributeName directly. k. Overloadingisthesameasoverriding. l. ClassesYandZarechildrenofX,andclassesAandBarechildrenofY.IfA,B,Y, andzallhavethesameattributevar1,thenvar1shouldbedeclaredinxand inheritedintoy,z,a,andb. m. Aprivatemethodcannotbemodifiedbyasubclass.SoifIwantthismethodtobe modifiablebysubclasses,imustchangeitsvisibilitytoprotected. n. Allmethodsinanabstractclassmustbeabstract. o. Anabstractmethodcanbedefinedasfinal. p. Anabstractmethodcannotbedefinedasstatic. q. Anabstractmethodmustbehavepublicvisibility. r. Abstractmethodsareusedtodefineclassesthathavenoconstructors. s. Aclassthatinheritsfromanabstractclassmustdefinealltheinheritedabstract methods. t. Aninterfaceisaspecialtypeofclass. u. Aclasscanimplementasmanyinterfacesasitwants.

4 COSC121:ReviewExercisesonInheritanceandInterfaces v. Allmethodsinaninterfacemustbeabstract. w. Aninterfacedoesnothaveanyattributes. x. Justlikeanabstractclass,aninterfacecannotbeinstantiated. y. Aclassthatimplementsaninterfacemustdefinealltheimplementedabstract methods. z. Allthemethodsinaninterfacemustbepublic. aa. Interfacescannotbeextended. bb. ThemethodcompareTo()isaninheritedmethodavailablefromthe Comparableclass. cc. AnyclasscandefineitsowncompareTo()methodbyimplementingthe Comparableinterface.Inthatcase,thedefinitionmustfollowthesamesignature asdictatedbythecomparableinterface. dd. Usinganinterfaceisabetterchoicethanusinganabstractclasswhenyouwant otherclassestoconformtoastandardsetofmethodprotocols. ee. Usinganabstractclassisabetterchoicewhenyouwantotherclassestohavesome defaultbehavior. 19. Whenwefirstintroduceshapestochildren,therearetypicallythreeshapeswetellthem about:square,circle,andtriangle.fromthesebasicshapes,othershapesarederived. Now,considertheclassesCircleandOvalthatsharecommonattributesandmethods. Wouldyourelatethesetwoviaaninheritancerelationshiporaninterfacerelationship? Why? 20. Imagineagameinwhichplayerscanattackotherplayers gameelements,suchasboxes, mirrors,balloons,etc.eachtypeofgameelementbelongstoadifferentclass.forexample, thereisaboxclass,whereaseriesofboxobjectscanbecreated;thereisamirror class,etc.,thereisaballoonclass,etc. Whatthesegameelementshaveincommonisthattheyallhaveabreak()methodthat explainswhataplayerneedstodoinorderforthegameelementtobreak.theyalsoall haveaisbroken()methodthatreturnsabooleandependingonwhethertheelementis intactorbrokenatthetime. Shouldthegameelementclasses,Box,Mirror,Balloon,berelatedviainheritanceor interface?why? 21. ContinuingwithQuestion20.Supposebreak()andisBroken()areabstractmethods initiallydefinedinbreakable.assumingitonlyhasthesetwomethods,define Breakablefully.

5 COSC121:ReviewExercisesonInheritanceandInterfaces 22. ConsiderthesuperclassSquareandthesubclassRectangle.TheSquareclasshas attributesnumsidesandlength,aswellasthefollowingmethods: calcperimeter(),whichreturnsadoublebasedonthestandarddefinitionofthe perimeterofasquare calcarea(),whichreturnsadoublebasedonthestandarddefinitionoftheareaof asquare isbiggerthan(),whichreturnsabooleanthatindicatesiftheobjectitselfisbigger inareathananinputsquareobject IfyouhadtodefinetheRectangleclass: a. Whatattributeswillithave? b. Whatmethodswillithave? c. Whatwillbethevisibilityforeach? d. Whichinheritedmethodwillyouoverride? Practicebydefiningbothclassesfully.

CS 403/503 Exam 4 Spring 2017 Name

CS 403/503 Exam 4 Spring 2017 Name CS 403/503 Exam 4 Spring 2017 Name CS 403 Score is based on your best 8 out of 10 problems. CS 503 Score is based on your best 9 out of 10 problems. Extra credit will be awarded if you can solve additional

More information

fohgp siejt karbl mcqdn

fohgp siejt karbl mcqdn CS 403/503 Exam 4 Spring 2017 Solution CS 403 Score is based on your best 8 out of 10 problems. CS 503 Score is based on your best 9 out of 10 problems. Extra credit will be awarded if you can solve additional

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Introduction to Object-Oriented Programming Review 2: Object-Oriented Programming Christopher Simpkins chris.simpkins@gatech.edu CS 1331 (Georgia Tech) Review 2: Object-Oriented Programming 1 / 14 Topics

More information

Java Inheritance. Written by John Bell for CS 342, Spring Based on chapter 6 of Learning Java by Niemeyer & Leuck, and other sources.

Java Inheritance. Written by John Bell for CS 342, Spring Based on chapter 6 of Learning Java by Niemeyer & Leuck, and other sources. Java Inheritance Written by John Bell for CS 342, Spring 2018 Based on chapter 6 of Learning Java by Niemeyer & Leuck, and other sources. Review Which of the following is true? A. Java classes may either

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1 Version 1 1. (25 Points) Given that a frame is formatted as follows: And given that a datagram is formatted as follows: And given that a TCP segment is formatted as follows: Assuming no options are present

More information

Polymorphism. Arizona State University 1

Polymorphism. Arizona State University 1 Polymorphism CSE100 Principles of Programming with C++, Fall 2018 (based off Chapter 15 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

COSC 320 Exam 2 Key Spring Part 1: Hash Functions

COSC 320 Exam 2 Key Spring Part 1: Hash Functions COSC 320 Exam 2 Key Spring 2011 Part 1: Hash s 1. (5 Points) Create the templated function object lessthan, you may assume that the templated data type T has overloaded the < operator. template

More information

Math 96--Radicals #1-- Simplify; Combine--page 1

Math 96--Radicals #1-- Simplify; Combine--page 1 Simplify; Combine--page 1 Part A Number Systems a. Whole Numbers = {0, 1, 2, 3,...} b. Integers = whole numbers and their opposites = {..., 3, 2, 1, 0, 1, 2, 3,...} c. Rational Numbers = quotient of integers

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Division of Mathematics and Computer Science Maryville College Outline Inheritance 1 Inheritance 2 3 Outline Inheritance 1 Inheritance 2 3 The "is-a" Relationship The "is-a" Relationship Object classification

More information

AP CS Unit 6: Inheritance Notes

AP CS Unit 6: Inheritance Notes AP CS Unit 6: Inheritance Notes Inheritance is an important feature of object-oriented languages. It allows the designer to create a new class based on another class. The new class inherits everything

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Division of Mathematics and Computer Science Maryville College Outline Inheritance 1 Inheritance 2 3 Outline Inheritance 1 Inheritance 2 3 The "is-a" Relationship Object classification is typically hierarchical.

More information

Results. Survey Quick statistics Survey 'DC 2016 Issue Survey - Internet of Things'

Results. Survey Quick statistics Survey 'DC 2016 Issue Survey - Internet of Things' Results Survey 561839 Number of records in this query: 11 Total records in survey: 11 Percentage of total: 100.00% page 1 / 34 Field summary for A Defining ethical in IoT requires a multistakeholder dialogue:

More information

Getting Ready to Teach Unit 1

Getting Ready to Teach Unit 1 Getting Ready to Teach Unit Learning Path in the Common Core Standards In this unit, students study fractions and mixed numbers They find equivalent fractions, compare fractions, and add and subtract fractions

More information

Inheritance and Polymorphism. CS180 Fall 2007

Inheritance and Polymorphism. CS180 Fall 2007 Inheritance and Polymorphism CS180 Fall 2007 Definitions Inheritance object oriented way to form new classes from pre-existing ones Superclass The parent class If class is final, cannot inherit from this

More information

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1 Version 1 Instructions Write your name on the exam paper. Write your name and version number on the top of the yellow paper. Answer Question 1 on the exam paper. Answer Questions 2-4 on the yellow paper.

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1 Version 1 1. (20 Points) Given the class A network address 117.0.0.0 will be divided into multiple subnets. a. (5 Points) How many bits will be necessary to address 4,000 subnets? b. (5 Points) What is

More information

Lesson 24: Matrix Notation Encompasses New Transformations!

Lesson 24: Matrix Notation Encompasses New Transformations! Classwork Example 1 Determine the following: a. 1 0 0 1 3 b. 1 0 7 0 1 1 c. 1 0 3 5 0 1 1 d. 1 0 3 1 0 1 7 6 e. 9 1 0 1 3 1 0 1 f. 1 0 cc aa 0 1 bb dd xx yy 0 g. 1 zz ww 0 1 Date: 1/5/15 S.14 Example Can

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Inheritance. Transitivity

Inheritance. Transitivity Inheritance Classes can be organized in a hierarchical structure based on the concept of inheritance Inheritance The property that instances of a sub-class can access both data and behavior associated

More information

OVERRIDING. 7/11/2015 Budditha Hettige 82

OVERRIDING. 7/11/2015 Budditha Hettige 82 OVERRIDING 7/11/2015 (budditha@yahoo.com) 82 What is Overriding Is a language feature Allows a subclass or child class to provide a specific implementation of a method that is already provided by one of

More information

Lesson 12: Angles Associated with Parallel Lines

Lesson 12: Angles Associated with Parallel Lines Lesson 12 Lesson 12: Angles Associated with Parallel Lines Classwork Exploratory Challenge 1 In the figure below, LL 1 is not parallel to LL 2, and mm is a transversal. Use a protractor to measure angles

More information

2-Type Fire Retardant Closures

2-Type Fire Retardant Closures 2-Type Fire Retardant Closures 2-Type Closures that can really take the heat. The 2-Type Fire Retardant Closure is completely self-contained and capable of withstanding a 15 minute horizontal or vertical

More information

Queues. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST

Queues. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST Queues Kuan-Yu Chen ( 陳冠宇 ) 2018/10/03 @ TR-212, NTUST Review Stack FILO Algorithms to covert Infix to Postfix Infix to Prefix Queue FIFO 2 Homeork1: Expression Convertor. Given a infix expression, please

More information

Abstract classes const member functions const arguments to a function Function overloading and overriding

Abstract classes const member functions const arguments to a function Function overloading and overriding Lecture-4 Inheritance review. Polymorphism Virtual functions Abstract classes const member functions const arguments to a function Function overloading and overriding W3101: Programming Languages C++ Inheritance

More information

Accessibility (1A) Young Won Lim 8/22/13

Accessibility (1A) Young Won Lim 8/22/13 Accessibility (1A) Copyright (c) 2011-2013 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any

More information

Inheritance and object compatibility

Inheritance and object compatibility Inheritance and object compatibility Object type compatibility An instance of a subclass can be used instead of an instance of the superclass, but not the other way around Examples: reference/pointer can

More information

14K Mixable Rings 1/ 2 ctw, $1499. Silver Diamond Pendant 1/6 ctw, $299

14K Mixable Rings 1/ 2 ctw, $1499. Silver Diamond Pendant 1/6 ctw, $299 1k 14K D.B.T.Y. 1/4 ctw, 1/2 ctw, $499 3/4 ctw, 9 1 ctw, 9 1m 1a 14K Mixable Rings 1/ 2 ctw, $1499 1h 14K Two Tone 1/5 ctw, $549 1/2 ctw, $1299 Triple Strand 1/4 ctw 14K Triple Strand 3/4 ctw 9 1c 14K

More information

Passing arguments to functions by. const member functions const arguments to a function. Function overloading and overriding Templates

Passing arguments to functions by. const member functions const arguments to a function. Function overloading and overriding Templates Lecture-4 Inheritance review. Polymorphism Virtual functions Abstract classes Passing arguments to functions by Value, pointers, refrence const member functions const arguments to a function Function overloading

More information

CPE 448 Exam #2 (50 pts) April Name Class: 448

CPE 448 Exam #2 (50 pts) April Name Class: 448 Name Class: 448 1) (5 pts) Draw the three way handshake used to establish a TCP connection. Show all SYN and ACK packets. Also show all sequence and acknowledgement numbers associated with the SYN and

More information

Object Orientated Programming Details COMP360

Object Orientated Programming Details COMP360 Object Orientated Programming Details COMP360 The ancestor of every action is a thought. Ralph Waldo Emerson Three Pillars of OO Programming Inheritance Encapsulation Polymorphism Inheritance Inheritance

More information

CS 403/503 Exam 4 Spring 2015 Solution

CS 403/503 Exam 4 Spring 2015 Solution CS 403/503 Exam 4 Spring 2015 Solution Each problem initially scored out of 10 points possible. CS 403 Best 5 answers doubled. (5*20 + 2*10 = 120 possible) CS 503 Best 4 answers doubled. (4*20 + 3*10 =

More information

Macro O Compensate a single cartridge ActiveEdge tool

Macro O Compensate a single cartridge ActiveEdge tool Macro O8504 - Compensate a single cartridge ActiveEdge tool Compensates an ActiveEdge tool with one AE cartridge by a specific micron amount on diameter. The unique Tool ID and compensation value are encoded

More information

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation SEEM4570 System Design and Implementation Lecture 11 From Design to Implementation Introduction We learned programming and we learned UML, but separately. Now, the question is how can we translate a design

More information

Object Oriented Issues in VDM++

Object Oriented Issues in VDM++ Object Oriented Issues in VDM++ Nick Battle, Fujitsu UK (nick.battle@uk.fujitsu.com) Background VDMJ implemented VDM-SL first (started late 2007) Formally defined. Very few semantic problems VDM++ support

More information

Instance Members and Static Members

Instance Members and Static Members Instance Members and Static Members You may notice that all the members are declared w/o static. These members belong to some specific object. They are called instance members. This implies that these

More information

HIM a. LCD error is present and there IS an ABN for the services: a. HIM will add the GA modifier b. Select Refresh Claim

HIM a. LCD error is present and there IS an ABN for the services: a. HIM will add the GA modifier b. Select Refresh Claim The Physician Order Addendum Workflow will be completed by PFS and HIM. The exception is AIC and CTC. When the error is for a patient located at AIC or CTC, please contact Barb Hartman (CTC) or Kirstin

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Winter 2017 Lecture 10a Andrew Tolmach Portland State University 1994-2017 Object-oriented Programming Programs are structured in terms of objects: collections of variables

More information

Complete, Correct, Inter-connected and Current: Making the most of better data in Pure. Thomas Gurney Product Manager, Data Models Oct, 2018

Complete, Correct, Inter-connected and Current: Making the most of better data in Pure. Thomas Gurney Product Manager, Data Models Oct, 2018 0 Complete, Correct, Inter-connected and Current: Making the most of better data in Pure. Thomas Gurney Product Manager, Data Models Oct, 2018 1 Section 1 Introduction 2 Pure Pure is, and remains, a product

More information

Teacher Assignment and Transfer Program (TATP) On-line Teacher Application Quick Sheets

Teacher Assignment and Transfer Program (TATP) On-line Teacher Application Quick Sheets Teacher Assignment and Transfer Program (TATP) On-line Teacher Application Quick Sheets February 2018 On-line Teacher Application Process Teachers interested in applying for any advertised vacancies in

More information

Mobile Application Programming. Swift Classes

Mobile Application Programming. Swift Classes Mobile Application Programming Swift Classes Swift Top-Level Entities Like C/C++ but unlike Java, Swift allows declarations of functions, variables, and constants at the top-level, outside any class declaration

More information

4. Specifications and Additional Information

4. Specifications and Additional Information 4. Specifications and Additional Information AGX52004-1.0 8B/10B Code This section provides information about the data and control codes for Arria GX devices. Code Notation The 8B/10B data and control

More information

Unified Modeling Language (UML) Class Diagram

Unified Modeling Language (UML) Class Diagram 1 / 10 Unified Modeling Language (UML) Class Diagram Miaoqing Huang University of Arkansas Spring 2010 2 / 10 Outline 1 2 3 / 10 Class Diagram Class diagrams show the static structure of the classes that

More information

Programming Using C# QUEEN S UNIVERSITY BELFAST. Practical Week 7

Programming Using C# QUEEN S UNIVERSITY BELFAST. Practical Week 7 Programming Using C# QUEEN S UNIVERSITY BELFAST Practical Week 7 Table of Contents PRACTICAL 7... 2 EXERCISE 1... 2 TASK 1: Zoo Park (Without Inheritance)... 2 TASK 2: Zoo Park with Inheritance... 5 TASK

More information

COMP 110/L Lecture 19. Kyle Dewey

COMP 110/L Lecture 19. Kyle Dewey COMP 110/L Lecture 19 Kyle Dewey Outline Inheritance extends super Method overriding Automatically-generated constructors Inheritance Recap -We talked about object-oriented programming being about objects

More information

New York University Computer Science Department Courant Institute of Mathematical Sciences

New York University Computer Science Department Courant Institute of Mathematical Sciences New York University Computer Science Department Courant Institute of Mathematical Sciences Course Title: Data Communication & Networks Course Number: g22.2662-001 Instructor: Jean-Claude Franchitti Session:

More information

Overriding Variables: Shadowing

Overriding Variables: Shadowing Overriding Variables: Shadowing We can override methods, can we override instance variables too? Answer: Yes, it is possible, but not recommended Overriding an instance variable is called shadowing, because

More information

Teacher Assignment and Transfer Program (TATP) On-Line Application Quick Sheets

Teacher Assignment and Transfer Program (TATP) On-Line Application Quick Sheets Teacher Assignment and Transfer Program (TATP) On-Line Application Quick Sheets On-Line Application The on-line application process is being piloted for teachers applying for advertised teaching positions

More information

Stacks & Queues. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST

Stacks & Queues. Kuan-Yu Chen ( 陳冠宇 ) TR-212, NTUST Stacks & Queues Kuan-Yu Chen ( 陳冠宇 ) 2018/10/01 @ TR-212, NTUST Review Stack Stack Permutation Expression Infix Prefix Postfix 2 Stacks. A stack is an ordered list in which insertions and deletions are

More information

Exploring Translations

Exploring Translations Exploring Translations 1. New Sketch: To open a new sketch go to FILE and click on New Sketch 2. Create a triangle. a. Using the SEGMENT tool, construct a triangle. b. Drag the cursor and release for each

More information

CS/ENGRD 2110 FALL Lecture 7: Interfaces and Abstract Classes

CS/ENGRD 2110 FALL Lecture 7: Interfaces and Abstract Classes 1 CS/ENGRD 2110 FALL 2016 Lecture 7: Interfaces and Abstract Classes http://courses.cs.cornell.edu/cs2110 Announcements 2 Attendance for this week s recitation is mandatory! A2 is due Today Get started

More information

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1 Version 1 Instructions 1. Write your name and version number on the top of the yellow paper and the routing tables sheet. 2. Answer Question 2 on the routing tables sheet. 3. Answer Questions 1, 3, 4,

More information

Application Brief. Using the Total Phase CAN/I2C Activity Board Pro as an I2C- to- CAN Translator Application Brief by Rick Bogart

Application Brief. Using the Total Phase CAN/I2C Activity Board Pro as an I2C- to- CAN Translator Application Brief by Rick Bogart Using the Total Phase CAN/I2C Activity Board Pro as an I2C- to- CAN Translator Application Brief by Rick Bogart Introduction A customer request came in asking if we had a CAN to I2C translator. My first

More information

Type Hierarchy. Lecture 6: OOP, autumn 2003

Type Hierarchy. Lecture 6: OOP, autumn 2003 Type Hierarchy Lecture 6: OOP, autumn 2003 The idea Many types have common behavior => type families share common behavior organized into a hierarchy Most common on the top - supertypes Most specific at

More information

Production System. Logical Reasoning System 1

Production System. Logical Reasoning System 1 Production System Invented in 1943 by Post Used as the basis for many rule-based expert systems Production System consists of 3 components: Rules An unordered set of user-defined "if-then" rules of the

More information

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1 Version 1 1. (20 Points) Given the class A network address 121.0.0.0 will be divided into multiple subnets. a. (5 Points) How many bits will be necessary to address 8,100 subnets? b. (5 Points) What is

More information

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

Object-oriented basics. Object Class vs object Inheritance Overloading Interface Object-oriented basics Object Class vs object Inheritance Overloading Interface 1 The object concept Object Encapsulation abstraction Entity with state and behaviour state -> variables behaviour -> methods

More information

CMSC 330, Fall 2013, Practice Problems 3

CMSC 330, Fall 2013, Practice Problems 3 CMSC 330, Fall 2013, Practice Problems 3 1. OCaml and Functional Programming a. Define functional programming b. Define imperative programming c. Define higher-order functions d. Describe the relationship

More information

Overriding המחלקה למדעי המחשב עזאם מרעי אוניברסיטת בן-גוריון

Overriding המחלקה למדעי המחשב עזאם מרעי אוניברסיטת בן-גוריון Overriding עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון 2 Roadmap A method in a child class overrides a method in the parent class if it has the same name and type signature: Parent void method(int,float)

More information

Object-based representation. Objects

Object-based representation. Objects Object-based representation Luger, Part III, 6.0, 6.1, 6.2.2-6.2.4, 6.4 (skim) Objects Two basic forms of Structured Objects Semantic Nets Frames Semantic Nets (Associative Nets) Components Nodes - represent

More information

ENEE 457: Computer Systems Security 8/27/18. Lecture 1 Introduction to Computer Systems Security

ENEE 457: Computer Systems Security 8/27/18. Lecture 1 Introduction to Computer Systems Security ENEE 457: Computer Systems Security 8/27/18 Lecture 1 Introduction to Computer Systems Security Charalampos (Babis) Papamanthou Department of Electrical and Computer Engineering University of Maryland,

More information

Lesson 11.1 Dilations

Lesson 11.1 Dilations Lesson 11.1 Dilations Key concepts: Scale Factor Center of Dilation Similarity A A dilation changes the size of a figure. B C Pre Image: 1 A A' B C Pre Image: B' C' Image: What does a dilation NOT change?

More information

To complete this workbook, you will need the following file:

To complete this workbook, you will need the following file: CHAPTER 1 Excel More Skills 12 Use Range Names in Formulas In Excel, a name is a word that represents a cell or a range of cells that can be used as a cell or range reference. Names used in formulas and

More information

Function Overloading and Overriding this keyword static members inline functions Passing arguments by values and reference

Function Overloading and Overriding this keyword static members inline functions Passing arguments by values and reference Lecture-4 Inheritance review. Polymorphism review Virtual functions Abstract classes Miscellaneous Topics Function Overloading and Overriding this keyword static members inline functions Passing arguments

More information

CMSC 2833 Lecture Memory Organization and Addressing

CMSC 2833 Lecture Memory Organization and Addressing Computer memory consists of a linear array of addressable storage cells that are similar to registers. Memory can be byte-addressable, or word-addressable, where a word typically consists of two or more

More information

COMP 110/L Lecture 20. Kyle Dewey

COMP 110/L Lecture 20. Kyle Dewey COMP 110/L Lecture 20 Kyle Dewey Outline super in methods abstract Classes and Methods Polymorphism super in Methods Recap You ve seen super in constructors... Recap You ve seen super in constructors...

More information

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs. Local Variable Initialization Unlike instance vars, local vars must be initialized before they can be used. Eg. void mymethod() { int foo = 42; int bar; bar = bar + 1; //compile error bar = 99; bar = bar

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract

More information

C++ Basic Syntax. Wojciech Frohmberg / OOP Laboratory. Poznan University of Technology. Fields and methods

C++ Basic Syntax. Wojciech Frohmberg / OOP Laboratory. Poznan University of Technology. Fields and methods and methods 1 1 Department of Computer Science Poznan University of Technology 2012.10.07 / OOP Laboratory and methods Outline 1 and methods Accessibility modifiers Class fields Outline and methods 1 and

More information

Lab 3. Getting Started with Outlook 2007 (Chapter 2) CS131 Software for Personal Computing Estimated Time: 1 2 hours

Lab 3. Getting Started with Outlook 2007 (Chapter 2) CS131 Software for Personal Computing Estimated Time: 1 2 hours Lab 3 Getting Started with Outlook 2007 (Chapter 2) CS131 Software for Personal Computing Estimated Time: 1 2 hours Notes: 1. If you are using a University computer, you will need to complete this lab

More information

Translation to Relational Schema

Translation to Relational Schema Translation to Relational Schema Agenda this Week Translation of the Entity Relationship Diagram into a Relational Schema Understanding the Stable Translation method Understanding the concept of Foreign

More information

Programming in C# Inheritance and Polymorphism

Programming in C# Inheritance and Polymorphism Programming in C# Inheritance and Polymorphism C# Classes Classes are used to accomplish: Modularity: Scope for global (static) methods Blueprints for generating objects or instances: Per instance data

More information

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1 Version 1 1. (24 Points) Show the routing tables for routers A, B, C, and D. Make sure you account for traffic to the Internet. NOTE: Router E should only be used for Internet traffic. Router A Router

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 Today CS 520 Theory and Practice of Software Engineering Fall 2018 Object Oriented (OO) Design Principles September 13, 2018 Code review and (re)design of an MVC application (and encapsulation) Polymorphism

More information

Relationships Between Real Things CSE 143. Common Relationship Patterns. Employee. Supervisor

Relationships Between Real Things CSE 143. Common Relationship Patterns. Employee. Supervisor CSE 143 Object & Class Relationships Inheritance Reading: Ch. 9, 14 Relationships Between Real Things Man walks dog Dog strains at leash Dog wears collar Man wears hat Girl feeds dog Girl watches dog Dog

More information

public UndergradStudent(String n, String m, String p) { programme = p; super(n, m);

public UndergradStudent(String n, String m, String p) { programme = p; super(n, m); Tutorial 3: Inheritance Part A Topic: Inheritance 1. Consider the following class definition. class Student { private String name; private String matric_no; a. Write the definition of an empty class named

More information

(c) ((!(a && b)) == (!a!b)) TRUE / FALSE. (f) ((!(a b)) == (!a &&!b)) TRUE / FALSE. (g) (!(!a) && (c-d > 0) && (b!b))

(c) ((!(a && b)) == (!a!b)) TRUE / FALSE. (f) ((!(a b)) == (!a &&!b)) TRUE / FALSE. (g) (!(!a) && (c-d > 0) && (b!b)) ComS 207: Programming I Midterm 2, Tue. Mar 21, 2006 Student Name: Student ID Number: Recitation Section: 1. True/False Questions (10 x 1p each = 10p) Determine the value of each boolean expression given

More information

COMP 110/L Lecture 24. Kyle Dewey

COMP 110/L Lecture 24. Kyle Dewey COMP 110/L Lecture 24 Kyle Dewey Outline this instanceof Casting equals() protected interface this this Refers to whatever instance the given instance method is called on. this Refers to whatever instance

More information

Pointer Analysis. Outline. Points-to Analysis as a Graph Problem. Points-to Analysis as a Graph Problem. Points-to Analysis as a Graph Problem

Pointer Analysis. Outline. Points-to Analysis as a Graph Problem. Points-to Analysis as a Graph Problem. Points-to Analysis as a Graph Problem Pointer Analysis,,,, Rupesh Nasre. b { } CS6843 Program Analysis IIT Madras Jan 2014 4 Outline Introduction Pointer analysis as a DFA problem Design decisions,,,, Andersen's analysis, Steensgaard's analysis

More information

Relationships Between Real Things. CSE 143 Java. Common Relationship Patterns. Composition: "has a" CSE143 Sp Student.

Relationships Between Real Things. CSE 143 Java. Common Relationship Patterns. Composition: has a CSE143 Sp Student. CSE 143 Java Object & Class Relationships Inheritance Reading: Ch. 9, 14 Relationships Between Real Things Man walks dog Dog strains at leash Dog wears collar Man wears hat Girl feeds dog Girl watches

More information

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner. HAS-A Relationship Association is a relationship where all objects have their own lifecycle and there is no owner. For example, teacher student Aggregation is a specialized form of association where all

More information

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1 Version 1 1. (20 Points) Given the class A network address 119.0.0.0 will be divided into a maximum of 15,900 subnets. a. (5 Points) How many bits will be necessary to address the 15,900 subnets? b. (5

More information

Section 8: Monomials and Radicals

Section 8: Monomials and Radicals In this section, we are going to learn skills for: NGSS Standards MA.912.A.4.1 Simplify monomials and monomial expressions using the laws of integral exponents. MA.912.A.6.1 Simplify radical expressions.

More information

STATIC, ABSTRACT, AND INTERFACE

STATIC, ABSTRACT, AND INTERFACE STATIC, ABSTRACT, AND INTERFACE Thirapon Wongsaardsakul STATIC When variable is a static type, java allocates memory for it at loading time. Class loader Byte code verifier Static variable has been loaded

More information

Relationships Between Real Things CSC 143. Common Relationship Patterns. Composition: "has a" CSC Employee. Supervisor

Relationships Between Real Things CSC 143. Common Relationship Patterns. Composition: has a CSC Employee. Supervisor CSC 143 Object & Class Relationships Inheritance Reading: Ch. 10, 11 Relationships Between Real Things Man walks dog Dog strains at leash Dog wears collar Man wears hat Girl feeds dog Girl watches dog

More information

Sorting. Sorting. Selection sort

Sorting. Sorting. Selection sort Sorting 1 Sorting Given a linear list of comparable objects of the same class (or values of the same type), we wish to sort (or reärrange) the objects in the increasing order. For simplicity, let s just

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract

More information

Graphs and Linear Functions

Graphs and Linear Functions Graphs and Linear Functions A -dimensional graph is a visual representation of a relationship between two variables given by an equation or an inequality. Graphs help us solve algebraic problems by analysing

More information

Need to store a list of shapes, each of which could be a circle, rectangle, or triangle

Need to store a list of shapes, each of which could be a circle, rectangle, or triangle CS112-2012S-23 Abstract Classes and Interfaces 1 23-0: Drawing Example Creating a drawing program Allow user to draw triangles, circles, rectanlges, move them around, etc. Need to store a list of shapes,

More information

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE PART A UNIT I 1. Differentiate object oriented programming from procedure oriented programming. 2. Define abstraction and encapsulation. 3. Differentiate

More information

Full file at https://fratstock.eu. Linear Programming Models: Graphical and Computer Methods

Full file at https://fratstock.eu. Linear Programming Models: Graphical and Computer Methods Chapter 2: Linear Programming Models: Graphical and Computer Methods Multiple Choice 1. Consider the following linear programming model: Max X 1 2 + X 2 + 3X 3 X 1 + X 2 3 X 1 + X 2 1 This problem violates

More information

Basics of Java Programming CS129 LTPC:

Basics of Java Programming CS129 LTPC: Basics of Java Programming CS9 LTPC: -0-4-3 Instructor: Gauravkumarsingh Gaharwar Program: Masters of Science(IT) Class-Semester: FYMSc(IT) (Sem-II) Email: gauravsinghg@nuv.ac.in Phone Number: 065-30000(0)

More information

Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון 22 Roadmap In this chapter we will examine how differences in static and dynamic features effect object-oriented programming

More information

MODBUS Network Communication

MODBUS Network Communication MODBUS Network Communication The IP3416 and IP99 use the MODBUS protocol, originally standardized by Modicon and is used widely in the PLC industry. For instance, many graphic interface packages available

More information

Haplotype Analysis. 02 November 2003 Mendel Short IGES Slide 1

Haplotype Analysis. 02 November 2003 Mendel Short IGES Slide 1 Haplotype Analysis Specifies the genetic information descending through a pedigree Useful visualization of the gene flow through a pedigree A haplotype for a given individual and set of loci is defined

More information

Midterm Exam (REGULAR SECTION)

Midterm Exam (REGULAR SECTION) Data Structures (CS 102), Professor Yap Fall 2014 Midterm Exam (REGULAR SECTION) October 28, 2014 Midterm Exam Instructions MY NAME:... MY NYU ID:... MY EMAIL:... Please read carefully: 0. Do all questions.

More information

American River 641 Norseman Dr, Modesto, CA Royal 559 Skimmers. Sunday, June 24

American River 641 Norseman Dr, Modesto, CA Royal 559 Skimmers. Sunday, June 24 10 & Under Mixed 4 Teams Entered; Zone has 4 allocated slots (4 Championship) Games are 5 minute quarters. All games go to shootout if tied at end of regulation. Davis Johansen HS American River 641 Norseman

More information

Full file at Chapter 2 - Inheritance and Exception Handling

Full file at   Chapter 2 - Inheritance and Exception Handling Chapter 2 - Inheritance and Exception Handling TRUE/FALSE 1. The superclass inherits all its properties from the subclass. ANS: F PTS: 1 REF: 76 2. Private members of a superclass can be accessed by a

More information

Software Engineering

Software Engineering Software Engineering CSC 331/631 - Spring 2018 Object-Oriented Design Principles Paul Pauca April 10 Design Principles DP1. Identify aspects of the application that vary and separate them from what stays

More information