Mzukisi Mazula

Mzukisi Mazula

  • NA
  • 2
  • 574

[Create a class named Square that contains fields]

Aug 31 2023 6:27 PM

Create a class named Square that contains fields for area and the length of a side and whose constructor requires a parameter for the length of one side of a Square. The constructor assigns its parameter to the length of the Square’s side field and calls a private method that computes the area field. Also include read-only properties to get a Square’s side and area. Create a class named Demo Squares that instantiates an array of ten Square objects with sides that have values of 1 through10. Display the values for each Square. Save the class as DemoSquares.cs.


Answers (2)