Ask Question
26 May, 07:40

Find the error in the following pseudocode. Module main () Call raiseToPower (2, 1.5) End Module Module raiseToPower (Real value, Integer power) Declare Real result Set result=value^power Display result End Module

+3
Answers (1)
  1. 26 May, 11:29
    0
    Call raiseToPower (2, 1.5) '

    or

    raiseToPower (Real value, Integer power)

    Explanation:

    To solve this, first organize the pseudo code,

    1) main ()

    2) Call raiseToPower (2, 1.5)

    3) End Module

    4) Module

    5) raiseToPower (Real value, Integer power)

    6) Declare Real result

    7) Set result=value^power

    8) Display result

    9) End Module

    The first three lines in pseudo code are representing the main module. While lines 4-9 shows the definition of module that is being called in main function.

    If we look at the raiseToPower definition at line5, we can see that it is requiring any real value for the base number. However, for power, it defines only integers.

    But, in the main function, 1.5 is placed as a power that is not an integer. Therefore, this is the error in pseudo code. It should be changed to any integer.

    Alternatively, change the integer power to real power to avoid this error.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Find the error in the following pseudocode. Module main () Call raiseToPower (2, 1.5) End Module Module raiseToPower (Real value, Integer ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers