Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
Question 87

An algorithm is developed to process sales tax calculations in a retail store.

1      # ----- Global Configuration -----
2      TAX_RATE = 0.20
3
4      # ----- Subprograms -----
5      def calculateTax(price):
6          return price * TAX_RATE
7
8      # ----- Main Program -----
9      itemPrice = float(input("Enter item price in £: "))
10     totalTax = calculateTax(itemPrice)
11     print("Tax to pay is: £", totalTax)

State the name of the computational thinking technique that is demonstrated by breaking down a complex program into smaller, self-contained, and manageable parts such as the calculateTax subprogram interface.

[1]
Markscheme

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking

Question bank