Parcourir la source

README updated as in Gdocs

Jose Ortiz il y a 9 ans
Parent
révision
9714905571
1 fichiers modifiés avec 92 ajouts et 88 suppressions
  1. 92
    88
      README.md

+ 92
- 88
README.md Voir le fichier

@@ -1,9 +1,8 @@
1
-[English](#markdown-header-arithmetic-expressions-pretty-plots) | [Español](#markdown-header-expresiones-aritmeticas-graficas-bonitas)
1
+[English](#markdown-header-arithmetic-expressions-pretty-plots) | [Español](#markdown-header-expresiones-aritmeticas-grafico-bello)
2 2
 
3 3
 #Expresiones aritméticas - Gráficas Bonitas
4 4
 
5 5
 
6
-
7 6
 ![rsz_heart.png](images/rsz_heart.png)
8 7
 ![rsz_mariposa1.png](images/rsz_mariposa1.png)
9 8
 ![rsz_mariposa.png](images/rsz_mariposa.png)
@@ -40,58 +39,54 @@ Antes de llegar al laboratorio debes:
40 39
 
41 40
 3. Haber tomado el quiz Pre-Lab que se encuentra en Moodle.
42 41
 
42
+---
43
+---
43 44
 
44 45
 ##Ecuaciones paramétricas
45 46
 
46
-Las *ecuaciones paramétricas* nos permiten representar una cantidad como función de una o más variables independientes llamadas *parámetros*. En muchas ocasiones resulta útil representar curvas utilizando un conjunto de ecuaciones paramétricas que expresen las coordenadas de los puntos de la curva como funciones de los parámetros. Por ejemplo, en tu curso de trigonometría debes haber estudiado que la ecuación de un círculo con radio $$r$$ y centro en el origen tiene una forma así: 
47
+Las *ecuaciones paramétricas* nos permiten representar una cantidad como función de una o más variables independientes llamadas *parámetros*. En muchas ocasiones resulta útil representar curvas utilizando un conjunto de ecuaciones paramétricas que expresen las coordenadas de los puntos de la curva como funciones de los parámetros. Por ejemplo, en tu curso de trigonometría debes haber estudiado que la ecuación de un círculo con radio $r$ y centro en el origen tiene una forma así: 
47 48
 
48 49
 $$x^2+y^2=r^2.$$
49 50
 
50 51
 
51
-Los puntos $$(x,y)$$ que satisfacen esta ecuación son los puntos que forman el círculo de radio $$r$$ y centro en el origen.  Por ejemplo, el círculo con $$r=2$$ y centro en el origen tiene ecuación
52
+Los puntos $(x,y)$ que satisfacen esta ecuación son los puntos que forman el círculo de radio $r$ y centro en el origen.  Por ejemplo, el círculo con $r=2$ y centro en el origen tiene ecuación
52 53
 
53 54
 $$x^2+y^2=4,$$
54 55
 
55
-y sus puntos son los pares ordenados $$(x,y)$$ que satisfacen esa ecuación. Una forma paramétrica de expresar las coordenadas de los puntos de el círculo con radio $$r$$ y centro en el origen es: 
56
+y sus puntos son los pares ordenados $(x,y)$ que satisfacen esa ecuación. Una forma paramétrica de expresar las coordenadas de los puntos de el círculo con radio $r$ y centro en el origen es: 
56 57
 
57 58
 $$x=r \cos(t)$$
58 59
 
59 60
 $$y=r \sin(t),$$
60 61
 
61
-donde $$t$$ es un parámetro que corresponde a la medida (en radianes) del ángulo positivo con lado inicial que coincide con la parte positiva del eje de $$x$$, y lado terminal que contiene el punto $$(x,y)$$, como se muestra en la Figura 1.
62
+donde $t$ es un parámetro que corresponde a la medida (en radianes) del ángulo positivo con lado inicial que coincide con la parte positiva del eje de $x$, y lado terminal que contiene el punto $(x,y)$, como se muestra en la Figura 1.
62 63
 
63 64
 
64 65
 ---
65 66
 
66 67
 ![figura1.jpg](images/figura1.jpg)
67 68
 
68
-<b>Figura 1.</b> Círculo con centro en el origen y radio $$r$$.
69
+<b>Figura 1.</b> Círculo con centro en el origen y radio $r$.
69 70
 
70 71
 
71 72
 
72 73
 ---
73 74
 
74
-Para graficar una curva que está definida usando ecuaciones paramétricas, computamos los valores de $$x$$ y $$y$$ para un conjunto de valores del parámetro. Por ejemplo, para $$r = 2$$, algunos de los valores son
75
+Para graficar una curva que está definida usando ecuaciones paramétricas, computamos los valores de $x$ y $y$ para un conjunto de valores del parámetro. Por ejemplo, para $r = 2$, algunos de los valores son
75 76
 
76 77
 ---
77 78
 
78
-| $$t$$ | $$x$$ | $$y$$ |
79
+| $t$ | $x$ | $y$ |
79 80
 |-----|-----|-----|
80
-| $$0$$ | $$2$$ | $$0$$ |
81
-| $$\frac{\pi}{4}$$ | $$\frac{\sqrt{2}}{2}$$ | $$\frac{\sqrt{2}}{2}$$ |
82
-| $$\frac{\pi}{2}$$ | $$0$$ | $$2$$ |
83
-
84
-
85
-**Figura 2.** Algunas coordenadas de los puntos $$(x,y)$$ del círculo con radio $$r=2$$ y centro en el origen.
81
+| $0$ | $2$ | $0$ |
82
+| $\frac{\pi}{4}$ | $\frac{\sqrt{2}}{2}$ | $\frac{\sqrt{2}}{2}$ |
83
+| $\frac{\pi}{2}$ | $0$ | $2$ |
86 84
 
87 85
 
88
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-01.html"
86
+**Figura 2.** Algunas coordenadas de los puntos $(x,y)$ del círculo con radio $r=2$ y centro en el origen.
89 87
 
90
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-02.html"
91
-
92
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-03.html"
93
-
94
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-04.html"
88
+---
89
+---
95 90
 
96 91
 ##Sesión de laboratorio:
97 92
 
@@ -113,9 +108,9 @@ En este ejercicio graficarás algunas ecuaciones paramétricas que generan curva
113 108
 
114 109
 	---
115 110
 
116
-3. El archivo `main.cpp` (en Sources) contiene la función `main()` donde estarás añadiendo código. Abre ese archivo y estudia el código. La línea `XYPlotWindow wLine;` crea el objeto `wLine` que será la ventana en donde se dibujará una gráfica, en este caso la gráfica de un segmento. Observa el ciclo `for`. En este ciclo se genera una serie de valores para $$t$$ y se computa un valor de $$x$$ y $$y$$ para cada valor de $$t$$. Cada par ordenado $$(x,y)$$  es añadido a la gráfica del segmento por el método `AddPointToGraph(x,y)`. Luego del ciclo se invoca el método `Plot()`, que "dibuja" los puntos, y el método `show()`, que muestra la gráfica. Los *métodos* son funciones que nos permiten trabajar con los datos de los objetos. Nota que cada uno de los métodos se escribe luego de `wLine`, seguido de un punto. En una experiencia de laboratorio posterior aprenderás más sobre objetos y practicarás como crearlos e invocar sus métodos.
111
+3. El archivo `main.cpp` (en Sources) contiene la función `main()` donde estarás añadiendo código. Abre ese archivo y estudia el código. La línea `XYPlotWindow wLine;` crea el objeto `wLine` que será la ventana en donde se dibujará una gráfica, en este caso la gráfica de un segmento. Observa el ciclo `for`. En este ciclo se genera una serie de valores para $t$ y se computa un valor de $x$ y $y$ para cada valor de $t$. Cada par ordenado $(x,y)$  es añadido a la gráfica del segmento por el método `AddPointToGraph(x,y)`. Luego del ciclo se invoca el método `Plot()`, que "dibuja" los puntos, y el método `show()`, que muestra la gráfica. Los *métodos* son funciones que nos permiten trabajar con los datos de los objetos. Nota que cada uno de los métodos se escribe luego de `wLine`, seguido de un punto. En una experiencia de laboratorio posterior aprenderás más sobre objetos y practicarás como crearlos e invocar sus métodos.
117 112
 
118
-	Las expresiones que tiene tiene tu programa para $$x$$ y $$y$$  son ecuaciones paramétricas  para la línea que pasa por el origen y tiene el mismo valor para las  coordenadas en $$x$$ y $$y$$. Explica por qué la línea solo va desde 0 hasta aproximadamente 6.
113
+	Las expresiones que tiene tiene tu programa para $x$ y $y$  son ecuaciones paramétricas  para la línea que pasa por el origen y tiene el mismo valor para las  coordenadas en $x$ y $y$. Explica por qué la línea solo va desde 0 hasta aproximadamente 6.
119 114
 
120 115
 4.	Ahora escribirás el código necesario para graficar un círculo. La línea `XYPlotWindow wCircle;` crea el objeto `wCircle` para la ventana donde se graficará el círculo. Usando como inspiración el código para graficar el segmento, escribe el código necesario para que tu  programa grafique un círculo de radio 3 con centro en el origen.  Ejecuta tu programa y, si es necesario, modifica el código hasta que obtengas la gráfica correcta. Recuerda que el círculo debe graficarse dentro del objeto `wCircle`. Por esto, al invocar los métodos `AddPointToGraph(x,y)`, `Plot` y `show`, éstos deben ser precedidos por `wCircle`, por ejemplo, `wCircle.show()`.
121 116
 
@@ -123,25 +118,27 @@ En este ejercicio graficarás algunas ecuaciones paramétricas que generan curva
123 118
 
124 119
 	$$x=16 \sin^3(t)$$
125 120
 	$$y=13 \cos(t) - 5 \cos(2t) - 2 \cos(3t) - \cos(4t)-3.$$
126
-    
121
+
122
+
127 123
 	Si implementas las expresiones correctamente debes ver la imagen de un corazón.  Esta gráfica debe haber sido obtenida dentro de un objeto `XYPlotWindow` llamado `wHeart`.
128 124
 
129 125
 6. Ahora graficarás una curva cuyas ecuaciones paramétricas son:
130 126
 
131 127
 	$$x=5\cos(t) \left[ \sin^2(1.2t) + \cos^3(6t) \right]$$
132 128
 	$$y= 10\sin(t) \left[ \sin^2(1.2t) +  \cos^3(6t) \right].$$
133
-     
134
-	Observa que ambas expresiones son casi iguales, excepto que una comienza con $$5\cos(t)$$ y la otra con $$10\sin(t)$$. En lugar de realizar el cómputo de $$ \sin^2(1.2t) + \cos^3(6t)$$ dos veces, puedes asignar su valor a otra variable $$q$$ y realizar el cómputo así:
129
+
130
+
131
+	Observa que ambas expresiones son casi iguales, excepto que una comienza con $5\cos(t)$ y la otra con $10\sin(t)$. En lugar de realizar el cómputo de $ \sin^2(1.2t) + \cos^3(6t)$ dos veces, puedes asignar su valor a otra variable $q$ y realizar el cómputo así:
135 132
 
136 133
 	$$q =  \sin^2(1.2t) + \cos^3(6t)$$
137 134
 	$$x = 5 \cos(t)(q)$$
138 135
 	$$y = 10  \sin(t)(q).$$
139
-    
136
+
137
+	
140 138
 	Implementa las expresiones de arriba, cambia la condición de terminación del `for` a `t < 16*M_PI` y observa la gráfica que resulta. Se supone que parezca una mariposa. Esta gráfica debe haber sido obtenida dentro de un objeto `XYPlotWindow` llamado `wButterfly`.
141 139
 
142 140
 7. Entrega el archivo `main.cpp` que contiene el código con las ecuaciones paramétricas de las gráficas del círculo, el corazón y la mariposa utilizando   "Entrega 1" en Moodle. Recuerda utilizar buenas prácticas de programación, incluir el nombre de los programadores y documentar tu programa.
143 141
 
144
-
145 142
 En [3] puedes encontrar otras ecuaciones paramétricas de otras curvas interesantes.
146 143
 
147 144
 
@@ -149,32 +146,30 @@ En [3] puedes encontrar otras ecuaciones paramétricas de otras curvas interesan
149 146
 
150 147
 En este ejercicio escribirás un  programa para obtener el promedio de puntos para la nota de un estudiante.
151 148
 
152
-Supón que todos los cursos en la Universidad de Yauco son de $$3$$ créditos y que las notas tienen las siguientes puntuaciones: $$A = 4$$ puntos por crédito; $$B = 3$$ puntos por crédito; $$C = 2$$ puntos por crédito; $$D = 1$$ punto por crédito y $$F = 0$$ puntos por crédito. 
153
-
154
----
155
-
156
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-05.html"
157
-
158
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-06.html"
159
-
160
-!INCLUDE "../../eip-diagnostic/pretty-plots/es/diag-pretty-plots-07.html"
149
+Supón que todos los cursos en la Universidad de Yauco son de $3$ créditos y que las notas tienen las siguientes puntuaciones: $A = 4$ puntos por crédito; $B = 3$ puntos por crédito; $C = 2$ puntos por crédito; $D = 1$ punto por crédito y $F = 0$ puntos por crédito. 
161 150
 
162 151
 **Instrucciones**
163 152
 
164 153
 1. Crea un nuevo proyecto "Non-Qt" llamado Promedio. Tu función `main()`  contendrá el código necesario para pedirle al usuario el número de A's, B's, C's, D's y F's obtenidas por el estudiante y computar el promedio de puntos para la nota (GPA por sus siglas en inglés).
165 154
 
166
-2. Tu código debe definir las constantes $$A=4, B=3, C=2, D=1, F=0$$ para la puntuación de las notas, y pedirle al usuario que entre los valores para las variables $$NumA$$, $$NumB$$, $$NumC$$, $$NumD$$, $$NumF$$. La variable $$NumA$$ representará el número de cursos en los que el estudiante obtuvo $$A$$,  $$NumB$$ representará el número de cursos en los que el estudiante obtuvo $$B$$, etc. El programa debe desplegar el GPA del estudiante en una escala de 0 a 4 puntos. 
155
+2. Tu código debe definir las constantes $A=4, B=3, C=2, D=1, F=0$ para la puntuación de las notas, y pedirle al usuario que entre los valores para las variables $NumA$, $NumB$, $NumC$, $NumD$, $NumF$. La variable $NumA$ representará el número de cursos en los que el estudiante obtuvo $A$,  $NumB$ representará el número de cursos en los que el estudiante obtuvo $B$, etc. El programa debe desplegar el GPA del estudiante en una escala de 0 a 4 puntos. 
156
+
157
+
167 158
 
168 159
 	**Ayudas:** 
169
-    
160
+
170 161
 	1. El promedio se obtiene sumando las puntuaciones  correspondientes a las notas obtenidas (por ejemplo, una A en un curso de 3 créditos tiene una puntuación de 12), y dividiendo esa suma por el número total de créditos.
171
-    
162
+
172 163
 	2. Recuerda que, en C++, si divides dos números enteros el resultado se "truncará" y será un número entero. Utiliza "type casting": `static_cast\<tipo\>(expresión)' para resolver este problema.
173 164
 
174 165
 3. Verifica tu programa calculando el promedio de un estudiante que tenga dos A y dos B; ¿qué nota tendría este estudiante, A o B (la A va desde 3.5 a 4.0)?. Cuando tu programa esté correcto, guarda el archivo `main.cpp` y entrégalo  utilizando  "Entrega 2" en Moodle. Recuerda seguir las instrucciones en el uso de nombres y tipos para las variables,  incluir el nombre de los programadores, documentar tu programa y utilizar buenas prácticas de programación. 
175 166
 
176 167
 
177 168
 
169
+
170
+---
171
+---
172
+
178 173
 ##Referencias:
179 174
 
180 175
 [1] http://mathworld.wolfram.com/ParametricEquations.html
@@ -187,7 +182,7 @@ Supón que todos los cursos en la Universidad de Yauco son de $$3$$ créditos y
187 182
 ---
188 183
 ---
189 184
 
190
-[English](#markdown-header-arithmetic-expressions-pretty-plots) | [Español](#markdown-header-expresiones-aritmeticas-graficas-bonitas)
185
+[English](#markdown-header-arithmetic-expressions-pretty-plots) | [Español](#markdown-header-expresiones-aritmeticas-grafico-bello)
191 186
 
192 187
 #Arithmetic Expressions - Pretty Plots
193 188
 
@@ -225,60 +220,59 @@ Before you get to the laboratory you should have:
225 220
 
226 221
 3. Taken the Pre-Lab quiz that can be found in Moodle.
227 222
 
223
+---
224
+---
225
+
228 226
 
229 227
 ## Parametric Equations
230 228
 
231
-*Parametric equations* allow us to represent a quantity as a function of one or more independent variables called *parameters*. In many occasions it is useful to represent curves using a set of parametric equations that express the coordinates of the points of the curve as functions of the parameters. For example, in your trigonometry course you should have studied that the equation of the circle of radius $$r$$ and centered at the origin has the following form:
229
+*Parametric equations* allow us to represent a quantity as a function of one or more independent variables called *parameters*. In many occasions it is useful to represent curves using a set of parametric equations that express the coordinates of the points of the curve as functions of the parameters. For example, in your trigonometry course you should have studied that the equation of the circle of radius $r$ and centered at the origin has the following form:
230
+
232 231
 
233 232
 $$x^2+y^2=r^2.$$
234 233
 
235
-The points $$(x,y)$$ that satisfy this equation are the points that form the circle of radius $$r$$ and center at the origin. For example, the circle with $$r=2$$ and center at the origin has equation
234
+The points $(x,y)$ that satisfy this equation are the points that form the circle of radius $r$ and center at the origin. For example, the circle with $r=2$ and center at the origin has equation
235
+
236 236
 
237 237
 $$x^2+y^2=4,$$
238 238
 
239
-and its points are the ordered pairs $$(x,y)$$ that satisfy this equation. A parametric representation of the coordinates of the points in the circle of radius $$r$$ and center at the origin is:
239
+and its points are the ordered pairs $(x,y)$ that satisfy this equation. A parametric representation of the coordinates of the points in the circle of radius $r$ and center at the origin is:
240
+
241
+
240 242
 
241 243
 $$x=r \cos(t)$$
242 244
 
243 245
 $$y=r \sin(t),$$
244 246
 
245
-where $$t$$ is a parameter that corresponds to the measure (in radians) of the positive angle  with initial side that coincides with the positive part of the $$x$$-axis and terminal side that contains the point $$(x,y)$$, as it is illustrated in Figure 1.
247
+where $t$ is a parameter that corresponds to the measure (in radians) of the positive angle  with initial side that coincides with the positive part of the $x$-axis and terminal side that contains the point $(x,y)$, as it is illustrated in Figure 1.
246 248
 
247 249
 
248 250
 ---
249 251
 
250 252
 ![figura1.jpg](images/figura1.jpg)
251 253
 
252
-<b>Figure 1.</b> Circle of radius $$r$$ and centered at the origin.
254
+<b>Figure 1.</b> Circle of radius $r$ and centered at the origin.
253 255
 
254 256
 
255 257
 
256 258
 ---
257 259
 
258
-To plot a curve that is described  by parametric equations, we compute the $$x$$ and $$y$$ values for a set of values of the parameter. For example, for $$r=2$$, some of the values are
260
+To plot a curve that is described  by parametric equations, we compute the $x$ and $y$ values for a set of values of the parameter. For example, for $r=2$, some of the values are
259 261
 
260 262
 
261 263
 ---
262 264
 
263
-| $$t$$ | $$x$$ | $$y$$ |
265
+| $t$ | $x$ | $y$ |
264 266
 |-----|-----|-----|
265
-| $$0$$ | $$2$$ | $$0$$ |
266
-| $$\frac{\pi}{4}$$ | $$\frac{\sqrt{2}}{2}$$ | $$\frac{\sqrt{2}}{2}$$ |
267
-| $$\frac{\pi}{2}$$ | $$0$$ | $$2$$ |
267
+| $0$ | $2$ | $0$ |
268
+| $\frac{\pi}{4}$ | $\frac{\sqrt{2}}{2}$ | $\frac{\sqrt{2}}{2}$ |
269
+| $\frac{\pi}{2}$ | $0$ | $2$ |
268 270
 
269 271
 
270
-**Figure 2.** Some of the coordinates of the points $$(x,y)$$ of the circle of radius $$r=2$$ and centered at the origin.
272
+**Figure 2.** Some of the coordinates of the points $(x,y)$ of the circle of radius $r=2$ and centered at the origin.
271 273
 
272 274
 ---
273
-
274
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-01.html"
275
-
276
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-02.html"
277
-
278
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-03.html"
279
-
280
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-04.html"
281
-
275
+---
282 276
 
283 277
 ##Laboratory session:
284 278
 
@@ -292,7 +286,7 @@ In this exercise you will plot the graphs of some parametric equations of intere
292 286
 You can also download the folder `Expressions-PrettyPlots` from  `http://bitbucket.org/eip-uprrp/expressions-prettyplots`.
293 287
 
294 288
 2. Configure the project and run the program by clicking the green arrow in the menu on the left side of the Qt Creator window. The program should display a window similar to the one in Figure 3.
295
-    
289
+
296 290
 	---
297 291
 
298 292
 	![figura3.png](images/figura3.png)
@@ -302,35 +296,46 @@ You can also download the folder `Expressions-PrettyPlots` from  `http://bitbuck
302 296
 
303 297
 
304 298
 	---
305
-    
306
-3. The file `main.cpp` (in Sources) contains the function `main()` where you will be adding code. Open this file and study the code. The line  `XYPlotWindow wLine;` creates the object `wLine`, that is the window that will show the plot of a graph, in this case the graph of a segment. Look at the `for` cycle. In this cycle several values for $$t$$ are generated and a value for $$x$$ and $$y$$ is computed for each $$t$$. Each ordered pair $$(x,y)$$ is added to the graph of the segment by the method `AddPointToGraph(x,y)`.  After the cycle, there is a call to the  method  `Plot()`, to "draw" the points in the graph, and to the method `show()`, to show the plot. The *methods* are functions that allow us to work with the data of an object. Note that each of the methods is written after `wLine`, and followed by a period. In a later laboratory experience you will learn more about objects and practice how to create them and invoke their methods.
307
-    
308
-	The expressions for $$x$$ and $$y$$ are parametric equations for the line that passes through the origin and has the same value for $$x$$ and $$y$$. Explain why this line only goes from 0 to approximately 6.
299
+
300
+3. The file `main.cpp` (in Sources) contains the function `main()` where you will be adding code. Open this file and study the code. The line  `XYPlotWindow wLine;` creates the object `wLine`, that is the window that will show the plot of a graph, in this case the graph of a segment. Look at the `for` cycle. In this cycle several values for $t$ are generated and a value for $x$ and $y$ is computed for each $t$. Each ordered pair $(x,y)$ is added to the graph of the segment by the method `AddPointToGraph(x,y)`.  After the cycle, there is a call to the  method  `Plot()`, to "draw" the points in the graph, and to the method `show()`, to show the plot. The *methods* are functions that allow us to work with the data of an object. Note that each of the methods is written after `wLine`, and followed by a period. In a later laboratory experience you will learn more about objects and practice how to create them and invoke their methods.
301
+
302
+	The expressions for $x$ and $y$ are parametric equations for the line that passes through the origin and has the same value for $x$ and $y$. Explain why this line only goes from 0 to approximately 6.
303
+
304
+	
309 305
 
310 306
 4.	You will now write the code needed to plot a circle. The line `XYPlotWindow wCircle;` creates the object `wCircle`  for the window that will contain the plot of the circle. Using as inspiration the code that plotted the segment, write the necessary code for your program to graph a circle of radius 3 and centered at the origin. Run your program and, if it is necessary, modify the code until you get the right plot. Remember that the circle should be plotted inside the `wCircle` object. Thus, when you invoke the `AddPointToGraph(x,y)`, `Plot` and `show` methods, they should be preceeded by `wCircle`; e.g. `wCircle.show()`.
311 307
 
308
+
312 309
 5. Your next task is to plot a curve with the following parametric equations:
313
-    
310
+
311
+
314 312
 	$$x=16 \sin^3(t)$$
315 313
 	$$y=13 \cos(t) - 5 \cos(2t) - 2 \cos(3t) - \cos(4t)-3.$$
316
-    
314
+
315
+
317 316
 	If you implement the equations correctly, you will see the image of a heart. This plot should be obtained inside an `XYPlotWindow` object called `wHeart`.
317
+
318 318
 	
319 319
 6.  You will now plot the curve of the following parametric equations:
320
-    
320
+
321
+
321 322
 	$$x=5\cos(t) \left[ \sin^2(1.2t) + \cos^3(6t) \right]$$
322 323
 	$$y= 10\sin(t) \left[ \sin^2(1.2t) +  \cos^3(6t) \right].$$
323
-    
324
-	Note that both expressions are almost the same, the only difference is that one starts  with $$5\cos(t)$$ and the other with $$10\sin(t)$$. Instead of computing $$\sin^2(1.2t) + \cos^3(6t)$$ twice, you can assign its value to another variable $$q$$ and compute $$x$$ and $$y$$ as follows:
325
-    
324
+
325
+
326
+	Note that both expressions are almost the same, the only difference is that one starts  with $5\cos(t)$ and the other with $10\sin(t)$. Instead of computing $ \sin^2(1.2t) + \cos^3(6t)$ twice, you can assign its value to another variable $q$ and compute $x$ and $y$ as follows:
327
+
328
+
326 329
 	$$q =  \sin^2(1.2t) + \cos^3(6t)$$
327 330
 	$$x = 5 \cos(t)(q)$$
328 331
 	$$y = 10  \sin(t)(q).$$
329
-    
332
+
333
+
330 334
 	Implement the above expressions,  change the condition for termination of the  `for` to   `t < 16*M_PI`, and look at the plot that it is displayed. It should look like a butterfly. This plot should be obtained inside an `XYPlotWindow` object called `wButterfly`.
331 335
 
332
-7. Use "Deliverable 1" in Moodle to submit the file  `main.cpp` containing the code with the parametric equations for the graphs of the circle, the heart, and the butterfly. Remember to use good programming practices, to include the names of the programmers and to document your program.
336
+7. Use "Deliver 1" in Moodle to submit the file  `main.cpp` containing the code with the parametric equations for the graphs of the circle, the heart, and the butterfly. Remember to use good programming practices, to include the names of the programmers and to document your program.
333 337
 
338
+	
334 339
 
335 340
 In [3] you can find other parametric equations of interesting curves.
336 341
 
@@ -340,32 +345,30 @@ In [3] you can find other parametric equations of interesting curves.
340 345
 
341 346
 In this exercise you will write a program to obtain a student's grade point average (GPA).
342 347
 
343
-Suppose that all courses in Cheo's University are 3 credits each and have the following point values: $$A = 4$$ points per credit; $$B = 3$$ points per credit; $$C = 2$$ points per credit; $$D = 1$$ point per credit y $$F = 0$$ points per credit. 
344
-
345
----
346
-
347
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-05.html"
348
-
349
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-06.html"
350
-
351
-!INCLUDE "../../eip-diagnostic/pretty-plots/en/diag-pretty-plots-07.html"
348
+Suppose that all courses in Cheo's University are 3 credits each and have the following point values: $A = 4$ points per credit; $B = 3$ points per credit; $C = 2$ points per credit; $D = 1$ point per credit y $F = 0$ points per credit. 
352 349
 
353 350
 **Instructions**
354 351
 
355 352
 1. Start a new "Non-Qt" project called "Average". Your `main()` function will contain the necessary code to ask the user for the number of A's, B's, C's, D's and F's obtained and compute the grade point average (GPA).
356 353
 
357
-2. Your code should define the constants  $$A=4, B=3, C=2, D=1, F=0$$ for the points per credit, and ask the user to input the values for the variables  $$NumA$$, $$NumB$$, $$NumC$$, $$NumD$$, $$NumF$$. The variable $$NumA$$ represents the number of courses in which the student obtained A, $$NumB$$ represents the number of courses in which the student obtained B, etc. The program should display the GPA using the 0-4 point scale.
358
-    
354
+2. Your code should define the constants  $A=4, B=3, C=2, D=1, F=0$ for the points per credit, and ask the user to input the values for the variables  $NumA$, $NumB$, $NumC$, $NumD$, $NumF$. The variable $NumA$ represents the number of courses in which the student obtained A, $NumB$ represents the number of courses in which the student obtained B, etc. The program should display the GPA using the 0-4 point scale.
355
+
359 356
 	**Hints:** 
360
-     
357
+
361 358
 	1. You can obtain the GPA by adding the credit points corresponding to the grades (for example, an A in a 3 credit course has a value of 12 points), and dividing this sum by the total number of credits.
362
-    
359
+
360
+
363 361
 	2. Remember that, in C++, when both operands in the division are integers, the result will also be an integer; the remainder will be discarded. Use "type casting": `static_cast\<type\>(expression)' to solve this problem.
364 362
 
365
-3. Verify your program by computing the GPA of a student that has two A's and 2 B's; what is the grade of this student, A or B (A goes from 3.5 to 4 points)? When your program is correct, save the `main.cpp` file and submit it using "Deliverable 2" in Moodle. Remember to follow the instructions regarding the names and types of the variables,  to include the names of the programmers, to document your program and to use good programming practices.
363
+3. Verify your program by computing the GPA of a student that has two A's and 2 B's; what is the grade of this student, A or B (A goes from 3.5 to 4 points)? When your program is correct, save the `main.cpp` file and submit it using "Deliver 2" in Moodle. Remember to follow the instructions regarding the names and types of the variables,  to include the names of the programmers, to document your program and to use good programming practices.
364
+
365
+
366 366
 
367 367
 
368 368
 
369
+---
370
+---
371
+
369 372
 ##References:
370 373
 
371 374
 [1] http://mathworld.wolfram.com/ParametricEquations.html
@@ -373,3 +376,4 @@ Suppose that all courses in Cheo's University are 3 credits each and have the fo
373 376
 [2] http://paulbourke.net/geometry/butterfly/
374 377
 
375 378
 [3] http://en.wikipedia.org/wiki/Parametric_equation
379
+