Exercise 1: Sum of Squares

In this challenge, you need to implement a method which squares the passed variables and returns the sum.

We'll cover the following

Problem Statement

A constructor function SquareSum(num1,num2,num3) is given which takes three numbers as properties. You have to initialize them. The constructor function also contains a method squaresum(), implement it in a way such that it computes the square of the three numbers and returns their sum.

Sample Input

2, 3, 4 ​

Sample Output

29

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy