Skip to content

Course home

Develop code

Develop code

EasyMediumHard
1234567891011121314151617181920212223242526
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]
Markscheme

Develop code Questions

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

62 exam-style questions on Edexcel IGCSE Computer Science Develop code. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank