Difference between revisions of "2022 Paper 1 Revision Quiz"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
Line 31: Line 31:
 
       return num * Fact(num-1);
 
       return num * Fact(num-1);
  
  }
+
  <nowiki>}</nowiki>
  
 
|type="()"}
 
|type="()"}
 
</quiz>
 
</quiz>

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