Gce Model Questions Vol1 2021 Computer Studies Question 15

Practice objective / multiple choice question 15 from the 2021 Gce Model Questions Vol1 Computer Studies examination.

Gce Model Questions Vol1 2021 Computer Studies Objective / Multiple Choice Hard Difficulty
Question 15 GCE_MODEL_QUESTIONS_VOL1 • 2021 • COMPUTER_STUDIES • objective

Consider the following Python program intended to compute the sum \(S = 1! + 2! + \dots + n!\):\n\n```python\ndef fact(k):\n if k == 0:\n return 0\n else:\n return k * fact(k-1)\n\ndef series(n):\n total = 0\n for i in range(1, n+1):\n total += fact(i)\n return total\n\nn = int(input())\nprint(series(n))\n```\nThe program is run with input \(n = 5\). Identify the logical error, give the corrected version of the function \(fact\), and state the output produced after the correction.

Answer Options

A. 155
Correct Answer B. 153
C. 144
D. 120
Correct Answer
B
Correct Option:
153

About This Question

This is Gce Model Questions Vol1 2021 Computer Studies Question 15. It is one of the objective questions from the 2021 Gce Model Questions Vol1 Computer Studies examination.

Difficulty level: Hard .

Master the Exam!

You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.

Unlock Full Access Available for Android & Windows
Chat with Support