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
Class methods
Area and perimeter
Report a typo
Sample Input 1:
Square(5)Sample Output 1:
25
20Write a program in Scala 3
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.