Uploaded by excalibur3349

ExercisesFor1a

advertisement
Exercises
Which of the following formulae can be considered as an algorithm for
computing the area of a triangle with the sides 𝑎, 𝑏, and 𝑐 ?
a. S=
b. S =
c. S =
𝑝 𝑝 − 𝑎 𝑝 − 𝑏 𝑝 − 𝑐 , where 𝑝 =
𝑎+𝑏+𝑐
2
1
𝑏𝑐 sin 𝐴, where 𝐴 is the angle between the
2
1
𝑎ℎ𝑎 , where ℎ𝑎 is the height to the base 𝑎
2
sides 𝑏 and 𝑐
Write a pseudocode for an algorithm for finding real roots of an
equation 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0. (you may assume the availability of a
square root function 𝑠𝑞𝑟𝑡(𝑥)
Download