Modularisation Ex 4 - A Cube

Created By: M Ritter | Difficulty Level: 3

Description

Write an algorithm that prompts for a value representing the side of a cube from the user. Pass this value to a function that will return the surface area and volume of the cube. Display the results.

Puzzle

Drag from here

  • DISPLAY surfArea
  • INPUT side
  • BEGIN cube(length)
  • DISPLAY vol
  • SET vol, surfArea = CALL cube(side)
  • BEGIN
  • END cube
  • END
  • CALCULATE surfaceArea = 6 x length**2
  • RETURN volume, surfaceArea
  • CALCULATE volume = length **3

Construct your solution here