Translation Skills (Cambridge (CIE) A Level Computer Science) : Revision Note

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Structured English/Flowchart to Pseudocode

Example - Structured English

A customer is buying an item. If the customer has a discount code, they receive 10% off the price. Otherwise, they pay the full amount. The program should ask for the item price and whether they have a discount code, then calculate and display the final price.

Step 1 - Structured English

  1. Ask the user to enter the price of the item

  2. Ask the user if they have a discount code

  3. If they do have a discount code
     → Calculate 10% off the price
     → Subtract the discount from the original price

  4. Otherwise
     → The price stays the same

  5. Output the final price

Step 2 – Identifier table

Identifier

Description

ItemPrice

Original price of the item

HasDiscount

TRUE if user has a discount code

DiscountAmount

Amount taken off the original price

FinalPrice

Price after discount is applied

Step 3 – Pseudocode

// Ask for item price
INPUT ItemPrice

// Ask if user has a discount code
INPUT HasDiscount

IF HasDiscount = TRUE THEN
    DiscountAmount ← ItemPrice * 0.10
    FinalPrice ← ItemPrice - DiscountAmount
ELSE
    FinalPrice ← ItemPrice
ENDIF

// Output the final price
OUTPUT "The final price is ", FinalPrice

Structured English/Pseudocode to Flowchart

Example - Pseudocode

INPUT Number

IF Number MOD 2 = 0 THEN
    OUTPUT "Even"
ELSE
    OUTPUT "Odd"
ENDIF

Step 1 – Identifier table

Identifier

Description

Number

The number entered by the user

Step 2 – Flowchart structure

Pseudocode statement

Flowchart symbol

Purpose

INPUT Number

Parallelogram (Input/Output)

User enters a number

IF Number MOD 2 = 0

Diamond (Decision)

Checks if the number is divisible by 2

OUTPUT "Even"

Parallelogram (Input/Output)

Displays message if the condition is true

OUTPUT "Odd"

Parallelogram (Input/Output)

Displays message if the condition is false

Start/End

Oval

Denotes beginning and end of the process

Arrows

Lines with arrows

Indicate flow of control

Step 4 - Flowchart

Flowchart to determine if a number is odd or even: start, input number, check if number mod 2 equals 0, output 'Even' or 'Odd', then stop.

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.