forked from UCMHSProgramming2015/FunctionsChallenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindingMissingSide
More file actions
49 lines (41 loc) · 840 Bytes
/
Copy pathfindingMissingSide
File metadata and controls
49 lines (41 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Name:
findingMisiingSide ()
## Examples:
void draw () {
println (findMissingSide(20, 30, k)){
}
float findMissingSide (float j, float k, char choice) {
float result;
if (choice == 'a') {
result = sqrt(sq(k) - sq(j));
return result;
}
if (choice == 'b'){
result = sqrt(sq(k) - sq(j));
return result;
}
if (choice == 'c'){
result = sqrt(sq(k) + sq(j));
return result;
}
println("Make a valid choice");
return 0;
}
## Description:
The findingMissingSide function is variations of the hypotenuse equations to help the user find the missing side
## Syntax:
float findMissingSide (float j, float k, char choice)
##Parameters:
if choice is 'a'
k= c
j= b
if choice is 'b'
k = c
j = a
if choice is 'c'
k = a
j = b
##Returns:
float
##Other notes:
derived from the equation sq(a)+sq(b) =sq(c)