|
@@ -8,7 +8,7 @@
|
8
|
8
|
|
9
|
9
|
|
10
|
10
|
|
11
|
|
-In almost every instance in which we want to solve a problem, we select among are one or more options that depend on whether certain conditions are met. Computer programs are built to solve problems, therefore they should have a structure that allows them to make decisions and select alternatives. In C++, selections are structured using `if`, `else`, `else if` or `switch`. Relational expressions and logical operators are common when handling selection structures. In this laboratory experience, you will practice the use of some of these selection structures by completing a design using the class called Bird. In addition, you will review concepts related to objects.
|
|
11
|
+In almost every instance in which we want to solve a problem, we select between different options depending on whether certain conditions are met. Computer programs are built to solve problems, therefore they should have a structure that allows them to make decisions and select alternatives. In C++, selections are structured using `if`, `else`, `else if` or `switch`. Relational expressions and logical operators are common when handling selection structures. In this laboratory experience, you will practice the use of some of these selection structures by completing a design using the class called Bird. In addition, you will review concepts related to objects.
|
12
|
12
|
|
13
|
13
|
## Objectives:
|
14
|
14
|
|
|
@@ -51,7 +51,7 @@ To facilitate this laboratory experience, we will begin by reviewing some concep
|
51
|
51
|
|
52
|
52
|
##Classes and Objects in C++
|
53
|
53
|
|
54
|
|
-An *object* is an entity that contains data and procedures to manipulate them. Similar to how each variable has a *type* of data associated to it, each object has a *class* associated to it, which describes the properties of the the objects: its data (*attributes*), and the procedures that can be used to manipulate its data (*methods*).
|
|
54
|
+An *object* is an entity that contains data and procedures to manipulate them. Similar to how each variable has a *type* of data associated to it, each object has a *class* associated to it, which describes the properties of the objects: its data (*attributes*), and the procedures that can be used to manipulate its data (*methods*).
|
55
|
55
|
|
56
|
56
|
It is not necessary to know all of the details about the methods of the object to define and use an object, but you must know how to create it and how to interact with it. The necessary information is available in the class' documentation. Before creating objects of any class, we should familiarize ourselves with its documentation. The documentation indicates, among other things, what entity is trying to be represented in the class, and its interface or methods available to manipulate the objects of the class.
|
57
|
57
|
|
|
@@ -185,7 +185,7 @@ Have a look at the documentation for the second constructor, `Bird (int, EyeBrow
|
185
|
185
|
|
186
|
186
|
#### Setters (mutators)
|
187
|
187
|
|
188
|
|
-Classes provide methods to modify the values of the attributes of an objected that has been created. These methods are called *setters* or *mutators*. Usually, we declare one setter for each attribute that the class has. The `Bird` class has the following setters:
|
|
188
|
+Classes provide methods to modify the values of the attributes of an object that has been created. These methods are called *setters* or *mutators*. Usually, we declare one setter for each attribute that the class has. The `Bird` class has the following setters:
|
189
|
189
|
|
190
|
190
|
* `void setSize (int)`
|
191
|
191
|
* `void setEyebrow (EyeBrowType)`
|