Java

Hello, Here is my anwer I just want you to order them in a file, and send it to me by zipping file. Also the code and the out put should be working well:JAVAComposition and Encapsulation – The Line and Point ClassPoints and Lines ( Here is the Image’s Link :    http://e.top4top.net/p_4407a55b1.png ).Computer graphics systems make use of two general rendering systems – rasters and vectors — to produce images. Raster systems keep track of collections of individual pixels and vector systems keep track of lines. (Lines are more accurate, but require more computer resources.)This assignment calls for a Line object that represents a graphically depicted image on the screen. This object must store this data: _Endpoint objects (x and y coordinates as an integer). There will be two of these. _The line color as a String _The line width as an integerNote that the Line object must be composed of two Point objects.The Point ClassCreate a Point class that contains x and y coordinates (x and y are integers) that represents a point in two-dimensional space. A point can lie only in the first quadrant in the x-y coordinate axis.Include the following methods _two constructors: a default that initializes x and y to 0, and another that accepts the x and y values as passed-in parameters _get and set methods to retrieve and assign coordinate values _a toString method that will return a String containing the coordinates of the point formatted as (x, y)an equals method (returns a boolean value) that compares two Points for equality. This method takes a single parameter of type Object and will cast the Object into a Point for comparison.anything else you deem necessaryThe Line ClassCreate a Line class that contains variables and/or methods to represent _the end Points of the line (be sure your Point objects are declared as private) _the length of the line (represent this as a return value from a method) _color _widthThis Line class should have the following methods _A default constructor that creates Points that represent a zero-length black line at the origin with a width of 1 pixel _A constructor that accepts four ints – x and y for point 1 and x and y for point 2, a color and a width _A constructor that accepts four ints (color defaults to black and width to 1 pixel) _get and set methods to retrieve values and assign values as you deem necessary _A toString method that prints the coordinates of the line endpoints, the length, the color and width of the line (nicely formatted, please) _an equals method (returns a boolean value) that will compare two lines for equality. Two lines are equal if their endpoints, width and color are the same. Note that Points do not need to be in same order. Be sure and use the equals method you wrote from your Point class to compare Points. Your equals method should override the equals method in Object. _a validateLine method that will make sure the points are in the first quadrant. This method must be declared as static — so that it can be called without an instance of the class.Create a driver class called LineDriver that will work with two lines. Create both lines as zero-length at the origin. Then provide a menu that is displayed repetitively with the following options:1 – Enter coordinates, width and color for first line (line should be validated as part of this process — use the validateLine method — do not continue until valid coordinates and width are obtained from the user)2 – Enter coordinates, width and color for second line (ditto)3 – Compare the two lines (specify if lines are equal/not equal after comparison)4 – Display coordinates, width, length and color for first line (the length should be derived from the coordinates using the distance formula and is represented as a real number with 2 post-decimal positions of precision.)5 – Display coordinates, width, length and color for second line (the length should be derived from the coordinates using the distance formula and is represented as a real number with 2 post-decimal positions of precision.)6 – Quit————————— Answer——————package sample;public class Point { private int x; private int y;    public Point() {    x=0;    y=0; }   public Point(int x,int y) {    this.x=x;    this.y=y; }    public int getX() {    return x; }    public int getY() {    return y; }    public void setX(int x) {    this.x=x; }    public void setY(int y) {    this.y=y; }    public String toString() {    return String.format(“(%d,%d)”,this.x,this.y); }    public boolean equals(Object p) {    Point otherpoint=(Point)p;       if(this.x==otherpoint.x&&this.y==otherpoint.y)    {        return true;    }    else    {        return false;    }              }    }package sample;public class Line {   private Point a;    private Point b;    int length;    int width;    String color;       public Line()    {        length=0;        width=1;        a.setX(0);        a.setY(0);        b.setX(0);        b.setY(0); color=”black”;   }       public Point getA()    {        return a;    }       public Point getB()    {        return b;    }             public Line(int x1,int y1,int x2,int y2)    {        a.setX(x1);        a.setY(y1);        b.setX(x2);        b.setY(y2);        length=0;        width=1;        color=”black”;    }       public String toString()    {        return String.format(“x1:%d y1:%d x2:d y2:%d color:%s length:%d width:%d “, a.getX(),a.getY(),b.getX(),b.getY(),color,length,width);    }       public boolean equals(Object l)    {        Line otherline=(Line)l;               if(this.a.equals(otherline.getA())||this.a.equals(otherline.getB())&&this.b.equals(otherline.getB())||this.b.equals(otherline.getA()))        {        if(this.width==otherline.width&&this.color.equals(otherline.color))        {            return true;        }            return false;          }        else        {            return false;        }                  }    public static void validateLine(Line l)    {               if(l.a.getX()<0||l.a.getY()<0||l.b.getX()<0||l.b.getY()<0)        {            System.out.println("invalid line");        }        else        {            System.out.println("valid line");        }           } }Thank you

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

What Will You Get?

We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.

Premium Quality

Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.

Experienced Writers

Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.

On-Time Delivery

Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.

24/7 Customer Support

Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.

Complete Confidentiality

Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.

Authentic Sources

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

Moneyback Guarantee

Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.

Order Tracking

You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.

image

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

image

Trusted Partner of 9650+ Students for Writing

From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.

Preferred Writer

Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.

Grammar Check Report

Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.

One Page Summary

You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.

Plagiarism Report

You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.

Free Features $66FREE

  • Most Qualified Writer $10FREE
  • Plagiarism Scan Report $10FREE
  • Unlimited Revisions $08FREE
  • Paper Formatting $05FREE
  • Cover Page $05FREE
  • Referencing & Bibliography $10FREE
  • Dedicated User Area $08FREE
  • 24/7 Order Tracking $05FREE
  • Periodic Email Alerts $05FREE
image

Services offered

Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.

  • On-time Delivery
  • 24/7 Order Tracking
  • Access to Authentic Sources
Academic Writing

We create perfect papers according to the guidelines.

Professional Editing

We seamlessly edit out errors from your papers.

Thorough Proofreading

We thoroughly read your final draft to identify errors.

image

Delegate Your Challenging Writing Tasks to Experienced Professionals

Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!

Check Out Our Sample Work

Dedication. Quality. Commitment. Punctuality

Categories
All samples
Essay (any type)
Essay (any type)
The Value of a Nursing Degree
Undergrad. (yrs 3-4)
Nursing
2
View this sample

It May Not Be Much, but It’s Honest Work!

Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.

0+

Happy Clients

0+

Words Written This Week

0+

Ongoing Orders

0%

Customer Satisfaction Rate
image

Process as Fine as Brewed Coffee

We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.

See How We Helped 9000+ Students Achieve Success

image

We Analyze Your Problem and Offer Customized Writing

We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.

  • Clear elicitation of your requirements.
  • Customized writing as per your needs.

We Mirror Your Guidelines to Deliver Quality Services

We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.

  • Proactive analysis of your writing.
  • Active communication to understand requirements.
image
image

We Handle Your Writing Tasks to Ensure Excellent Grades

We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.

  • Thorough research and analysis for every order.
  • Deliverance of reliable writing service to improve your grades.
Place an Order Start Chat Now
image

Order your essay today and save 30% with the discount code ESSAYHELP