Biology Forums - Study Force

Science-Related Homework Help Computer Studies Topic started by: ian18 on May 5, 2018



Title: What is wrong with the following program segment?MainDeclare Apples As IntegerSet Apples = 4Call ...
Post by: ian18 on May 5, 2018
What is wrong with the following program segment?
      Main
         Declare Apples As Integer
         Set Apples = 4
         Call Snack(Apples)
         Write “You have “ + Apples + “ apples”
         Write “and “ + Oranges + “ oranges”
        End Program
        Subprogram Snack(Fruit)
         Declare Oranges As Integer
         Set Oranges = Fruit + 2
        End Subprogram
a.   you cannot call a subprogram that has only one parameter
b.   you cannot declare variables within a subprogram
c.   you cannot access a variable that has been declared locally within a subprogram outside that subprogram
d.   nothing is wrong with the code segment


Title: Re: What is wrong with the following program segment?MainDeclare Apples As IntegerSet Apples = 4Call ...
Post by: goding on May 5, 2018
Content hidden