Polymorphism by Brown University Computer Science Department 67

Size: px
Start display at page:

Download "Polymorphism by Brown University Computer Science Department 67"

Transcription

1 5 Polymorphism Polymorphism, the ability of subclasses to respond differently to the same messages, is perhaps the most important part of object-oriented programming. Polymorphism models something quite important about the real world, namely that different things behave differently, even when abstractly engaging in the same activity. As an example, ask any number of people to do some task, chances are no two of them will do it in the exact same way! Inheritance allows us to take advantage of polymorphism because different subclasses can respond to the same message in different ways. In fact, an abstract method states that subclasses must exploit polymorphism because they have to define all the abstract methods. From a modeling perspective, an abstract method says that certain kinds of objects must be able to respond to certain kinds of messages, but it says nothing about how the objects will respond. As we said in the last chapter, the superclass sets a policy to be implemented by its subclasses. For example, Chapter 4 discussed different types of Animals. A Lion eats by killing Gazelles, but a Cow would eat by grazing. However, since a Cow and a Lion are Animals, we know that they both have the ability to eat. Polymorphism takes advantage of the fact that different subclasses of the same superclasses have the same capabilities (i.e., provide the same methods), even though the subclasses implement their methods differently. Another way to exploit polymorphism in our models is by noting that any instance of a subclass is also effectively an instance of its superclass. For example, an instance of the Lion class is also an instance of the Mammal class and of the Animal class. An instance of a subclass has at least all of the properties and can respond to all the same messages as an instance of a superclass. Thus, any place we expect an instance of a particular class, we can also use an instance of a subclass. A variable of the superclass type can represent many (poly) forms (morph) because it can have instances of its own type and those of its subclasses as its value this is where the term polymorphism comes from. We will use polymorphism extensively throughout CS15. All this probably sounds pretty abstract to you; the mechanics below will make it easier. 67

2 68 Chapter 5 Polymorphism MECHANICS In Chapter 4, we defined two specific types of Animal: a Herbivore and a Carnivore. We then got even more specific and defined a concrete subclass of Carnivore a Lion class which eats Gazelles. In this chapter, we will start by figuring out how to make our Lion eat all types of prey. We will also define a class to represent a meal in the jungle. Finally, we will show how each method is actually invoked in response to the messages sent when the animals eat their meal. Our old Lion class had a _prey instance variable of type Gazelle. This means that the Lion could only eat Gazelles. If we re modeling the jungle, we can t assume that there are always Gazelles to be found. So instead, let s start our Lion off with a FieldMouse as its prey, since there are plenty of those around. 1 public class Lion extends Carnivore { private Animal _prey; //can hold an instance of any subclass public Lion(){ super(); _prey = new FieldMouse(); // something in abundant supply _prey.die(); public void killprey(){ _prey = new Gazelle(); _prey.die(); public Leftovers eatprey(){ return _prey.asleftovers(); The constructor is basically the same as last time, except we initialized _prey to be an instance of FieldMouse instead of a Gazelle. In fact, we see that _prey appears twice on the left side of the assignment operator within this Lion code, once getting an instance of a FieldMouse and once getting an instance of a Gazelle. This is exactly what we mean by polymorphism one instance variable can hold different types of instances at different times, as long as they are subclasses of the same superclass that is the type of the instance variable. Since we declared it to be of type Animal, we can only send it messages to which an Animal would be able to respond. However, it 1. What would be really nice is to have killprey take a parameter, the prey. But since the only method that uses killprey is the eat method in Animal, that abstract method would have to take a parameter. Deciding the polymorphic type for that parameter so that both Carnivore and Herbivore can eat in an appropriate fashion complicates the example considerably, and hence we don t show that.

3 Mechanics 69 really will hold instances of subclasses, which will respond to each message as defined in the subclass. Because Animal is abstract (as we mentioned last chapter), it cannot be instantiated and therefore cannot directly be a value for _prey. Now let s look at the eatprey method, which returns the _prey, converted into Leftovers by using a method called asleftovers. In order for this to be possible, we must modify the Animal superclass to support the method asleftovers, and then redefine it in subclasses to return an appropriate subclass of Leftovers. In fact, this sort of refinement is common when programming; we did not think about how we would get leftovers when we were creating the first pass of the Animal class. Now that we have filled in more detail in our model, we can see that all animals may be prey to another species. Since the asleftovers method will be abstract (what are the leftovers of a generic animal?), we will leave it as an exercise to add its declaration to the Animal superclass and its definition to the Lion class. However, let s look at a definition for the Gazelle class to see how the details work: public class Gazelle extends Herbivore { public Gazelle(){ super(); public Leftovers eatplants(){ return new GrassLeftovers(); //GrassLeftovers is subclass //of Leftovers public Leftovers asleftovers(){ return new GazelleLeftovers(); //GazelleLeftovers is //subclass of Leftovers The asleftovers method is used when a carnivore eats this gazelle. In the carnivore s eatprey method, it needs to call the asleftovers method of its prey. This way the prey changes from being represented as an Animal to being represented as Leftovers and can be used for methods which require Leftovers (such as the simulatemeal method we will see in a few pages) This is another example of polymorphism being used to simplify our method because the Animal class does not care what actual Leftovers are being produced, so long as they act like Leftovers. In fact, it would be close to impossible to redefine methods in a subclass without polymorphism because the method declarations in both classes must match. It is a compiletime error to define a method in a subclass that is exactly like the declaration in the superclass, but returns a different type of object in the body of the method. In this case, all the asleftovers method does is return a new object that represents a Gazelle as Leftovers. In fact, this is a naming convention we

4 70 Chapter 5 Polymorphism will use throughout these chapters. If you ever need to change an object s representation (i.e., from a Gazelle into GazelleLeftovers), the name of the method that performs this change should be asotherclass. Partial Overriding What if a superclass does some useful work in its method that a subclass does not want to replace, but instead wants to augment? In this case, the subclass must define its own method and, within this method, send a message directly to its superclass, telling it to do its work. This gives the subclass complete control over how it uses its superclass implementation. To call a superclass method from a subclass methods, we must use the Java keyword super. In this case, super works as it did in the Inheritance chapter within the constructor, except that we are now using it to call methods defined in our superclass, instead of sending a message to the current instance (which as you might remember we specified by using this). Let s look at this in code: public class CleanLion extends Lion { private LionBib _bib; public CleanLion(){ super(); _bib = new LionBib(); public Leftovers eatprey() { Leftovers waste; _bib.puton(); waste = super.eatprey(); _bib.remove(); return waste; In this example, a CleanLion eats basically the same way that a Lion does, it just wants to take some precautions first to make sure it stays clean. To do this, it puts on a bib before eating the gazelle and takes it off after it is done. In code, it does this by defining its own eatprey method (redefining the Lion s): it does its own extra work (putting on the _bib), and then forwards the message on to its superclass (eatprey the way other Lions do), and finally finishes the meal (by taking off its _bib). This technique is an effective way to avoid repeating the superclass code in each subclass (like we did in our EvilLion example last chapter). Notice that we used a local variable to hold on to the Leftovers while the CleanLion takes off its bib. Then we simply returned the Leftovers to the calling method. Although the method does not modify the Leftovers in

5 Mechanics 71 any way before returning them to the calling method, it needed to hold on to them while it completed the task of eating. Had it simply returned after calling the superclass eatprey method, it would have had no chance to take off the bib (and the other Lions might have laughed). Determining Which Method is Invoked With a complex set of classes and superclasses, it can sometimes be confusing trying to figure out how a particular instance will respond to a message. You can always figure it out, though, by looking first at the class of the instance. You should not look at the superclass, but at the actual class from which the instance was instantiated the class name after the new in an initialization statement. If you find a method with the right name there, that s the method the instance will use. If not, look next in the superclass of this class. If the superclass doesn t have a method by the right name, look in the superclass superclass, and so on, until the class definitions no longer list a superclass using extends. At that point, there is one final place to look for a suitable method. Any class that does not explicitly extend another class extends the special class Object. Where does the class Object come from? Object is a special class that all classes in Java inherently extend from even though it will never be explicitly declared. (Remember how the compiler automatically puts in a super() if you didn t call the superclass constructor yourself? This is why it works every Java class extends Object.) So before you give up trying to find out which method will be called, you can look in the class definition for Object to see if there is a method with the right name. 2 If there is, fine that method is used. If there isn t, a compile-time error has occurred because the message was not understood. Java will tell you this, and it will be up to you to figure out why the message was not understood. Perhaps the message name was simply misspelled. Perhaps the message was sent to the wrong object. In any case, your error needs to be fixed. This process of determining which method to use is called method resolution. Let s examine this process of method resolution in more detail with a more complicated example. Suppose we want to simulate our animals having a jungle meal. A jungle meal typically consists of eating one s food and leaving the leftovers as waste to pile up on the jungle floor. At that point, it may be further consumed by scavenger animals, but we will not model that possibility here. To illustrate our point, we will make a JungleMeal class that contains a number of animal instance variables. This class will construct some number of concrete subclasses to actually simulate their behavior. We will then trace how Java finds the right method to use. This type of hand simulation is 2. It is unlikely in this introductory course that you will be using any methods found in Object.

6 72 Chapter 5 Polymorphism tricky you must do it carefully and methodically to make sure code does what you want it to do. Indeed, writing polymorphic code takes practice. public class JungleMeal { private Herbivore _herb; private Carnivore _carni; private Animal _bob; private Leftovers _waste; public JungleMeal(){ _herb = new Gazelle(); _carni = new Lion(); _bob = new CleanLion(); _waste = new FieldMouse().asLeftovers(); public void simulatemeal() { _waste = _herb.eat(); this.accumulateleftovers(); _waste = _carni.eat(); this.accumulateleftovers(); _waste = _bob.eat(); this.accumulateleftovers(); _herb.sleep(); _carni.sleep(); _bob.sleep(); public void accumulateleftovers(){ _waste.pileuponjunglefloor(); In order to determine which instance s method is used, we must keep close track of each variable s actual class type. Let s look at the JungleMeal class instance variable declarations in a little more detail: Herbivore _herb; Carnivore _carni; Animal _bob; At this point, it is important to distinguish between a variable s declared type and its actual type. The declared type is the class appearing in the declaration; it determines to which methods this instance will respond. The actual type is the one used after the keyword new on the right side of an equals sign (in this case in the constructor). _herb = new Gazelle(); _carni = new Lion(); _bob = new CleanLion();

7 Mechanics 73 The declared type of an object can be the same as the actual type, or anything more general than the actual type like a superclass. Thus, even though the JungleMeal class only declares classes of type Herbivore, Carnivore, and Animal, objects of type Gazelle, Lion, and CleanLion are actually instantiated. This type of polymorphism is a powerful feature of inheritance: it lets us treat a very specific class, a CleanLion, as a more general class, an Animal. Later, we could add a new type of animal, say an elephant, and, without changing the simulatemeal method of the JungleMeal class, initialize _bob with a reference to our new Elephant class and use the its eat method. This allows your simulatemeal code to be used without modification, even with objects you did not initially plan on. In a minor way, though this limits our flexibility. If CleanLion has a method called cleanfur which is not declared in Animal, we cannot use the _bob instance variable to call _bob.cleanfur(). This is because the declaration of _bob only says that it is an Animal. We can only tell _bob to do whatever an Animal knows how to do. This is usually offset by the great advantages of polymorphism discussed above. Given these instance variable definitions, let s take a closer look at the simulatemeal method of the JungleMeal class. Before looking at the actual code, we will describe the method s high-level intent. This method simulates three jungle animals eating a typical jungle meal. Which three animals is unimportant to the actual process of the simulation any three will do (in this case, the class is initialized with a Gazelle, alion, and a Clean- Lion). In this simulation, each animal eats to its fill, leaving some waste behind to accumulate on the jungle floor. Given this purpose, let s examine the first line of code in the simulatemeal method: _waste = _herb.eat(); Although the declared type of this object is a Herbivore, the instance is actually a Gazelle. The instance is shown in Figure 5.1, along with the hierarchy of subclasses of the Animal class. Note that this figure shows where each method was defined, not necessarily which messages each class in the hierarchy supports. Using the process of method resolution described at the beginning of the section, the first definition of eat that Java finds is in the Herbivore class. At this point, Java attempts to execute the statements within the Eat method. The first message it encounters is the eatplants message. Remember that this message is being sent to the current object, so Java must determine its actual type in order to determine which method to use to respond to the message sent. The actual type of the current object is still Gazelle, even though it is responding to eat as a Herbivore would. Thus, Java starts looking for a method with which to respond to the eatplants message with the Gazelle class and there it finds a definition. The Gazelle s eatplants method just returns a new instance of GrassLeftovers. And that instance is returned by the Herbivore s eat

8 74 Chapter 5 Polymorphism Figure 5.1 An instance of a Gazelle used as a Herbivore. sleep die Animal Herbivore eat _herb = new Gazelle(); (Gazelle) (instance of) Gazelle eatplants asleftovers method. Finally, this instance is assigned to the instance s variable _waste in the instance of the JungleMeal class. That completes this single Java statement! The next statement is much simpler: the accumulateleftovers message is sent to the JungleMeal instance which just tells the waste to pile up on the jungle floor. A Java program is dynamic, meaning that the values of properties and the state of objects can change during run-time. This means that a variable can be assigned to an object of one type and act as that type, but can then be assigned to an object of another type, and it will act as this new object. Thus, method calls are dynamically bound: meaning that the actual method called depends on what type of object is currently assigned to the variable receiving the message. This idea is what gives polymorphism its power. The next two lines are very similar to the ones we just described so we will not describe them in detail here. An important thing to notice is that we are replacing the value of the _waste instance variable after the Carnivore eats. In effect, this wipes out the JungleMeal s knowledge of the Herbivore s waste and replaces it with the Carnivore s waste. In this case, this is just fine because we have already told the Herbivore s waste to pile up on the jungle floor. Let s hand simulate the next line of code: _waste = _bob.eat(); Looking at Figure 5.2, we see an instance of a CleanLion being used in the JungleMeal class as an Animal. Which definition of eat is used? Java determines the reference is a CleanLion, so it looks for a definition of eat within that class. When it cannot find one there it continues up the inheritance hier-

9 Mechanics 75 archy, to the more general classes, until it finds a definition in the Carnivore class. Figure 5.2 A instance of a CleanLion used as an Animal sleep die Animal Carnivore bob = new CleanLion(); eat Lion Animal _prey killprey eatprey asleftovers (CleanLion) (instance of) CleanLion LionBib _bib eatprey The first line of the Carnivore s eat method is to send a message to the current object telling it to killprey. Here it finds a definition in the Lion class. It completes executing that method, returns to the calling method, the Carnivore s definition of eat, and attempts to eat the prey. Since the actual instance is a CleanLion, Java uses the lowest level definition of eatprey, the one in the CleanLion class not the one in the Lion class. Within the CleanLion s response to eatprey, after putting the bib on, we find another message send to eatprey. However, since this one is prefaced by the Java keyword super, it tells Java to look for a method of response to the eatprey message within superclasses of the current class. This means it begins looking for a method definition within the Lion class and continues looking in classes higher up the hierarchy if it didn t find one there. In this case, however, it does find one in the Lion class, so it stops looking and executes that method. When it is done, it returns to the CleanLion s eatprey method and takes off the bib. Finally the leftovers are returned and stored in the JungleMeal instance s _waste variable (replacing the current value).

10 76 Chapter 5 Polymorphism So, now what about the sleep messages? In this case, none of the subclasses replace the definition of the Animal s Sleep method. So no matter what the actual type of the instance is, the Animal class definition is used. If one of the subclasses were to replace the definition, Java would find it in the same way it did the eat message. Polymorphism Can Be Tricky Let s say that class Zoo has the following method: public void feedlion(lion tofeed) {... and we construct a local variable with declared type Animal and actual type Lion: Animal myanimal = new Lion(); Can we pass our myanimal variable into the feedlion method? The answer is no. An important statement to remember about Parameters and Polymorphism is: Declared type of actual parameter must be same class (or subclass) of declared type of formal parameter. In the above example, Animal (declared type of actual parameter) is the superclass of Lion (declared type of formal parameter). Because of this, we are not allowed to pass myanimal into the feedlion method. REVIEW OF INHERITANCE PRINCIPLES Creating and understanding a fully functional class hierarchy involves understanding three main concepts: completely defining, completely redefining, and extending. Understanding these three terms is the key to understanding how inheritance works, what is required, and how to determine which method is invoked. A method is defined if there are curly braces after its signature (even if there is no code between the braces that is just an empty method). Completely defining all methods in a class means that no methods are abstract and no inherited methods are left abstract. Once all methods in a class are completely defined, that class may be instantiated. When a method is invoked on a class, Java will begin method resolution at that class and move up the inheritance tree until it finds a completely defined method. It will then execute the code in that method.

11 Summary 77 Completely redefining a method means that that method has been overridden. Redefining a method ignores what was written in the superclass under the same signature and tells Java to use the new code instead. Since the new definition is lower on the inheritance tree, Java will see that definition first and know to use it instead of the superclass whenever that method is invoked on that subclass. Extending a class means adding capabilities to an existing class by making a subclass of it. The class that is extending inherits all public capabilities of the superclass and then adds its own features. This may involve defining existing abstract methods, redefining or partially overriding existing nonabstract methods, declaring new abstract methods, and/or declaring and defining new non-abstract methods. Extending a class gives you the opportunity to change a class and affect what methods are invoked along the inheritance tree. You can override a method so that any code written for that method in the superclasses is ignored. You can also partially override a method so that code in your new subclass is executed along with the code from that method in the superclass(es). Using the reserved word, super, partial overriding allows you to tell Java to continue walking up the inheritance tree. If you understand these three concepts and how they inter-relate, you should be able to go through a thorough hand-simulation of the sequence of method interactions that travel through an inheritance tree, and therefore, understand in detail how your code will work. SUMMARY Polymorphism lets us program with great generality, making methods generic, for example, by using superclass types as the declared types of formal parameters, while letting callers pass in actual types of subclasses for the actual parameters. (Note that the adjective actual is used here in different ways the actual type of the actual parameters ) We will extend our notion of polymorphism for even greater generality by allowing interfaces, covered in the next chapter, to be the declared type of formal parameters, as well as of variables.

12 78 Chapter 5 Polymorphism

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship. CSCI 253 Object Oriented Design: Java Review OOP George Blankenship George Blankenship 1 Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation Abstract Data Type (ADT) Implementation

More information

Compile-time type versus run-time type. Consider the parameter to this function:

Compile-time type versus run-time type. Consider the parameter to this function: CS107L Handout 07 Autumn 2007 November 16, 2007 Advanced Inheritance and Virtual Methods Employee.h class Employee public: Employee(const string& name, double attitude, double wage); virtual ~Employee();

More information

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r. CHAPTER 2 Logic 1. Logic Definitions 1.1. Propositions. Definition 1.1.1. A proposition is a declarative sentence that is either true (denoted either T or 1) or false (denoted either F or 0). Notation:

More information

The first program: Little Crab

The first program: Little Crab CHAPTER 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if-statement In the previous chapter,

More information

2 The first program: Little Crab

2 The first program: Little Crab 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if statement In the previous chapter, we

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions.

Unit 1 Number Sense. In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions. Unit 1 Number Sense In this unit, students will study repeating decimals, percents, fractions, decimals, and proportions. BLM Three Types of Percent Problems (p L-34) is a summary BLM for the material

More information

1. The Fly In The Ointment

1. The Fly In The Ointment Arithmetic Revisited Lesson 5: Decimal Fractions or Place Value Extended Part 5: Dividing Decimal Fractions, Part 2. The Fly In The Ointment The meaning of, say, ƒ 2 doesn't depend on whether we represent

More information

The Purchase Price in M&A Deals

The Purchase Price in M&A Deals The Purchase Price in M&A Deals Question that came in the other day In an M&A deal, does the buyer pay the Equity Value or the Enterprise Value to acquire the seller? What does it mean in press releases

More information

3 Improving the Crab more sophisticated programming

3 Improving the Crab more sophisticated programming 3 Improving the Crab more sophisticated programming topics: concepts: random behavior, keyboard control, sound dot notation, random numbers, defining methods, comments In the previous chapter, we looked

More information

Writing Thesis Defense Papers

Writing Thesis Defense Papers Writing Thesis Defense Papers The point of these papers is for you to explain and defend a thesis of your own critically analyzing the reasoning offered in support of a claim made by one of the philosophers

More information

Agenda. What is and Why Polymorphism? Examples of Polymorphism in Java programs 3 forms of Polymorphism

Agenda. What is and Why Polymorphism? Examples of Polymorphism in Java programs 3 forms of Polymorphism Polymorphism 1 Agenda What is and Why Polymorphism? Examples of Polymorphism in Java programs 3 forms of Polymorphism 2 What is & Why Polymorphism? 3 What is Polymorphism? Generally, polymorphism refers

More information

Abstract Class & Java Interface

Abstract Class & Java Interface Abstract Class & Java Interface 1 Agenda What is an Abstract method and an Abstract class? What is Interface? Why Interface? Interface as a Type Interface vs. Class Defining an Interface Implementing an

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

NTFS permissions represent a core part of Windows s security system. Using

NTFS permissions represent a core part of Windows s security system. Using bonus appendix NTFS Permissions NTFS permissions represent a core part of Windows s security system. Using this feature, you can specify exactly which coworkers are allowed to open which files and folders

More information

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6 Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6 Number Systems No course on programming would be complete without a discussion of the Hexadecimal (Hex) number

More information

MOST FREQUENTLY ASKED INTERVIEW QUESTIONS. 1. Why don t you tell me about yourself? 2. Why should I hire you?

MOST FREQUENTLY ASKED INTERVIEW QUESTIONS. 1. Why don t you tell me about yourself? 2. Why should I hire you? MOST FREQUENTLY ASKED INTERVIEW QUESTIONS 1. Why don t you tell me about yourself? The interviewer does not want to know your life history! He or she wants you to tell how your background relates to doing

More information

Aim To help students prepare for the Academic Reading component of the IELTS exam.

Aim To help students prepare for the Academic Reading component of the IELTS exam. IELTS Reading Test 1 Teacher s notes Written by Sam McCarter Aim To help students prepare for the Academic Reading component of the IELTS exam. Objectives To help students to: Practise doing an academic

More information

Session 7 Fractions and Decimals

Session 7 Fractions and Decimals Key Terms in This Session Session 7 Fractions and Decimals Previously Introduced prime number rational numbers New in This Session period repeating decimal terminating decimal Introduction In this session,

More information

Background Biology and Biochemistry Notes A

Background Biology and Biochemistry Notes A Background Biology and Biochemistry Notes A Vocabulary dependent variable evidence experiment hypothesis independent variable model observation prediction science scientific investigation scientific law

More information

5544 = 2 2772 = 2 2 1386 = 2 2 2 693. Now we have to find a divisor of 693. We can try 3, and 693 = 3 231,and we keep dividing by 3 to get: 1

5544 = 2 2772 = 2 2 1386 = 2 2 2 693. Now we have to find a divisor of 693. We can try 3, and 693 = 3 231,and we keep dividing by 3 to get: 1 MATH 13150: Freshman Seminar Unit 8 1. Prime numbers 1.1. Primes. A number bigger than 1 is called prime if its only divisors are 1 and itself. For example, 3 is prime because the only numbers dividing

More information

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1 The Java Series Java Essentials I What is Java? Basic Language Constructs Slide 1 What is Java? A general purpose Object Oriented programming language. Created by Sun Microsystems. It s a general purpose

More information

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS. Christopher Heil Georgia Institute of Technology WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

More information

16.1 DataFlavor. 16.1.1 DataFlavor Methods. Variables

16.1 DataFlavor. 16.1.1 DataFlavor Methods. Variables In this chapter: DataFlavor Transferable Interface ClipboardOwner Interface Clipboard StringSelection UnsupportedFlavorException Reading and Writing the Clipboard 16 Data Transfer One feature that was

More information

15-150 Lecture 11: Tail Recursion; Continuations

15-150 Lecture 11: Tail Recursion; Continuations 15-150 Lecture 11: Tail Recursion; Continuations Lecture by Dan Licata February 21, 2011 In this lecture we will discuss space usage: analyzing the memory it takes your program to run tail calls and tail

More information

Participants Manual Video Seven The OSCAR Coaching Model

Participants Manual Video Seven The OSCAR Coaching Model Coaching Skills for Managers Online Training Programme Part One Fundamentals of Coaching Participants Manual Video Seven The OSCAR Coaching Model Developed by Phone: 01600 715517 Email: info@worthconsulting.co.uk

More information

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

Vieta s Formulas and the Identity Theorem

Vieta s Formulas and the Identity Theorem Vieta s Formulas and the Identity Theorem This worksheet will work through the material from our class on 3/21/2013 with some examples that should help you with the homework The topic of our discussion

More information

CS-XXX: Graduate Programming Languages. Lecture 25 Multiple Inheritance and Interfaces. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 25 Multiple Inheritance and Interfaces. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 25 Multiple Inheritance and Interfaces Dan Grossman 2012 Multiple Inheritance Why not allow class C extends C1,C2,...{...} (and C C1 and C C2)? What everyone

More information

6.3 Conditional Probability and Independence

6.3 Conditional Probability and Independence 222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

More information

Chapter 13 - Inheritance

Chapter 13 - Inheritance Goals Chapter 13 - Inheritance To learn about inheritance To understand how to inherit and override superclass methods To be able to invoke superclass constructors To learn about protected and package

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

ios App Development for Everyone

ios App Development for Everyone ios App Development for Everyone Kevin McNeish Table of Contents Chapter 2 Objective C (Part 6) Referencing Classes Now you re ready to use the Calculator class in the App. Up to this point, each time

More information

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program

More information

Greatest Common Factor and Least Common Multiple

Greatest Common Factor and Least Common Multiple Greatest Common Factor and Least Common Multiple Intro In order to understand the concepts of Greatest Common Factor (GCF) and Least Common Multiple (LCM), we need to define two key terms: Multiple: Multiples

More information

Christopher Seder Affiliate Marketer

Christopher Seder Affiliate Marketer This Report Has Been Brought To You By: Christopher Seder Affiliate Marketer TABLE OF CONTENTS INTRODUCTION... 3 NOT BUILDING A LIST... 3 POOR CHOICE OF AFFILIATE PROGRAMS... 5 PUTTING TOO MANY OR TOO

More information

Pigeonhole Principle Solutions

Pigeonhole Principle Solutions Pigeonhole Principle Solutions 1. Show that if we take n + 1 numbers from the set {1, 2,..., 2n}, then some pair of numbers will have no factors in common. Solution: Note that consecutive numbers (such

More information

Guidelines for the Development of a Communication Strategy

Guidelines for the Development of a Communication Strategy Guidelines for the Development of a Communication Strategy Matthew Cook Caitlin Lally Matthew McCarthy Kristine Mischler About the Guidelines This guide has been created by the students from Worcester

More information

A Few Basics of Probability

A Few Basics of Probability A Few Basics of Probability Philosophy 57 Spring, 2004 1 Introduction This handout distinguishes between inductive and deductive logic, and then introduces probability, a concept essential to the study

More information

CS193j, Stanford Handout #10 OOP 3

CS193j, Stanford Handout #10 OOP 3 CS193j, Stanford Handout #10 Summer, 2003 Manu Kumar OOP 3 Abstract Superclass Factor Common Code Up Several related classes with overlapping code Factor common code up into a common superclass Examples

More information

Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance

Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance Introduction to C++ January 19, 2011 Massachusetts Institute of Technology 6.096 Lecture 7 Notes: Object-Oriented Programming (OOP) and Inheritance We ve already seen how to define composite datatypes

More information

Cosmological Arguments for the Existence of God S. Clarke

Cosmological Arguments for the Existence of God S. Clarke Cosmological Arguments for the Existence of God S. Clarke [Modified Fall 2009] 1. Large class of arguments. Sometimes they get very complex, as in Clarke s argument, but the basic idea is simple. Lets

More information

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219

Designing with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Designing with Exceptions CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Testing vs. Debugging Testing Coding Does the code work properly YES NO 2 Debugging Testing

More information

Writing a Scholarship Essay. Making the essay work for you!

Writing a Scholarship Essay. Making the essay work for you! Writing a Scholarship Essay Making the essay work for you! Reasons why students don t write scholarship essays (and lose out on scholarships!) They hate to write. They don t think they will win anyway.

More information

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10

6 3 4 9 = 6 10 + 3 10 + 4 10 + 9 10 Lesson The Binary Number System. Why Binary? The number system that you are familiar with, that you use every day, is the decimal number system, also commonly referred to as the base- system. When you

More information

Integers are positive and negative whole numbers, that is they are; {... 3, 2, 1,0,1,2,3...}. The dots mean they continue in that pattern.

Integers are positive and negative whole numbers, that is they are; {... 3, 2, 1,0,1,2,3...}. The dots mean they continue in that pattern. INTEGERS Integers are positive and negative whole numbers, that is they are; {... 3, 2, 1,0,1,2,3...}. The dots mean they continue in that pattern. Like all number sets, integers were invented to describe

More information

FOREIGN MATTER MANAGEMENT 36 QUESTION ASSESSMENT

FOREIGN MATTER MANAGEMENT 36 QUESTION ASSESSMENT Name: Employee I.D. or Personal I.D. Number: Company Name: Department: Head of Department: I understand that this 36 question test proves that I know what I am doing and therefore gives me no reason whatsoever

More information

ASVAB Study Guide. Peter Shawn White

ASVAB Study Guide. Peter Shawn White ASVAB Study Guide By Peter Shawn White Table of Contents Introduction Page 3 What Is The ASVAB? Page 4 Preparing For The ASVAB Page 5 Study Tips Page 7 Some Final Words Page 9 Introduction I m going to

More information

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper Parsing Technology and its role in Legacy Modernization A Metaware White Paper 1 INTRODUCTION In the two last decades there has been an explosion of interest in software tools that can automate key tasks

More information

Second Order Linear Nonhomogeneous Differential Equations; Method of Undetermined Coefficients. y + p(t) y + q(t) y = g(t), g(t) 0.

Second Order Linear Nonhomogeneous Differential Equations; Method of Undetermined Coefficients. y + p(t) y + q(t) y = g(t), g(t) 0. Second Order Linear Nonhomogeneous Differential Equations; Method of Undetermined Coefficients We will now turn our attention to nonhomogeneous second order linear equations, equations with the standard

More information

CHECKLIST FOR THE DEGREE PROJECT REPORT

CHECKLIST FOR THE DEGREE PROJECT REPORT Kerstin Frenckner, kfrenck@csc.kth.se Copyright CSC 25 mars 2009 CHECKLIST FOR THE DEGREE PROJECT REPORT This checklist has been written to help you check that your report matches the demands that are

More information

JAVA - INHERITANCE. extends is the keyword used to inherit the properties of a class. Below given is the syntax of extends keyword.

JAVA - INHERITANCE. extends is the keyword used to inherit the properties of a class. Below given is the syntax of extends keyword. http://www.tutorialspoint.com/java/java_inheritance.htm JAVA - INHERITANCE Copyright tutorialspoint.com Inheritance can be defined as the process where one class acquires the properties methodsandfields

More information

Description of Class Mutation Mutation Operators for Java

Description of Class Mutation Mutation Operators for Java Description of Class Mutation Mutation Operators for Java Yu-Seung Ma Electronics and Telecommunications Research Institute, Korea ysma@etri.re.kr Jeff Offutt Software Engineering George Mason University

More information

A PARENT S GUIDE TO CPS and the COURTS. How it works and how you can put things back on track

A PARENT S GUIDE TO CPS and the COURTS. How it works and how you can put things back on track A PARENT S GUIDE TO CPS and the COURTS How it works and how you can put things back on track HOW YOU CAN USE THIS HANDBOOK We hope that this handbook will be easy for you to use. You can either read through

More information

The Doctor-Patient Relationship

The Doctor-Patient Relationship The Doctor-Patient Relationship It s important to feel at ease with your doctor. How well you are able to talk with your doctor is a key part of getting the care that s best for you. It s also important

More information

Basic Logic Gates. Logic Gates. andgate: accepts two binary inputs x and y, emits x & y. orgate: accepts two binary inputs x and y, emits x y

Basic Logic Gates. Logic Gates. andgate: accepts two binary inputs x and y, emits x & y. orgate: accepts two binary inputs x and y, emits x y Basic andgate: accepts two binary inputs x and y, emits x & y x y Output orgate: accepts two binary inputs x and y, emits x y x y Output notgate: accepts one binary input x, emits!y x Output Computer Science

More information

Relative and Absolute Change Percentages

Relative and Absolute Change Percentages Relative and Absolute Change Percentages Ethan D. Bolker Maura M. Mast September 6, 2007 Plan Use the credit card solicitation data to address the question of measuring change. Subtraction comes naturally.

More information

STEP 5: Giving Feedback

STEP 5: Giving Feedback STEP 5: Giving Feedback Introduction You are now aware of the responsibilities of workplace mentoring, the six step approach to teaching skills, the importance of identifying the point of the lesson, and

More information

Extending Classes with Services

Extending Classes with Services Chapter 2 Extending Classes with Services Chapter Objectives After studying this chapter, you should be able to: Extend an existing class with new commands Explain how a message sent to an object is resolved

More information

Linear Programming Notes VII Sensitivity Analysis

Linear Programming Notes VII Sensitivity Analysis Linear Programming Notes VII Sensitivity Analysis 1 Introduction When you use a mathematical model to describe reality you must make approximations. The world is more complicated than the kinds of optimization

More information

Preparing and Revising for your GCSE Exams

Preparing and Revising for your GCSE Exams Preparing and Revising for your GCSE Exams Preparing and Revising for GCSEs Page 2 Contents Introduction 3 Effective Learning and Revision 4 What you need to Revise 5 Revision Notes and Practice 6 Getting

More information

Pamper yourself. Plan ahead. Remember it s important to eat and sleep well. Don t. Don t revise all the time

Pamper yourself. Plan ahead. Remember it s important to eat and sleep well. Don t. Don t revise all the time Plan ahead Do Have your own revision timetable start planning well before exams begin. Your teacher should be able to help. Make your books, notes and essays user-friendly. Use headings, highlighting and

More information

The Phases of an Object-Oriented Application

The Phases of an Object-Oriented Application The Phases of an Object-Oriented Application Reprinted from the Feb 1992 issue of The Smalltalk Report Vol. 1, No. 5 By: Rebecca J. Wirfs-Brock There is never enough time to get it absolutely, perfectly

More information

What is Organizational Communication?

What is Organizational Communication? What is Organizational Communication? By Matt Koschmann Department of Communication University of Colorado Boulder 2012 So what is organizational communication? And what are we doing when we study organizational

More information

Object Oriented Design

Object Oriented Design Object Oriented Design Kenneth M. Anderson Lecture 20 CSCI 5828: Foundations of Software Engineering OO Design 1 Object-Oriented Design Traditional procedural systems separate data and procedures, and

More information

ADT Implementation in Java

ADT Implementation in Java Object-Oriented Design Lecture 3 CS 3500 Fall 2009 (Pucella) Friday, Sep 18, 2009 ADT Implementation in Java As I said in my introductory lecture, we will be programming in Java in this course. In part,

More information

Managing Variability in Software Architectures 1 Felix Bachmann*

Managing Variability in Software Architectures 1 Felix Bachmann* Managing Variability in Software Architectures Felix Bachmann* Carnegie Bosch Institute Carnegie Mellon University Pittsburgh, Pa 523, USA fb@sei.cmu.edu Len Bass Software Engineering Institute Carnegie

More information

Multiplication and Division with Rational Numbers

Multiplication and Division with Rational Numbers Multiplication and Division with Rational Numbers Kitty Hawk, North Carolina, is famous for being the place where the first airplane flight took place. The brothers who flew these first flights grew up

More information

Outline. Written Communication Conveying Scientific Information Effectively. Objective of (Scientific) Writing

Outline. Written Communication Conveying Scientific Information Effectively. Objective of (Scientific) Writing Written Communication Conveying Scientific Information Effectively Marie Davidian davidian@stat.ncsu.edu http://www.stat.ncsu.edu/ davidian. Outline Objectives of (scientific) writing Important issues

More information

QUALITY TOOLBOX. Understanding Processes with Hierarchical Process Mapping. Robert B. Pojasek. Why Process Mapping?

QUALITY TOOLBOX. Understanding Processes with Hierarchical Process Mapping. Robert B. Pojasek. Why Process Mapping? QUALITY TOOLBOX Understanding Processes with Hierarchical Process Mapping In my work, I spend a lot of time talking to people about hierarchical process mapping. It strikes me as funny that whenever I

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

LESSON TITLE: Jesus Visits Mary and Martha THEME: Jesus wants us to spend time with \ Him. SCRIPTURE: Luke 10:38-42

LESSON TITLE: Jesus Visits Mary and Martha THEME: Jesus wants us to spend time with \ Him. SCRIPTURE: Luke 10:38-42 Devotion NT249 CHILDREN S DEVOTIONS FOR THE WEEK OF: LESSON TITLE: Jesus Visits Mary and Martha THEME: Jesus wants us to spend time with \ Him. SCRIPTURE: Luke 10:38-42 Dear Parents Welcome to Bible Time

More information

Prime Factorization 0.1. Overcoming Math Anxiety

Prime Factorization 0.1. Overcoming Math Anxiety 0.1 Prime Factorization 0.1 OBJECTIVES 1. Find the factors of a natural number 2. Determine whether a number is prime, composite, or neither 3. Find the prime factorization for a number 4. Find the GCF

More information

The «include» and «extend» Relationships in Use Case Models

The «include» and «extend» Relationships in Use Case Models The «include» and «extend» Relationships in Use Case Models Introduction UML defines three stereotypes of association between Use Cases, «include», «extend» and generalisation. For the most part, the popular

More information

Part 3: GridWorld Classes and Interfaces

Part 3: GridWorld Classes and Interfaces GridWorld Case Study Part 3: GridWorld Classes and Interfaces In our example programs, a grid contains actors that are instances of classes that extend the Actor class. There are two classes that implement

More information

CIS 190: C/C++ Programming. Polymorphism

CIS 190: C/C++ Programming. Polymorphism CIS 190: C/C++ Programming Polymorphism Outline Review of Inheritance Polymorphism Car Example Virtual Functions Virtual Function Types Virtual Table Pointers Virtual Constructors/Destructors Review of

More information

Planning and Writing Essays

Planning and Writing Essays Planning and Writing Essays Many of your coursework assignments will take the form of an essay. This leaflet will give you an overview of the basic stages of planning and writing an academic essay but

More information

This explains why the mixed number equivalent to 7/3 is 2 + 1/3, also written 2

This explains why the mixed number equivalent to 7/3 is 2 + 1/3, also written 2 Chapter 28: Proper and Improper Fractions A fraction is called improper if the numerator is greater than the denominator For example, 7/ is improper because the numerator 7 is greater than the denominator

More information

Multiplying Fractions

Multiplying Fractions . Multiplying Fractions. OBJECTIVES 1. Multiply two fractions. Multiply two mixed numbers. Simplify before multiplying fractions 4. Estimate products by rounding Multiplication is the easiest of the four

More information

(Refer Slide Time: 2:03)

(Refer Slide Time: 2:03) Control Engineering Prof. Madan Gopal Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 11 Models of Industrial Control Devices and Systems (Contd.) Last time we were

More information

[Refer Slide Time: 05:10]

[Refer Slide Time: 05:10] Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

More information

Polynomial Invariants

Polynomial Invariants Polynomial Invariants Dylan Wilson October 9, 2014 (1) Today we will be interested in the following Question 1.1. What are all the possible polynomials in two variables f(x, y) such that f(x, y) = f(y,

More information

SE 360 Advances in Software Development Object Oriented Development in Java. Polymorphism. Dr. Senem Kumova Metin

SE 360 Advances in Software Development Object Oriented Development in Java. Polymorphism. Dr. Senem Kumova Metin SE 360 Advances in Software Development Object Oriented Development in Java Polymorphism Dr. Senem Kumova Metin Modified lecture notes of Dr. Hüseyin Akcan Inheritance Object oriented programming languages

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

Programming with Data Structures

Programming with Data Structures Programming with Data Structures CMPSCI 187 Spring 2016 Please find a seat Try to sit close to the center (the room will be pretty full!) Turn off or silence your mobile phone Turn off your other internet-enabled

More information

Code Qualities and Coding Practices

Code Qualities and Coding Practices Code Qualities and Coding Practices Practices to Achieve Quality Scott L. Bain and the Net Objectives Agile Practice 13 December 2007 Contents Overview... 3 The Code Quality Practices... 5 Write Tests

More information

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract

Kenken For Teachers. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 27, 2010. Abstract Kenken For Teachers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles June 7, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic skills.

More information

Programming Methods & Java Examples

Programming Methods & Java Examples Programming Methods & Java Examples Dr Robert Harle, 2009 The following questions may be useful to work through for supervisions and/or revision. They are separated broadly by handout, but borders are

More information

Self-Acceptance. A Frog Thing by E. Drachman (2005) California: Kidwick Books LLC. ISBN 0-9703809-3-3. Grade Level: Third grade

Self-Acceptance. A Frog Thing by E. Drachman (2005) California: Kidwick Books LLC. ISBN 0-9703809-3-3. Grade Level: Third grade Self-Acceptance A Frog Thing by E. Drachman (2005) California: Kidwick Books LLC. ISBN 0-9703809-3-3 This Book Kit was planned by Lindsay N. Graham Grade Level: Third grade Characteristic Trait: Self Acceptance

More information

Welcome, today we will be making this cute little fish come alive. Put the UltimaFish.bmp texture into your Morrowind/Data Files/Textures directory.

Welcome, today we will be making this cute little fish come alive. Put the UltimaFish.bmp texture into your Morrowind/Data Files/Textures directory. The Morrowind Animation Tutorial Written by DarkIllusion This tutorial remains property of DarkIllusion. Revision 0 5 July 2003 Welcome, today we will be making this cute little fish come alive. Put the

More information

Cambridge English: First (FCE) Frequently Asked Questions (FAQs)

Cambridge English: First (FCE) Frequently Asked Questions (FAQs) Cambridge English: First (FCE) Frequently Asked Questions (FAQs) Is there a wordlist for Cambridge English: First exams? No. Examinations that are at CEFR Level B2 (independent user), or above such as

More information

MS Learn Online Feature Presentation Invisible Symptoms in MS Featuring Dr. Rosalind Kalb

MS Learn Online Feature Presentation Invisible Symptoms in MS Featuring Dr. Rosalind Kalb Page 1 MS Learn Online Feature Presentation Invisible Symptoms in MS Featuring Dr. Rosalind Kalb >>Kate Milliken: Hello, I m Kate Milliken, and welcome to MS Learn Online. No two people have exactly the

More information

The 5 P s in Problem Solving *prob lem: a source of perplexity, distress, or vexation. *solve: to find a solution, explanation, or answer for

The 5 P s in Problem Solving *prob lem: a source of perplexity, distress, or vexation. *solve: to find a solution, explanation, or answer for The 5 P s in Problem Solving 1 How do other people solve problems? The 5 P s in Problem Solving *prob lem: a source of perplexity, distress, or vexation *solve: to find a solution, explanation, or answer

More information

5.5. Solving linear systems by the elimination method

5.5. Solving linear systems by the elimination method 55 Solving linear systems by the elimination method Equivalent systems The major technique of solving systems of equations is changing the original problem into another one which is of an easier to solve

More information

Chapter 11 Number Theory

Chapter 11 Number Theory Chapter 11 Number Theory Number theory is one of the oldest branches of mathematics. For many years people who studied number theory delighted in its pure nature because there were few practical applications

More information

Instance Creation. Chapter

Instance Creation. Chapter Chapter 5 Instance Creation We've now covered enough material to look more closely at creating instances of a class. The basic instance creation message is new, which returns a new instance of the class.

More information

Metacognition. Complete the Metacognitive Awareness Inventory for a quick assessment to:

Metacognition. Complete the Metacognitive Awareness Inventory for a quick assessment to: Metacognition Metacognition is essential to successful learning because it enables individuals to better manage their cognitive skills and to determine weaknesses that can be corrected by constructing

More information

COMP 110 Prasun Dewan 1

COMP 110 Prasun Dewan 1 COMP 110 Prasun Dewan 1 12. Conditionals Real-life algorithms seldom do the same thing each time they are executed. For instance, our plan for studying this chapter may be to read it in the park, if it

More information

Click on the links below to jump directly to the relevant section

Click on the links below to jump directly to the relevant section Click on the links below to jump directly to the relevant section What is algebra? Operations with algebraic terms Mathematical properties of real numbers Order of operations What is Algebra? Algebra is

More information