Difference between revisions of "2022 Paper 1 Revision Quiz"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
Line 22: Line 22:
 
||Incorrect
 
||Incorrect
  
 +
{Look at this sample code:
 
<syntaxhighlight lang=c#>
 
<syntaxhighlight lang=c#>
 
public int Fact(int num)
 
public int Fact(int num)
Line 32: Line 33:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
|type="()"}
 
</quiz>
 
</quiz>

Revision as of 10:17, 2 June 2022

1. In Recursion, the part of the code which runs itself is called?

General Case.
Correct
Base Case.
Incorrect
Repeating Case.
Incorrect
Recursive Case.
Incorrect

2. In Recursion, the condition which stops the recursive calls is called?

General Case.
Correct
Base Case.
Incorrect
Repeating Case.
Incorrect
Recursive Case.
Incorrect

3. Look at this sample code: <syntaxhighlight lang=c#> public int Fact(int num) {

  if (num == 0)
      return 1;
  else
      return num * Fact(num-1);

Your score is 0 / 0