|
@@ -1,4 +1,3 @@
|
1
|
|
-
|
2
|
1
|
# Arithmetic Expressions - Quadratic Frog
|
3
|
2
|
|
4
|
3
|
![main1.png](images/main1.png)
|
|
@@ -52,7 +51,7 @@ $$y = a x^2+ b x + c,$$
|
52
|
51
|
|
53
|
52
|
where $$a, b, c$$ are real numbers and $$a\not=0$$. The graph of a quadratic equation is a *parabola* that opens up if $$a > 0$$ and opens dawn if $$a < 0$$.
|
54
|
53
|
|
55
|
|
-A graph intersects the $$x$$-axis when $$y=0$$. Therefore, if a parabola intersects the $$x$$-axis, the intersects are given by the real solutions to the equation
|
|
54
|
+A graph intersects the $$x$$-axis when $$ y = 0 $$ . Therefore, if a parabola intersects the $$x$$-axis, the intersects are given by the real solutions to the equation
|
56
|
55
|
|
57
|
56
|
|
58
|
57
|
|
|
@@ -64,14 +63,14 @@ The solutions to the previous equation can be obtained using the *quadratic form
|
64
|
63
|
|
65
|
64
|
$$x=\frac{-b±\sqrt{b^2-4ac}}{2a}.$$
|
66
|
65
|
|
67
|
|
-Note that if the *discriminant* $$b^2-4ac$$ of the quadratic formula is negative, the values of $$x$$ are complex numbers and are not plotted in the Cartesian plane. Therefore, if the discriminant is negative, the parabola does not intersect the $$x$$-axis. If the discriminant is equal to $0$, then the parabola intersects the $$x$$-axis in only one point (only the vertex touches the $$x$$-axis).
|
|
66
|
+Note that if the *discriminant* $$b^2-4ac$$ of the quadratic formula is negative, the values of $$x$$ are complex numbers and are not plotted in the Cartesian plane. Therefore, if the discriminant is negative, the parabola does not intersect the $$x$$-axis. If the discriminant is equal to $$0$$, then the parabola intersects the $$x$$-axis in only one point (only the vertex touches the $$x$$-axis).
|
68
|
67
|
|
69
|
68
|
If the discriminant is positive, the quadratic formula gives two solutions to the equation $$0 = a x^2 + b x + c$$ and these solutions are the intersects in the $$x$$-axis. For example, suppose that the quadratic formula gives two values
|
70
|
69
|
|
71
|
70
|
|
72
|
71
|
|
73
|
|
-$$x=x_1$$
|
74
|
|
-$$x=x_2$$
|
|
72
|
+$$ x = x_1 $$
|
|
73
|
+$$ x = x_2 $$
|
75
|
74
|
|
76
|
75
|
Then,
|
77
|
76
|
|
|
@@ -107,10 +106,13 @@ is a quadratic equation with a parabola that opens down and intersects the $$x$$
|
107
|
106
|
|
108
|
107
|
|
109
|
108
|
!INCLUDE "../../eip-diagnostic/quadratic-frog/en/diag-quadratic-frog-01.html"
|
|
109
|
+<br>
|
110
|
110
|
|
111
|
111
|
!INCLUDE "../../eip-diagnostic/quadratic-frog/en/diag-quadratic-frog-08.html"
|
|
112
|
+<br>
|
112
|
113
|
|
113
|
114
|
!INCLUDE "../../eip-diagnostic/quadratic-frog/en/diag-quadratic-frog-09.html"
|
|
115
|
+<br>
|
114
|
116
|
---
|
115
|
117
|
|
116
|
118
|
---
|
|
@@ -178,6 +180,6 @@ Suppose that all courses in Cheo's University are 3 credits each and have the fo
|
178
|
180
|
|
179
|
181
|
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.
|
180
|
182
|
|
181
|
|
- 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.
|
|
183
|
+ 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.
|
182
|
184
|
|
183
|
185
|
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.
|