|
|
|
|
6
|
![main2.png](images/main2.png)
|
6
|
![main2.png](images/main2.png)
|
7
|
![main3.png](images/main3.png)
|
7
|
![main3.png](images/main3.png)
|
8
|
|
8
|
|
9
|
-[Verano 2016 - Ive- Tatiana]
|
|
|
10
|
|
9
|
|
11
|
*Object Oriented Programming* (OOP) is a programming paradigm that promotes the design of programs by having different objects interacting together to solve a problem. C++ is one of the programming languages that promotes object oriented programming, allowing programmers to create their own classes from scratch or derive them from other existing classes. Other languages that promote OOP are Java, Python, JavaScript and PHP.
|
10
|
*Object Oriented Programming* (OOP) is a programming paradigm that promotes the design of programs by having different objects interacting together to solve a problem. C++ is one of the programming languages that promotes object oriented programming, allowing programmers to create their own classes from scratch or derive them from other existing classes. Other languages that promote OOP are Java, Python, JavaScript and PHP.
|
12
|
|
11
|
|
|
|
|
|
47
|
|
46
|
|
48
|
###Classes
|
47
|
###Classes
|
49
|
|
48
|
|
50
|
-A class is a description of the data and processes of an object. The class’ declaration establishes the attributes that each of the objects of the class will have, and the methods that it can invoke.
|
|
|
|
|
49
|
+A class is a description of the data and processes of an object. The class’ declaration establishes the attributes that each of the objects of the class will have, and the methods that it can invoke.
|
51
|
|
50
|
|
52
|
If it isn't specified otherwise, the attributes and methods defined in a class will be private. This means that the variables can only be accessed and changed by the methods of the class (*constructors*, *setters*, and *getters*, among others).
|
51
|
If it isn't specified otherwise, the attributes and methods defined in a class will be private. This means that the variables can only be accessed and changed by the methods of the class (*constructors*, *setters*, and *getters*, among others).
|
53
|
|
52
|
|
|
|
|
|
154
|
|
153
|
|
155
|
## Laboratory Session:
|
154
|
## Laboratory Session:
|
156
|
|
155
|
|
157
|
-In this laboratory experience, your task will be to define the `BBPlayer` class with the attributes and method prototypes listed above. The skeleton for the program includes the code to define some of the methods; others you will have to be define.
|
|
|
|
|
156
|
+In this laboratory experience, your task will be to define the `BBPlayer` class with the attributes and method prototypes listed above. The skeleton for the program includes the code to define some of the methods; others you will have to define.
|
158
|
|
157
|
|
159
|
The skeleton for the program also includes the `test_BBPlayer` function that does unit tests to each of the functions in the program. The tests are commented and, as you define each function, you will remove the comments, test and modify the function, until the test for that function is passed. Once all of the functions are ready and have passed the tests, the whole program is tested by removing the necessary comments in the `main` function.
|
158
|
The skeleton for the program also includes the `test_BBPlayer` function that does unit tests to each of the functions in the program. The tests are commented and, as you define each function, you will remove the comments, test and modify the function, until the test for that function is passed. Once all of the functions are ready and have passed the tests, the whole program is tested by removing the necessary comments in the `main` function.
|
160
|
|
159
|
|
|
|
|
|
166
|
1. Load the project `basket01` into `QtCreator`. There are two ways to do this:
|
165
|
1. Load the project `basket01` into `QtCreator`. There are two ways to do this:
|
167
|
|
166
|
|
168
|
* Using the virtual machine: Double click the file `basket01.pro` located in the folder `/home/eip/labs/classes-basket01` of your virtual machine.
|
167
|
* Using the virtual machine: Double click the file `basket01.pro` located in the folder `/home/eip/labs/classes-basket01` of your virtual machine.
|
169
|
- * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/classes-basket01` to download the folder `classes-basket01` from `Bitbucket`. Double click the file `basket01.pro` located in the folder that you downloaded to your computer.
|
|
|
|
|
168
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/classes-basket01` to download the folder `classes-basket01` from `Bitbucket`. Double click the file `basket01.pro` located in the folder that you downloaded to your computer.
|
170
|
|
169
|
|
171
|
2. This program will run on the terminal and you should select this option from the "Projects" window. To access this window, you select "Projects" in the vertical menu to the left. Afterwards, in `Build & Run` you select `Run` and then mark the box that says `Run in terminal`.
|
170
|
2. This program will run on the terminal and you should select this option from the "Projects" window. To access this window, you select "Projects" in the vertical menu to the left. Afterwards, in `Build & Run` you select `Run` and then mark the box that says `Run in terminal`.
|
172
|
|
171
|
|