Page 130 - Mathematics GRADE 9, DE-STREAMED (MTH1W)
P. 130
Then ask:
• What is the same and what is different between the pseudocode and the flow chart?
• Do the pseudocode and the flow chart have the same outcome? Explain why or why not.
emptySpace = 0 volumeCylinder = 0 volumeCone = 0 height = 0
radius = 0
output “Enter the height of the cylinder and the cone.”
store user input as height
output “Enter the radius of the circular base of the cylinder and the cone.”
store user input as radius
volumeCylinder = π * radius^2 * height
volumeCone = volumeCylinder/3
emptySpace = volumeCylinder − volumeCone
output “The empty space in the cylinder that is not occupied by the cone is”, emptySpace, “cubic units.”
Pseudocode does not represent a specific programming language. It can be adapted to work with a variety of programming languages and/or environments.
129