DevJourney · code I wrote while learning

README.md

807 B

Sum of Dimensions of a Rectangle

Single File Programming Question

Problem Statement

Sharon is tasked with creating a program to calculate the sum of the dimensions of a rectangle.

Implement a generic class Area to help Sharon accomplish this task. The class should be designed to handle any numeric type that extends from Number.

Input:

format :

The input consists of two space-separated integers: length and width, representing the dimensions of a rectangle.

Output:

format :

The output prints an integer value, representing the sum of the length and width of the rectangle.

Refer to the sample output for formatting specifications.

Code constraints : length, width > 0

Sample test cases :

Input 1:

5 3
Output 1 :
8
Input 2 :
10 6
Output 2 :
16