1. Create a pseudocode algorithm that will accept the name of the motorists and the type of offence for the ticket. Determine if the tickets will be awarded a demerit point and check the current point(s) each motorist has on his or her licence. Display the updated points for the motorist. If the motorist has over 19 points, his or her licence will be suspended for 2 years. Other suspensions are based on 10 – 13 points for 6 months suspension and 14 – 19 points for 1 year suspension. Store the list of all suspended motorists. Display the names of the suspended motorists and the penalties.

1 answer

Loop {
read name, offence
points = getPoints(name)
demerit = getDemerit(offence)
points++ if (demerit)
if (not demerit) then display("Your lucky day -- no demerit point this time.")
else
if (points > 19) then {display("Get a bike, loser! You now have",points," points."); penalty = "2-year")
else if (points >= 14) then {display("1-year suspension! You now have ",points," points."); penalty = "1-year"}
else if (points >= 10) then {display("6-month suspension! You now have ",points," points."); penalty = "six months"}
else display("Your point total is now ",points)
if points >= 10 then storeSuspended(name,penalty)
}
for each suspendedDriver display(name,penalty)