0
0
Intro to Computingfundamentals~20 mins

Pseudocode for planning in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pseudocode Planning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Pseudocode Purpose

What is the main purpose of writing pseudocode before coding?

ATo plan the steps of a program in simple language without worrying about syntax
BTo create a detailed, executable program that runs on a computer
CTo write the final version of the program in a specific programming language
DTo test the program's performance and speed
Attempts:
2 left
💡 Hint

Think about how pseudocode helps programmers think through problems.

trace
intermediate
2:00remaining
Tracing Pseudocode Execution

Given the following pseudocode, what will be the final value of total?

SET total TO 0
FOR each number FROM 1 TO 4
  ADD number TO total
END FOR
A10
B24
C4
D0
Attempts:
2 left
💡 Hint

Sum the numbers 1 + 2 + 3 + 4 step by step.

Comparison
advanced
2:00remaining
Comparing Pseudocode and Flowchart

Which statement best describes the difference between pseudocode and a flowchart?

AFlowcharts are faster to write than pseudocode.
BPseudocode uses pictures to show steps; flowcharts use words only.
CPseudocode is written in plain text; flowcharts use symbols and arrows to show flow.
DFlowcharts are only used for hardware design; pseudocode is for software.
Attempts:
2 left
💡 Hint

Think about how each method represents the steps of a program.

identification
advanced
2:00remaining
Identifying Errors in Pseudocode

Which option shows pseudocode with a logical error?

Option A:
SET count TO 5
WHILE count > 0
  PRINT count
  DECREMENT count BY 1
END WHILE

Option B:
SET count TO 0
WHILE count < 5
  PRINT count
END WHILE

Option C:
SET total TO 0
FOR i FROM 1 TO 3
  ADD i TO total
END FOR

Option D:
SET x TO 10
IF x > 5 THEN
  PRINT "High"
END IF
AOption A has a logical error because it never stops.
BOption D has a logical error because the condition is always false.
COption C has a logical error because the loop runs backwards.
DOption B has a logical error because count is never changed inside the loop.
Attempts:
2 left
💡 Hint

Look for loops that might never end.

🚀 Application
expert
3:00remaining
Planning with Pseudocode for a Real-World Task

You want to write pseudocode to plan a program that checks if a number is prime. Which pseudocode snippet correctly plans this task?

A
SET number TO input
FOR i FROM 2 TO number
  IF number MOD i EQUALS 0 THEN
    PRINT "Prime"
  ELSE
    PRINT "Not prime"
  END IF
END FOR
B
SET number TO input
FOR i FROM 2 TO number-1
  IF number MOD i EQUALS 0 THEN
    PRINT "Not prime"
    STOP
  END IF
END FOR
PRINT "Prime"
C
SET number TO input
IF number MOD 2 EQUALS 0 THEN
  PRINT "Prime"
ELSE
  PRINT "Not prime"
END IF
D
SET number TO input
FOR i FROM 1 TO number
  PRINT i
END FOR
PRINT "Prime check complete"
Attempts:
2 left
💡 Hint

Think about how to test divisibility to confirm if a number is prime.