|
@@ -5,7 +5,7 @@
|
5
|
5
|
![main2.png](images/main2.png)
|
6
|
6
|
![main3.png](images/main3.png)
|
7
|
7
|
|
8
|
|
-[Verano 2016- Tatiana]
|
|
8
|
+[Verano 2016- Tatiana - Ive]
|
9
|
9
|
|
10
|
10
|
A good way to organize and structure computer programs is dividing them into smaller parts using functions. Each function carries out a specific task of the problem that we are solving.
|
11
|
11
|
|
|
@@ -206,43 +206,43 @@ Airplane! (Paramount/ Blu-ray/ Checkpoint)|Paramount||Discontinued|5.1 DTS-HD|LB
|
206
|
206
|
```
|
207
|
207
|
|
208
|
208
|
|
209
|
|
-###Exercise 1
|
|
209
|
+### Exercise 1 -Familiarize yourself with the defined functions
|
210
|
210
|
|
211
|
|
-The first step in this lab experience is to familiarize yourself with the functions that are already defined in the code. Your tasks require that you imitate what the functions do, for this reason it is important that you understand how to call, declare and define the functions.
|
|
211
|
+The first step in this laboratory experience is to familiarize yourself with the functions that are already defined in the code. Your tasks require that you imitate what the functions do, for this reason it is important that you understand how to call, declare and define the functions.
|
212
|
212
|
|
213
|
|
-**Instructions**
|
|
213
|
+#### Instructions
|
214
|
214
|
|
215
|
215
|
1. Load the project `DVDInfo` into `QtCreateor`. There are two wayss to do this:
|
216
|
216
|
|
217
|
|
- * Using the virtual machine: Double click the file `DVDInfo.pro` located in the folder `home/eip/labs/functions-dvdinfo` of your virtual machine.
|
218
|
|
- * Downloading the project's folder from `Bitbucket`: Use a terminal and write the command `git clone http://bitbucket.org/eip-uprrp/functions-dvdinfo` to download the folder `functions-dvdinfo` from `Bitbucket`. Double click the file `DVDInfo.pro` located in the folder that you downloaded to your computer.
|
|
217
|
+ * Using the virtual machine: Double click the file `DVDInfo.pro` located in the folder `home/eip/labs/functions-dvdinfo` of your virtual machine.
|
|
218
|
+ * Downloading the project's folder from `Bitbucket`: Use a terminal and write the command `git clone http://bitbucket.org/eip-uprrp/functions-dvdinfo` to download the folder `functions-dvdinfo` from `Bitbucket`. Double click the file `DVDInfo.pro` located in the folder that you downloaded to your computer.
|
219
|
219
|
|
220
|
220
|
2. Configure the project. The file `main.cpp` has the function calls that you will use in the next exercises. The declarations and definitions of the functions that will be called can be found in the files `movie.h` and `movie.cpp`.
|
221
|
221
|
|
222
|
222
|
3. Double click on the file `movie.h` that contains this project's function prototypes. Go to `movie.h` and identify which functions are overloaded and describe why.
|
223
|
223
|
|
224
|
|
- Study the function prototypes and documentation in `movie.h` so that you understand the task they carry out and the data types they receive and return. For each of the following functions, identify the data types they receive and return:
|
225
|
|
-
|
226
|
|
- ```
|
227
|
|
- showMovie
|
228
|
|
- showMovies (las dos)
|
229
|
|
- getMovieName
|
230
|
|
- getMovieByName
|
231
|
|
- ```
|
232
|
|
-
|
|
224
|
+ Study the function prototypes and documentation in `movie.h` so that you understand the task they carry out and the data types they receive and return. For each of the following functions, identify the data types they receive and return:
|
|
225
|
+
|
|
226
|
+ ```
|
|
227
|
+ showMovie
|
|
228
|
+ showMovies (las dos)
|
|
229
|
+ getMovieName
|
|
230
|
+ getMovieByName
|
|
231
|
+ ```
|
|
232
|
+
|
233
|
233
|
4. You can find the function definitions in the file `movie.cpp`. Note that some versions of the function `showMovie` use the object called `fields` of the `QStringList` class. The purpose of this object is to provide easy access to information fields of each movie, using an index between 0 and 14. For example, you may use fields[0] to access a movie’s title, fields[1] to access a movie’s studio, fields[8] to access its year, and so forth.
|
234
|
234
|
|
235
|
235
|
---
|
236
|
236
|
|
237
|
237
|
!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-06.html"
|
238
|
238
|
<br>
|
239
|
|
-<br>
|
240
|
239
|
|
241
|
|
-###Exercise 2
|
|
240
|
+
|
|
241
|
+### Exercise 2 - Call and modify fuctions
|
242
|
242
|
|
243
|
243
|
In this exercise you will modify the `main` function and some of the pre-defined functions so that they display only certain movies from the database, display only part of the information, or display the information in a specific format.
|
244
|
244
|
|
245
|
|
-**Instructions**
|
|
245
|
+#### Instructions
|
246
|
246
|
|
247
|
247
|
1. In the file `main.cpp`, modify the `main` function so that the program displays the movies that have positions from 80 to 100.
|
248
|
248
|
|
|
@@ -256,7 +256,7 @@ In this exercise you will modify the `main` function and some of the pre-defined
|
256
|
256
|
|
257
|
257
|
6. For the movie in part 3, add the necessary code to the `main` function so that, using `getMovieInfo`, it displays the name, rating, year and the genre of the movie in one line. Hint: note that the function `getMovieInfo` has parameters that are passed by reference.
|
258
|
258
|
|
259
|
|
-###Exercise 3
|
|
259
|
+### Exercise 3 - Define and implement fucntions
|
260
|
260
|
|
261
|
261
|
The functions whose prototypes are in `movie.h` are implemented in the file `movie.cpp`. In this exercise you will use the files `movie.h`, `movie.cpp`, and `main.cpp` to define and implement additional functions. As you implement these functions, remember to use good programming techniques and document your program.
|
262
|
262
|
|