Ask Question
22 May, 17:22

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

+2
Answers (1)
  1. 22 May, 21:18
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers