Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve this problem using MS Visual studio and write test project to validate the point and Square class. Problem three: The following application implements a

Solve this problem using MS Visual studio and write test project to validate the point and Square class.

Problem three:

The following application implements a set of related classes. The class Point represents a point in the Cartesian space. The Class Square represents square shape in Cartesian space.

  1. Complete the Point constructor.
  2. Write properties for x, and y values in Point Class.
  3. Complete the constructors of the class square.
    1. The order of points in the square is important. Thus, we will consider that the first point in the list represents the upper left point and we move counter clock wise. If we have two points in left with same level, we use one of them. A sample square in Cartesian space is shown in Figure P2.
    2. The square has equal length and width.
    3. It has four 90 degree angles (equal diagonal).
  4. Write an indexer for Square to only get its point.
  5. Write a public method that returns its area.

Write a public method that return the perimeter of the square.

image text in transcribed

Figure P2. A sample square in Cartesian space and the order of it points.

Public Class Point{

private double x;

private double y;

public Point()

{

x = 0;

y = 0;

}

Public Point( double xvalue, )

{

}

}

Public Class Square

{

private int numberofPoints;

Point [] squarePoints;

Public Square()

{

squarePoints = new Point[4];

squarePoints [0] = new ..;

squarePoints [1] = new ..;

squarePoints [2] = new ;

squarePoints [3] = new ..;

}

Public Square (..)

{

// initialization without validation will be considered correct.

// validation for point orientation as described in the problem will have

// three points bonus.

}

Point 3 Y axis Point 2 Point 0 (0,0) X axis Point 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

7. Where Do We Begin?

Answered: 1 week ago

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago