Accenture Interview Question for Java Developers
- 1of 1 vote
Define a class Point having 2 fields x (int) and y (int) which represents a point (x,y)- ruhi August 31, 2014 in United States
Define a class Line having 2 Points, pt1 and pt2.
Define a class Quadrilateral having 4 Points, pt1, pt2, pt3 and pt4. The class also has the following functions
- getAllLines() which returns a Line consisting all 4 lines of the Quadrilateral. Note that the 4 lines of the quadrilateral will be pt1:pt2, pt2:pt3, pt3:pt4 and pt4:pt1
- longestSide() which return a Line that represents the longest the side of the Quadrilateral.
Also define the constructors for each class
| Report Duplicate | Flag | PURGE
Accenture Java Developer
Open Chat in New Window