362,767 views
20 votes
20 votes
Write a program called SumSquares that includes an integer return type method called Squares(). The method accepts two integer parameters (num1 and num2) and calculates the sum of these two squares (num12 + num22). The main method includes the method call, passing the following values (2, 3) to the Squares() method and the output displaying the sum of the squares in the command line window.

User Vincenzo Pii
by
3.5k points

1 Answer

13 votes
13 votes

Answer:

13

Step-by-step explanation:

since your function is for the sum of 2 squares and the parameters are 2,3. you should do num1^2 + num2^2 which will be 2^2 +3^2

4+9 = 13

so your answer is 13

User Thunderbird
by
3.3k points