Keywords:
IF, INPUT, PRINT, AND, OR, NOT
(Upper case)
list.sort = sort list
Variable names:
(lower or mixed case)
Assigning a value to a variable:
= (for assignment)
== (for equality)
One should write pseudocode in standard english.
Identifier is another word for variable.
Example answer:
DeliverCharge == £5.00 #defining
DeliverCharge == £5.00 #defining
WeightExtraCost = AddVolumeCost = 0
FOR TotalWeight
IF TotalWeight > 1.0kg
RemainingWeight = TotalWeight -1.0kg
WeightExtraCost = floor(RemainingWeight/0.1)*£0.50
For TotalVolume
IF TotalVolume > 1000cm^3
ExtraVolume = TotalVolume – 1000
AddVolumeCost = floor(ExtraVolume/0.2)*£0.50
OUTPUT DeliverCharge + AddVolumeCost + WeightExtraCost #result
No comments:
Post a Comment