Use the pseudocode methods below to answer the questions starting on the next page.    FIRST METHOD: COMMENT  parameters should be integers METHOD largestValue(parameters:  num1, num2) BEGIN           IF(num1 >= num2) THEN result ← num1 ELSE result ← num2           ENDIF END largestValue     SECOND METHOD: COMMENT  parameters should be doubles METHOD largestValue(parameters:  num1, num2) BEGIN           IF(num1 >= num2) THEN result ← num1 ELSE result ← num2           ENDIF           RETURN result END largestValue   THIRD METHOD: COMMENT parameters should be integers METHOD largestValue(parameters:  num1, num2, num3) BEGIN IF(num1 >= num2 AND num1 >= num3) THEN         result ← num1 ELSE IF (num2 >= num3) THEN result ← num2           ELSE result ← num3 ENDIF RETURN result END largestValue   Given the pseudocode methods above and on the previous page, which method corresponds to each of the method calls specified?  What would that method return based on the arguments listed?  If nothing would be returned, please write “NO RETURN” in the box.   CALL largestValue(13, 25, 6)      ࠪ FIRST METHOD      ࠪ SECOND METHOD ࠪ THIRD METHOD What would this method call return?           CALL largestValue(7, 2)  ࠪFIRST METHOD       ࠪ SECOND METHOD ࠪ THIRD METHOD What would this method call return?         CALL largestValue(8.2, 9.9)  ࠪ FIRST METHOD      ࠪ SECOND METHOD ࠪ THIRD METHOD What would this method call return?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

Use the pseudocode methods below to answer the questions starting on the next page. 

 

FIRST METHOD:

COMMENT  parameters should be integers

METHOD largestValue(parameters:  num1, num2)

BEGIN

          IF(num1 >= num2) THEN

result ← num1

ELSE

result ← num2

          ENDIF

END largestValue

 

 

SECOND METHOD:

COMMENT  parameters should be doubles

METHOD largestValue(parameters:  num1, num2)

BEGIN

          IF(num1 >= num2) THEN

result ← num1

ELSE

result ← num2

          ENDIF

          RETURN result

END largestValue

 

THIRD METHOD:

COMMENT parameters should be integers

METHOD largestValue(parameters:  num1, num2, num3)

BEGIN

IF(num1 >= num2 AND num1 >= num3) THEN        

result ← num1

ELSE IF (num2 >= num3) THEN

result ← num2

          ELSE

result ← num3

ENDIF

RETURN result

END largestValue

 

Given the pseudocode methods above and on the previous page, which method corresponds to each of the method calls specified?  What would that method return based on the arguments listed?  If nothing would be returned, please write “NO RETURN” in the box.

 

CALL largestValue(13, 25, 6)     

ࠪ FIRST METHOD     

ࠪ SECOND METHOD

ࠪ THIRD METHOD

What would this method call return?

 

 

 

 

 

CALL largestValue(7, 2) 

ࠪFIRST METHOD      

ࠪ SECOND METHOD

ࠪ THIRD METHOD

What would this method call return?

 

 

 

 

CALL largestValue(8.2, 9.9) 

ࠪ FIRST METHOD     

ࠪ SECOND METHOD

ࠪ THIRD METHOD

What would this method call return?

 

 

 

Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage