forked from CPRO-Session1/Assignment5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPart2
More file actions
17 lines (14 loc) · 855 Bytes
/
Part2
File metadata and controls
17 lines (14 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Matthew Danielson
7/5/16
Part 2; Questions
1)
int fxn(int, float, int);
int main(){
int a = 1;
float b = .1;
int c = 1;
fxn(int a, float b, int c);
}
The function needs to be defined before it is fully defined if main comes before it physically in the code.
2) Recursion calls a function within itself until a certain criteria is met. Similarly, whne something is iterated, it goes through commands until a certain criteria is met. Typically, recursion eats up more memory than iteration, but for something like the towers, it is more efficient. However, calling a function takes far more memory than a for loop.
3) A compiler takes the code that we have written, removes the white spaces that we leave in our code. Additionally, it converts our code in higher languages into Assembly, which gives the direct commands to the mechanical computer.