Area and perimeter

Report a typo

Write a class Square. It must have a constructor that takes only one value (because the sides of a square are equal). Write the calculateArea and calculatePerimeter methods that will calculate Area and Perimeter

Sample Input 1:

Square(5)

Sample Output 1:

25
20
Write a program in Scala 3





___

Create a free account to access the full topic