2
Module main()
Call getCalories()
End Module
Module getCalories()
Declare Real calories
Display "How many calories are in the first food?"
Input calories
Declare Real calories
Display "How many calories are in the second food?"
Input calories
End Module
The variable calories is declared twice in the module getCalories(). You cannot have two variables with the same name in the same scope. It will cause an error.
3. You can't normally pass a non-variable argument into a reference variable. It causes an error.
4 There is a data type mismatch between the 2nd argument being passed to the module raiseToPower() which is of the type Real and the data type of the parameter variable which is Integer. Arguments and parameter variables must be of the same data type.