Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Develop code

EasyMediumHard
123456789101112131415161718192021222324252627
Question 11

A program is needed to calculate and print a doubling sequence of 6 steps for a starting integer input by the user.

Expected Output

Enter the starting number: 3
Step 1: 3 doubled is 6
Step 2: 6 doubled is 12
Step 3: 12 doubled is 24
Step 4: 24 doubled is 48
Step 5: 48 doubled is 96
Step 6: 96 doubled is 192

Write a program in Python or pseudocode to solve this problem.

Your program must:

  • Ask the user to input a starting integer
  • Use a loop that repeats exactly 6 times
  • Correctly calculate the doubled value for each step
  • Print each step in the format: Step X: Y doubled is Z
  • Update the variable correctly so the next step doubles the previous step's result
[5]

Develop code Questions

  1. IGCSE
  2. /Computer Science
  3. /Develop code