Difference between revisions of "2022 Paper 1 Revision Quiz"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
Line 24: Line 24:
 
{Look at this sample code:
 
{Look at this sample code:
  
 +
<nowiki>
 
  public int Fact(int num)
 
  public int Fact(int num)
 
  {
 
  {
Line 31: Line 32:
 
       return num * Fact(num-1);
 
       return num * Fact(num-1);
  
  <nowiki>}</nowiki>
+
  }</nowiki>
  
 
|type="()"}
 
|type="()"}
 
</quiz>
 
</quiz>

Revision as of 09:20, 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

Look at this sample code:
 public int Fact(int num)
 {
   if (num == 0)
       return 1;
   else
       return num * Fact(num-1);

 }

Your score is 0 / 0