Gce Model Questions Vol1 2017 Computer Studies Question 17

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

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

Consider the following Python program:\n\n```python\ndef f(k):\n total = 0\n for i in range(1, k+1):\n if i % 2 == 0:\n total += i // 2\n else:\n total += 3 * i + 1\n return total\n\nn = 10\nresult = f(n) + f(n-1)\nprint(result)\n```\nWhat integer value is printed when the program is executed?

Answer Options

A. 175
Correct Answer B. 185
C. 195
D. 180
Correct Answer
B
Correct Option:
185

About This Question

This is Gce Model Questions Vol1 2017 Computer Studies Question 17. It is one of the objective questions from the 2017 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