root 8 years ago
parent
commit
7a9af754f4
2 changed files with 69 additions and 55 deletions
  1. 31
    24
      README-en.md
  2. 38
    31
      README-es.md

+ 31
- 24
README-en.md View File

5
 ![main2.png](images/main2.png)
5
 ![main2.png](images/main2.png)
6
 ![main3.png](images/main3.png)
6
 ![main3.png](images/main3.png)
7
 
7
 
8
+[Verano 2016- Tatiana] 
8
 
9
 
9
 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.
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.
10
 
11
 
11
-You've seen that all programs written in C++ must contain the `main` function where the program begins. You've probably already used functions such as `pow`, `sin`, `cos`, or `sqrt` from the `cmath` library. Since in almost all of the upcoming lab activities you will continue using pre-defined functions, you need to understand how to work with them. In future exercises  you will learn how to design and validate functions. In this laboratory experience you will search and display information contained in a DVD data base to practice declaring simple functions and calling pre-defined functions.
12
+You've seen that all programs written in C++ must contain the `main` function where the program begins. You've probably already used functions such as `pow`, `sin`, `cos`, or `sqrt` from the `cmath` library. Since in almost all of the upcoming lab experiences you will continue using pre-defined functions, you need to understand how to work with them. In future exercises, you will learn how to design and validate functions. In this laboratory experience, you will search and display information contained in a DVD data base to practice declaring simple functions and calling pre-defined functions.
12
 
13
 
13
 
14
 
14
 ##Objectives:
15
 ##Objectives:
34
 
35
 
35
 2. Studied the concepts and instructions for the laboratory session.
36
 2. Studied the concepts and instructions for the laboratory session.
36
 
37
 
37
-3. Taken the Pre-Lab quiz that can be found in Moodle.
38
+3. Taken the Pre-Lab quiz, available in Moodle.
38
 
39
 
39
 ---
40
 ---
40
 
41
 
42
 
43
 
43
 ##Functions
44
 ##Functions
44
 
45
 
45
-In mathematics, a function $$f$$ is a rule that is used to assign to each element $$x$$ from a set called *domain*, one (and only one) element $$y$$ from a set called *range*. This rule is commonly represented with an equation, $$y=f(x)$$. The variable $$x$$ is the parameter of the function and the variable $$y$$ will contain the result of the function. A function can have more than one parameter, but only one result. For example, a function can have the form $$y=f(x_1,x_2)$$ where there are two parameters, and for each pair $$(a,b)$$ that is used as an argument in the function, the function has only one value of $$y=f(a,b)$$. The domain of the function tells us the type of value that the parameter should have and the range tells us the value that the returned result will have.
46
+In mathematics, a function $$f$$ is a rule that is used to assign to each element $$x$$ from a set called *domain*, one (and only one) element $$y$$ from a set called *range*. This rule is commonly represented with an equation, $$y=f(x)$$. The variable $$x$$ is the parameter of the function and the variable $$y$$ will contain the result of the function. A function can have more than one parameter, but only one result. For example, a function can have the form $$y=f(x_1,x_2)$$ where there are two parameters, and for each pair $$(a,b)$$ that is used as an argument in the function, and the function will only one value of $$y=f(a,b)$$. The domain of the function tells us the type of value that the parameter should have and the range tells us the value that the returned result will have.
46
 
47
 
47
-Functions in programming languages are similar. A function has a series of instructions that take the assigned values as parameters and performs a certain task. In C++ and other programming languages, functions return only one result, as it happens in mathematics. The only difference is that a *programming* function could possibly not return any value (in this case the function is declared as `void`). If the function will return a value, we use the instruction `return`. As in math, you need to specify the types of values that the function's parameters and result will have; this is done when declaring the function.
48
+Functions in programming languages are similar. A function has a series of instructions that take the assigned values as parameters and performs a certain task. In C++ and other programming languages, functions return only one result, as it happens in mathematics. The only difference is that a *programming* function could possibly not return any value (in this case the function is declared as `void`). If the function returns a value, we use the instruction `return`. As in math, you need to specify the types of values that the function's parameters and result will have; this is done when declaring the function.
48
 
49
 
49
 ###Function header:
50
 ###Function header:
50
 
51
 
60
 
61
 
61
 ###Calling
62
 ###Calling
62
 
63
 
63
-If we want to store the value of the `example` function's result in a variable `result` (that would be of type integer), we call the function by passing arguments as follows:
64
+If we want to store the value of the result of the function called `example` in a variable `result` (that would be of type integer), we call the function by passing arguments as follows:
64
 
65
 
65
 `result=example(2, 3.5, unCar);`
66
 `result=example(2, 3.5, unCar);`
66
 
67
 
67
-Note that as the function is called, you don't include the type of the variables in the arguments. As in the definition for the function `example`, the third parameter `&var3` is a reference variable; what is being sent to the third argument when calling the function is a *reference* to the variable `unCar`. Any changes that are made on the variable `var3` will change the contents of the variable `unCar`.
68
+Note that as the function is called, you don't include the type of the variables in the arguments as in the definition for the function `example`. The third parameter `&var3` is a reference variable; what is being sent to the third argument when calling the function is a *reference* to the variable `unCar`. Any changes that are made on the variable `var3` will change the contents of the variable `unCar`.
68
 
69
 
69
 You can also use the function's result without having to store it in a variable. For example you could print it:
70
 You can also use the function's result without having to store it in a variable. For example you could print it:
70
 
71
 
111
 int example(int, char) ;
112
 int example(int, char) ;
112
 ```
113
 ```
113
 
114
 
114
-All of the above functions have the same name, `example`, but different parameters. The first and second functions have the same amount of parameters, but their arguments are of different types. The fourth and fifth functions have arguments of type `char` and `int`, but in each case are in different order.
115
+All of the above functions have the same name, `example`, but different parameters. The first and second functions have the same amount of parameters, but their arguments are of different types. The fourth and fifth functions have arguments of type `char` and `int`, but they have a different order in each case.
115
 
116
 
116
-In that last example, the function `example` is overloaded since there are 5 functions with different signatures but with the same name.
117
+In that last example, the function `example` is overloaded since there are five functions with different signatures but with the same name.
117
 
118
 
118
 
119
 
119
-### Default values
120
+### Default values
120
 
121
 
121
-Values by default can be assigned to the parameters of the functions starting from the first parameter to the right. It is not necessary to initialize all of the parameters, but the ones that are initialized should be consecutive: parameters in between two parameters cannot be left uninitialized. This allows calling the function without having to send values in the positions that correspond to the initialized parameters.
122
+Values by default can be assigned to the parameters of the functions starting from the rightmost parameter. It is not necessary to initialize all of the parameters, but the ones that are initialized should be consecutive: parameters in between two parameters cannot be left uninitialized. This allows calling the function without having to send values in the positions that correspond to the initialized parameters.
122
 
123
 
123
 **Examples of function headers and valid function calls:**
124
 **Examples of function headers and valid function calls:**
124
 
125
 
139
 
140
 
140
     b. `example(5, 3.3)` In this function call only the first two parameters are given values, and the value for the last parameter is the value by default. That is, the value for `var1` within the function will be 5, that of `var2` will be 3.3, and `var3` will be 10.
141
     b. `example(5, 3.3)` In this function call only the first two parameters are given values, and the value for the last parameter is the value by default. That is, the value for `var1` within the function will be 5, that of `var2` will be 3.3, and `var3` will be 10.
141
 
142
 
142
-    c. `example(5)` In this function call only the first parameter is given a value, and the last two parameters will be assigned  values by default. That is, `var1` will be 5, `var2` will be 5.0, and `var3` will be 10.
143
+    c. `example(5)` In this function call only the first parameter is given a value, and the last two parameters will be assigned values by default. That is, `var1` will be 5, `var2` will be 5.0, and `var3` will be 10.
143
 
144
 
144
 
145
 
145
 **Example of a valid function header with invalid function calls:**
146
 **Example of a valid function header with invalid function calls:**
150
 
151
 
151
     a. `example(5, , 10)` This function call is **invalid** because it leaves an empty space in the middle argument.
152
     a. `example(5, , 10)` This function call is **invalid** because it leaves an empty space in the middle argument.
152
 
153
 
153
-    b. `example()` This function call is **invalid** because `var1` was not assigned a default value. A valid call to the function `example` needs at least one argument (the first). 
154
+    b. `example()` This function call is **invalid** because `var1` was not assigned as a default value. A valid call to the function `example` needs at least one argument (the first). 
154
 
155
 
155
 **Examples of invalid function headers:**
156
 **Examples of invalid function headers:**
156
 
157
 
157
-1. `int example(int var1=1, float var2, int var3)` This header is invalid because  the  default values can only be assigned starting from the rightmost parameter.
158
+1. `int example(int var1=1, float var2, int var3)` This header is invalid because the default values can only be assigned starting from the rightmost parameter.
158
 
159
 
159
 2. `int example(int var1=1, float var2, int var3=10)` This header is invalid because you can't place parameters without values between other parameters with default values. In this case, `var2` doesn't have a default value but `var1` and `var3` do.
160
 2. `int example(int var1=1, float var2, int var3=10)` This header is invalid because you can't place parameters without values between other parameters with default values. In this case, `var2` doesn't have a default value but `var1` and `var3` do.
160
 
161
 
164
 
165
 
165
 ##DVD movies and the DVD data base
166
 ##DVD movies and the DVD data base
166
 
167
 
167
-DVD stands for "digital versatile disk" or "digital video disk", which is an optical disc format for storing digital information invented by Philips, Sony, Toshiba, and Panasonic in 1995. The DVD offers larger storage capacity than compact disks (CD), but have the same dimensions. DVDs can be used to store any kind of digital data, but are famous for their use in the distribution of movies.
168
+DVD stands for "digital versatile disk" or "digital video disk", which is an optical disc format for storing digital information invented by Philips, Sony, Toshiba, and Panasonic in 1995. The DVD offers larger storage capacity than compact disks (CD), but has the same dimensions. DVDs can be used to store any kind of digital data, but they are famous for their use in the distribution of movies.
168
 
169
 
169
 
170
 
170
 ---
171
 ---
172
 ---
173
 ---
173
 
174
 
174
 
175
 
175
-!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-01.html"
176
+!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-01.html"
176
 <br>
177
 <br>
177
 
178
 
178
-!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-03.html"
179
+!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-03.html"
179
 <br>
180
 <br>
180
 
181
 
181
-!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-11.html"
182
+!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-11.html"
182
 <br>
183
 <br>
183
 
184
 
184
-!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-12.html"
185
+!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-12.html"
185
 <br>
186
 <br>
186
 
187
 
187
 <br>
188
 <br>
194
 
195
 
195
 ## Laboratory session
196
 ## Laboratory session
196
 
197
 
197
-In this laboratory session we will be using a data base of DVD movies maintained by http://www.hometheaterinfo.com/dvdlist.htm. This database contains 44MB of information for movies that have been distributed in DVD. Some of the stored information in the database for each DVD is: DVD title, publishing studio, date of publication, type of sound, versions, price, rating, year and genre. The fields of information for each movie are stored in text with the following format:
198
+In this laboratory session we will be using a data base of DVD movies maintained by http://www.hometheaterinfo.com/dvdlist.htm. This database contains 44MB of information for movies that have been distributed in DVD. Some of the stored information in the database for each DVD is: DVD title, publishing studio, date of publication, type of sound, versions, price, rating, year and genre. The fields of the information for each movie are stored in text with the following format:
198
 
199
 
199
 `DVD_Title|Studio|Released|Status|Sound|Versions|Price|Rating|Year|Genre|Aspect|UPC|DVD_ReleaseDate|ID|Timestamp`
200
 `DVD_Title|Studio|Released|Status|Sound|Versions|Price|Rating|Year|Genre|Aspect|UPC|DVD_ReleaseDate|ID|Timestamp`
200
 
201
 
207
 
208
 
208
 ###Exercise 1
209
 ###Exercise 1
209
 
210
 
210
-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, so it is important that you understand how to call, declare and define the functions. 
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
 
212
 
212
 **Instructions**
213
 **Instructions**
213
 
214
 
214
-1. Open the project `DVDInfo` in Qt by double clicking the file `DVDInfo.pro` in the folder `Documents/eip/Functions-DVDInfo` on your computer. You may also access `http://bitbucket.org/eip-uprrp/functions-dvdinfo` to download the folder `Functions-DVDInfo` to your computer.
215
+1. Load the project `DVDInfo` into `QtCreateor`. There are two wayss to do this: 
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. 
215
 
219
 
216
 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`.
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`.
217
 
221
 
226
     getMovieByName
230
     getMovieByName
227
     ```
231
     ```
228
 
232
 
229
-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.
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.
230
 
234
 
231
 ---
235
 ---
232
 
236
 
233
-!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-06.html"
237
+!INCLUDE "../../eip-diagnostic/DVD/en/diag-dvd-06.html"
234
 <br>
238
 <br>
235
 <br>
239
 <br>
236
 
240
 
248
 
252
 
249
 4. For the movie in part 3 of this exercise, add the necessary code to the `main` function so that the program displays the name and the rating of the movie.
253
 4. For the movie in part 3 of this exercise, add the necessary code to the `main` function so that the program displays the name and the rating of the movie.
250
 
254
 
251
-5. Modify the `getMovieInfo` function in the file `movie.cpp` so that it receives an additional parameter by reference to which the name of the movie will be assigned. Remember that you must also modify the function's prototype in `movie.h`.
255
+5. Modify the `getMovieInfo` function in the file `movie.cpp` so that it receives an additional parameter by reference where the name of the movie will be assigned. Remember that you must also modify the function's prototype in `movie.h`.
252
 
256
 
253
 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. 
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. 
254
 
258
 
291
 [3] http://www.soft32.com/blog/platforms/windows/keep-your-dvd-collection-up-to-date-with-emdb-erics-movie-database/
295
 [3] http://www.soft32.com/blog/platforms/windows/keep-your-dvd-collection-up-to-date-with-emdb-erics-movie-database/
292
 
296
 
293
 [4] http://www.hometheaterinfo.com/dvdlist.htm
297
 [4] http://www.hometheaterinfo.com/dvdlist.htm
298
+
299
+
300
+

+ 38
- 31
README-es.md View File

4
 ![main2.png](images/main2.png)
4
 ![main2.png](images/main2.png)
5
 ![main3.png](images/main3.png)
5
 ![main3.png](images/main3.png)
6
 
6
 
7
+[Verano 2016- Tatiana]
7
 
8
 
8
 Una buena manera de organizar y estructurar los programas de computadoras es dividiéndolos en partes más pequeñas utilizando funciones. Cada función realiza una tarea específica del problema que estamos resolviendo.
9
 Una buena manera de organizar y estructurar los programas de computadoras es dividiéndolos en partes más pequeñas utilizando funciones. Cada función realiza una tarea específica del problema que estamos resolviendo.
9
 
10
 
10
-Haz visto que todos los programas en C++ deben contener la función `main` que es donde comienza el programa. Probablemente ya haz utilizado funciones como `pow`, `sin`, `cos`  o `sqrt` de la biblioteca de matemática `cmath`. Dado que en casi todas las experiencias de laboratorio futuras estarás utilizando funciones pre-definidas, necesitas aprender cómo trabajar con ellas. Más adelante aprenderás cómo diseñarlas y validarlas. En esta experiencia de laboratorio harás búsquedas y desplegarás información contenida en una base de datos de DVDs para practicar la creación de funciones simples y la invocación de funciones pre-definidas. 
11
+Haz visto que todos los programas en C++ deben contener la función `main` que es donde comienza el programa. Probablemente ya has utilizado funciones como `pow`, `sin`, `cos`  o `sqrt` de la biblioteca de matemática `cmath`. Dado que en casi todas las experiencias de laboratorio futuras estarás utilizando funciones pre-definidas, necesitas aprender cómo trabajar con ellas. Más adelante aprenderás cómo diseñarlas y validarlas. En esta experiencia de laboratorio harás búsquedas y desplegarás información contenida en una base de datos de DVDs para practicar la creación de funciones simples y la invocación de funciones pre-definidas. 
11
 
12
 
12
 
13
 
13
 ##Objetivos:
14
 ##Objetivos:
20
 
21
 
21
 ##Pre-Lab:
22
 ##Pre-Lab:
22
 
23
 
23
-Antes de llegar al laboratorio  debes:
24
+Antes de llegar al laboratorio debes:
24
 
25
 
25
 1. Haber repasado los siguientes conceptos:
26
 1. Haber repasado los siguientes conceptos:
26
 
27
 
28
 
29
 
29
     b. la manera de invocar funciones en C++
30
     b. la manera de invocar funciones en C++
30
 
31
 
31
-    c. la diferencia entre  parámetros pasados por valor y por referencia
32
+    c. la diferencia entre parámetros pasados por valor y por referencia
32
 
33
 
33
     d. cómo devolver el resultado de una función.
34
     d. cómo devolver el resultado de una función.
34
 
35
 
35
 2. Haber estudiado los conceptos e instrucciones para la sesión de laboratorio.
36
 2. Haber estudiado los conceptos e instrucciones para la sesión de laboratorio.
36
 
37
 
37
-3. Haber tomado el quiz Pre-Lab que se encuentra en Moodle.
38
+3. Haber tomado el quiz Pre-Lab, disponible en Moodle.
38
 
39
 
39
 
40
 
40
 ---
41
 ---
46
 ##Funciones
47
 ##Funciones
47
 
48
 
48
 
49
 
49
-En matemática, una función $$f$$ es una regla que se usa para asignar a cada elemento $$x$$ de un conjunto que se llama *dominio*, uno (y solo un) elemento $$y$$ de un conjunto que se llama *campo de valores*. Por lo general, esa regla se representa como una ecuación, $$y=f(x)$$. La variable $$x$$ es el parámetro de la función y la variable $$y$$ contendrá el resultado de la función. Una función puede tener más de un parámetro pero solo un resultado. Por ejemplo, una función puede tener la forma $$y=f(x_1,x_2)$$ en donde hay dos parámetros y para cada par $$(a,b)$$ que se use como argumento de la función, la función tiene un solo valor de $$y=f(a,b)$$. El dominio de la función te dice el tipo de valor que debe tener el parámetro y el campo de valores el tipo de valor que tendrá el resultado que devuelve la función.
50
+En matemática, una función $$f$$ es una regla que se usa para asignar a cada elemento $$x$$ de un conjunto llamado *dominio*, uno (y solo un) elemento $$y$$ de un conjunto llamado *campo de valores*. Por lo general, esa regla se representa como una ecuación, $$y=f(x)$$. La variable $$x$$ es el parámetro de la función y la variable $$y$$ contendrá el resultado de la función. Una función puede tener más de un parámetro pero solo un resultado. Por ejemplo, una función puede tener la forma $$y=f(x_1,x_2)$$ en donde hay dos parámetros y para cada par $$(a,b)$$ que se use como argumento de la función, y la función tendrá un solo valor de $$y=f(a,b)$$. El dominio de la función te dice el tipo de valor que debe tener el parámetro y el campo de valores dice el tipo de valor que tendrá el resultado que devuelve la función.
50
 
51
 
51
 Las funciones en lenguajes de programación de computadoras son similares. Una función 
52
 Las funciones en lenguajes de programación de computadoras son similares. Una función 
52
-tiene una serie de instrucciones que toman los valores asignados a los parámetros y realiza alguna tarea. En C++ y en algunos otros lenguajes de programación, las funciones solo pueden devolver un resultado, tal y como sucede en matemáticas. La única diferencia es que una función en programación puede que no devuelva valor (en este caso la función se declara `void`). Si la función va a devolver algún valor, se hace con la instrucción `return`. Al igual que en matemática tienes que especificar el dominio y el campo de valores, en programación tienes que especificar los tipos de valores que tienen los parámetros y el resultado que devuelve la función; esto lo haces al declarar la función.
53
+tiene una serie de instrucciones que toman los valores asignados a los parámetros y realiza alguna tarea. En C++ y en algunos otros lenguajes de programación, las funciones solo pueden devolver un resultado, tal y como sucede en matemáticas. La única diferencia es que una función en programación puede que no devuelva un valor (en este caso la función se declara `void`). Si la función va a devolver algún valor, se hace con la instrucción `return`. Al igual que en matemática tienes que especificar el dominio y el campo de valores, en programación tienes que especificar los tipos de valores que tienen los parámetros y el resultado que devuelve la función; esto lo haces al declarar la función.
53
 
54
 
54
-###Encabezado de una función:
55
+###El encabezado de una función:
55
 
56
 
56
 La primera oración de una función se llama el *encabezado* y su estructura es como sigue:
57
 La primera oración de una función se llama el *encabezado* y su estructura es como sigue:
57
 
58
 
61
 
62
 
62
 `int ejemplo(int var1, float var2, char &var3)`
63
 `int ejemplo(int var1, float var2, char &var3)`
63
 
64
 
64
-sería el encabezado de la función llamada `ejemplo`, que devuelve un valor entero. La función recibe como argumentos un valor entero (y guardará una copia en `var1`), un valor de tipo `float` (y guardará una copia en `var2`) y la referencia a una variable de tipo  `char` que se guardará en la variable de referencia `var3`. Nota que `var3` tiene el signo `&` antes del nombre de la variable. Esto indica que `var3` contendrá la referencia a un caracter.
65
+sería el encabezado de la función llamada `ejemplo`, que devuelve un valor entero. La función recibe como argumentos un valor entero (y guardará una copia en `var1`), un valor de tipo `float` (y guardará una copia en `var2`) y la referencia a una variable de tipo  `char` que se guardará en la variable de referencia `var3`. Nota que `var3` tiene el signo `&` antes del nombre de la variable. Esto indica que `var3` contendrá la referencia a un carácter.
65
 
66
 
66
 ###Invocación
67
 ###Invocación
67
 
68
 
69
 
70
 
70
 `resultado=ejemplo(2, 3.5, unCar);`
71
 `resultado=ejemplo(2, 3.5, unCar);`
71
 
72
 
72
-Nota que al invocar funciones no incluyes el tipo de las variables en los argumentos. Como en la definición de la función `ejemplo` el tercer parámetro `&var3` es una variable de referencia, lo que se está enviando en el tercer argumento de la invocación es una *referencia* a la variable `unCar`. Los cambios que se hagan en la variable `var3` están cambiando el contenido de la variable `unCar`.
73
+Nota que al invocar funciones no incluyes el tipo de las variables en los argumentos como en la definición de la función `ejemplo`. El tercer parámetro `&var3` es una variable de referencia, esto significa que lo que se está enviando en el tercer argumento de la invocación es una *referencia* a la variable `unCar`. Los cambios que se hagan en la variable `var3` están cambiando el contenido de la variable `unCar`.
73
 
74
 
74
 También puedes usar el resultado de la función sin tener que guardarlo en una variable. Por ejemplo puedes imprimirlo:
75
 También puedes usar el resultado de la función sin tener que guardarlo en una variable. Por ejemplo puedes imprimirlo:
75
 
76
 
117
 
118
 
118
 Todas las funciones de arriba tienen el mismo nombre, `ejemplo`, pero distintos parámetros.  La primera y segunda función tienen la misma cantidad de parámetros, pero los argumentos son de distintos tipos.  La cuarta y quinta función tienen argumentos de tipo `char` e `int`, pero en cada caso están en distinto orden.
119
 Todas las funciones de arriba tienen el mismo nombre, `ejemplo`, pero distintos parámetros.  La primera y segunda función tienen la misma cantidad de parámetros, pero los argumentos son de distintos tipos.  La cuarta y quinta función tienen argumentos de tipo `char` e `int`, pero en cada caso están en distinto orden.
119
 
120
 
120
-En este último ejemplo la función ejemplo es sobrecargada ya que hay 5 funciones con firma distinta pero con el mismo nombre.
121
+En este último ejemplo la función `ejemplo` es sobrecargada ya que hay cinco funciones con firmas distintas pero con el mismo nombre.
121
 
122
 
122
 
123
 
123
-###Valores por defecto
124
+###Valores predeterminados
124
 
125
 
125
-Se pueden asignar valores por defecto ("default") a los parámetros de las funciones comenzando desde el parámetro más a la derecha. No hay que inicializar todos los parámetros pero los que se inicializan deben ser consecutivos: no se puede dejar parámetros sin inicializar entre dos parámetros que estén inicializados. Esto permite la invocación de la función sin tener que enviar los valores en las posiciones que corresponden a parámetros inicializados.
126
+Se pueden asignar valores predeterminados ("default") a los parámetros de las funciones comenzando desde el parámetro que está más a la derecha. No hay que inicializar todos los parámetros pero los que se inicializan deben ser consecutivos: no se puede dejar parámetros sin inicializar entre dos parámetros que estén inicializados. Esto permite la invocación de la función sin tener que enviar los valores en las posiciones que corresponden a parámetros inicializados.
126
 
127
 
127
 **Ejemplos de encabezados de funciones e invocaciones válidas:**
128
 **Ejemplos de encabezados de funciones e invocaciones válidas:**
128
 
129
 
132
 
133
 
133
     a. `ejemplo(5, 3.3, 12)` Esta invocación asigna el valor 5 a `var1`, el valor 3.3 a `var2`, y el valor 12 a `var3`. 
134
     a. `ejemplo(5, 3.3, 12)` Esta invocación asigna el valor 5 a `var1`, el valor 3.3 a `var2`, y el valor 12 a `var3`. 
134
 
135
 
135
-    b. `ejemplo(5, 3.3)`  Esta invocación envía valores para los primeros dos parámetros y el valor del último parámetro será el valor por defecto asignado en el encabezado. Esto es, los valores de las variables en la función serán: `var1` tendrá 5, `var2` tendrá 3.3, y `var3` tendrá 10.
136
+    b. `ejemplo(5, 3.3)`  Esta invocación envía valores para los primeros dos parámetros y el valor del último parámetro será el valor predeterminado asignado en el encabezado. Esto es, los valores de las variables en la función serán: `var1` tendrá 5, `var2` tendrá 3.3, y `var3` tendrá 10.
136
 
137
 
137
 2. **Encabezado:** `int ejemplo(int var1, float var2=5.0, int var3 = 10)`  Aquí se  inicializa `var2` a 5 y `var3` a 10.
138
 2. **Encabezado:** `int ejemplo(int var1, float var2=5.0, int var3 = 10)`  Aquí se  inicializa `var2` a 5 y `var3` a 10.
138
     
139
     
140
 
141
 
141
     a. `ejemplo(5, 3.3, 12)` Esta invocación asigna el valor 5 a `var1`, el valor 3.3 a `var2`, y el valor 12 a  `var3`. 
142
     a. `ejemplo(5, 3.3, 12)` Esta invocación asigna el valor 5 a `var1`, el valor 3.3 a `var2`, y el valor 12 a  `var3`. 
142
 
143
 
143
-    b. `ejemplo(5, 3.3)` En esta invocación solo se envían valores para los primeros dos parámetros, y el valor del último parámetro es el valor por defecto.  Esto es, el valor de `var1` dentro de la función será 5, el de `var2` será 3.3 y el de `var3` será 10.
144
+    b. `ejemplo(5, 3.3)` En esta invocación solo se envían valores para los primeros dos parámetros, y el valor del último parámetro es el valor predeterminado.  Esto es, el valor de `var1` dentro de la función será 5, el de `var2` será 3.3 y el de `var3` será 10.
144
 
145
 
145
-    c. `ejemplo(5)` En esta invocación solo se envía valor para el primer parámetro, y los últimos dos parámetros tienen valores por defecto.  Esto es,  el valor de `var1` dentro de la función será 5, el de `var2` será 5.0 y el de `var3` será 10.
146
+    c. `ejemplo(5)` En esta invocación solo se envía valor para el primer parámetro, y los últimos dos parámetros tienen valores predeterminados.  Esto es,  el valor de `var1` dentro de la función será 5, el de `var2` será 5.0 y el de `var3` será 10.
146
 
147
 
147
     
148
     
148
 
149
 
153
 
154
 
154
     **Invocación:** 
155
     **Invocación:** 
155
 
156
 
156
-    a. `ejemplo(5, ,10)` Esta invocación  es **inválida** porque   deja espacio vacío en el argumento del medio. 
157
+      a. `ejemplo(5, ,10)` Esta invocación  es **inválida** porque   deja espacio vacío en el argumento del medio. 
157
 
158
 
158
-    b. `ejemplo()` Esta invocación es **inválida** ya que `var1` no estaba inicializada y no recibe ningún valor en la invocación.
159
+      b. `ejemplo()` Esta invocación es **inválida** ya que `var1` no estaba inicializada y no recibe ningún valor en la invocación.
159
 
160
 
160
 **Ejemplos de encabezados de funciones inválidos:**
161
 **Ejemplos de encabezados de funciones inválidos:**
161
 
162
 
162
-1. `int ejemplo(int var1=1, float var2, int var3)` Este encabezado es inválido porque los valores por defecto solo se pueden asignar comenzando por el parámetro más a la derecha.
163
+1. `int ejemplo(int var1=1, float var2, int var3)` Este encabezado es inválido porque los valores predeterminados sólo se pueden asignar comenzando por el parámetro más a la derecha.
163
 
164
 
164
 2. `int ejemplo(int var1=1, float var2, int var3=10)` Este encabezado es inválido porque no se pueden poner parámetros sin valores en medio de parámetros con valores por defecto. En este caso  `var2` no tiene valor pero `var1` y `var3` si.
165
 2. `int ejemplo(int var1=1, float var2, int var3=10)` Este encabezado es inválido porque no se pueden poner parámetros sin valores en medio de parámetros con valores por defecto. En este caso  `var2` no tiene valor pero `var1` y `var3` si.
165
 
166
 
169
 
170
 
170
 ##Películas DVD y base de datos DVD
171
 ##Películas DVD y base de datos DVD
171
 
172
 
172
-DVD son las siglas para “digital versatile disk” o “digital video disk” que en español significa disco versátil digital o disco de video digital. Este  es un formato de disco óptico para almacenamiento digital  inventado por Philips, Sony, Toshiba, y Panasonic en 1995.  Los DVD ofrecen capacidad de almacenamiento mayor que los discos compactos (CD), pero tienen las mismas dimensiones.  Los DVD pueden ser utilizados para almacenar cualquier dato digital, pero son famosos por su uso en la distribución de películas en los hogares.
173
+DVD son las siglas para “digital versatile disk” o “digital video disk” que en español significa disco versátil digital o disco de video digital. Este es un formato de disco óptico para almacenamiento digital  inventado por Philips, Sony, Toshiba, y Panasonic en 1995.  Los DVD ofrecen una capacidad de almacenamiento mayor que los discos compactos (CD), pero tienen las mismas dimensiones.  Los DVD pueden ser utilizados para almacenar cualquier dato digital, pero son famosos por su uso en la distribución de películas en los hogares.
173
 
174
 
174
 
175
 
175
 ---
176
 ---
177
 ---
178
 ---
178
 
179
 
179
 
180
 
180
-!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-01.html"
181
+!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-01.html"
181
 <br>
182
 <br>
182
 
183
 
183
-!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-03.html"
184
+!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-03.html"
184
 <br>
185
 <br>
185
 
186
 
186
-!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-11.html"
187
+!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-11.html"
187
 <br>
188
 <br>
188
 
189
 
189
-!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-12.html"
190
+!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-12.html"
190
 <br>
191
 <br>
191
 
192
 
192
 ---
193
 ---
209
 
210
 
210
 ###Ejercicio 1
211
 ###Ejercicio 1
211
 
212
 
212
-El primer paso en esta experiencia de laboratorio es familiarizarte con las funciones que ya están definidas en el código. Tus tareas requerirán que imites lo que hacen estas funciones, así que es importante que entiendas como se invocan, declaran y definen.
213
+El primer paso en esta experiencia de laboratorio es familiarizarte con las funciones que ya están definidas en el código. Tus tareas requerirán que imites lo que hacen estas funciones, así que es importante que entiendas cómo se invocan, declaran y definen.
213
 
214
 
214
 **Instrucciones**
215
 **Instrucciones**
215
 
216
 
216
-1.  Carga a Qt el proyecto `DVDInfo`  haciendo doble "click" en el archivo `DVDInfo.pro` que se encuentra en la carpeta `Documents/eip/Functions-DVDInfo` de tu computadora. También puedes ir a `http://bitbucket.org/eip-uprrp/functions-dvdinfo` para descargar la carpeta `Functions-DVDInfo` a tu computadora.
217
+1.  Carga a `QtCreater` el proyecto `DVDInfo`. Hay dos maneras de hacer esto: 
218
+
219
+		* Utilizando la máquina virtual:  Haz doble “click” en el archivo `DVDInfo.pro` que se encuentra en el directorio `home\eip\labs\functions-dvdinfo` de la máquina virtual. 
220
+		* Descargando la carpeta del proyecto de `Bitbucket`: Utiliza un terminal y escribe el comando `git clone http://bitbucket.org/eip-uprrp/functions-dvdinfo` para descargar la carpeta `functions-dvdinfo` de `Bitbucket`. En esa carpeta, haz doble “click” en el archivo `DVDInfo.pro`. 
217
 
221
 
218
 2. Configura el proyecto. El archivo `main.cpp` tiene la invocación de las funciones que usarás en los siguientes ejercicios.  En los archivos `movie.h` y `movie.cpp` se encuentra la declaración y definición de las funciones que vas a invocar.
222
 2. Configura el proyecto. El archivo `main.cpp` tiene la invocación de las funciones que usarás en los siguientes ejercicios.  En los archivos `movie.h` y `movie.cpp` se encuentra la declaración y definición de las funciones que vas a invocar.
219
  
223
  
232
 
236
 
233
 ----
237
 ----
234
 
238
 
235
-!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-06.html"
239
+!INCLUDE "../../eip-diagnostic/DVD/es/diag-dvd-06.html"
236
 <br>
240
 <br>
237
 
241
 
238
 
242
 
246
 
250
 
247
 2. Ahora modifica  la función `main` para que despliegue en la pantalla solo las películas que contengan “forrest gump” en el título.
251
 2. Ahora modifica  la función `main` para que despliegue en la pantalla solo las películas que contengan “forrest gump” en el título.
248
 
252
 
249
-3. Modifica nuevamente la función `main` para que despliegue en la pantalla solo la película en la posición  75125 usando composición de funciones y la función `showMovie`.
253
+3. Modifica nuevamente la función `main` para que despliegue en la pantalla solo la película en la posición 75125 usando la composición de funciones y la función `showMovie`.
250
 
254
 
251
-4. Para la película en la parte  3 de este ejercicio, modifica la función `main` para que solo despliegue el nombre y el rating de la película.
255
+4. Para la película en la parte 3 de este ejercicio, modifica la función `main` para que solo despliegue el nombre y el rating de la película.
252
 
256
 
253
 5. Modifica la función `getMovieInfo` que se encuentra en el archivo `movie.cpp` para que también reciba por referencia el nombre de la película y le asigne un valor. Recuerda que también debes modificar el prototipo de esta función que se encuentra en `movie.h`.
257
 5. Modifica la función `getMovieInfo` que se encuentra en el archivo `movie.cpp` para que también reciba por referencia el nombre de la película y le asigne un valor. Recuerda que también debes modificar el prototipo de esta función que se encuentra en `movie.h`.
254
 
258
 
256
 
260
 
257
 ###Ejercicio 3
261
 ###Ejercicio 3
258
 
262
 
259
-Las funciones cuyos prototipos están en `movie.h` están implementadas en el archivo `movie.cpp`. En este ejercicio  vas a utilizar los archivos `movie.h`, `movie.cpp`, y `main.cpp` para definir e implementar funciones adicionales. Al implementar las funciones, recuerda utilizar buenas prácticas de programación y documentar tu programa.
263
+Las funciones cuyos prototipos están en `movie.h` están implementadas en el archivo `movie.cpp`. En este ejercicio vas a utilizar los archivos `movie.h`, `movie.cpp`, y `main.cpp` para definir e implementar funciones adicionales. Al implementar las funciones, recuerda utilizar buenas prácticas de programación y documentar tu programa.
260
 
264
 
261
 **Instrucciones**
265
 **Instrucciones**
262
 
266
 
263
 1. Estudia las funciones que ya están implementadas en `movie.cpp` para que te sirvan de ejemplo para las funciones que vas a crear. 
267
 1. Estudia las funciones que ya están implementadas en `movie.cpp` para que te sirvan de ejemplo para las funciones que vas a crear. 
264
 
268
 
265
-2. Implementa una función `getMovieStudio` que reciba una cadena de caracteres ("string") con la info de una película y devuelva el nombre del estudio de la película. Recuerda añadir el prototipo de la función en el archivo `movie.h`. Invoca la función `getMovieStudio` desde `main()` para desplegar el nombre y el estudio de la película en la posición 75125 y así demostrar su funcionamiento.
269
+2. Implementa una función llamada `getMovieStudio` que reciba una cadena de caracteres ("string") con la info de una película y devuelva el nombre del estudio de la película. Recuerda añadir el prototipo de la función en el archivo `movie.h`. Invoca la función `getMovieStudio` desde `main()` para desplegar el nombre y el estudio de la película en la posición 75125 y así demostrar su funcionamiento.
266
 
270
 
267
 3. Implementa una función sobrecargada `getMovieInfo` que devuelva el nombre del estudio además del nombre, rating, año y género. Invoca la función `getMovieInfo` desde `main()` para desplegar el nombre,  estudio, rating, año y género de la película en la posición 75125 y así demostrar su funcionamiento.
271
 3. Implementa una función sobrecargada `getMovieInfo` que devuelva el nombre del estudio además del nombre, rating, año y género. Invoca la función `getMovieInfo` desde `main()` para desplegar el nombre,  estudio, rating, año y género de la película en la posición 75125 y así demostrar su funcionamiento.
268
 
272
 
269
-4. Implementa una función `showMovieInLine` que **despliegue** la información de una película que despliega `showMovie` pero en una sola línea. La función debe tener un parámetro de modo que reciba el "string" de información de la película. Invoca la función `showMovieInLine` desde `main()` para desplegar la información de la película en la posición 75125 y así demostrar su funcionamiento.
273
+4. Implementa una función `showMovieInLine` que **despliegue** la información que despliega `showMovie` pero en una sola línea. La función debe tener un parámetro de modo que reciba el "string" de información de la película. Invoca la función `showMovieInLine` desde `main()` para desplegar la información de la película en la posición 75125 y así demostrar su funcionamiento.
270
 
274
 
271
 5. Implementa una función `showMoviesInLine` que **despliegue** la misma información que despliega `showMovies`  (todas las películas en un rango de posiciones) pero en una sola línea por película. Por ejemplo, una invocación a la función sería
275
 5. Implementa una función `showMoviesInLine` que **despliegue** la misma información que despliega `showMovies`  (todas las películas en un rango de posiciones) pero en una sola línea por película. Por ejemplo, una invocación a la función sería
272
 `showMoviesInLine(file, 148995, 149000);`. Invoca la función `showMoviesInLine` desde `main()` para desplegar la información y así demostrar su funcionamiento.
276
 `showMoviesInLine(file, 148995, 149000);`. Invoca la función `showMoviesInLine` desde `main()` para desplegar la información y así demostrar su funcionamiento.
300
 ---
304
 ---
301
 
305
 
302
 ---
306
 ---
307
+
308
+
309
+