teach-ict.com logo

THE education site for computer science and ICT

Answer: Question 8a


Answer:

Here is the algorithm for the cost of laying the broadband cables:

 

START
OUTPUT "How many people have signed up for the cable?"
NumberOfPeople ← USERINPUT
OUTPUT "How much cable is needed in total?"
LengthOfCable ← USERINPUT
ExtraLength ← LengthOfCable - 1000
IF Extralength ≤ 0 THEN
	Cost ← 5000
ELSE
	Cost ← 5000 + (ExtraLength * 4)
ENDIF
IF NumberOfPeople ≥ 50 THEN
	Cost ← Cost / 2
ENDIF
OUTPUT Cost
END
       

 

Your answer will get 1 point for:

  • Allowing input of the number of people
  • Allowing input of length
  • Calculating the total cost
  • Applying the discount if appropriate
  • Outputting the total cost

The exact language and layout of the pseudocode is up to you. “<=” or “is less than or equal to” are just as good as "≤", and so. Also using different ways to calculate the amount is acceptable, so long as they work!