Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need a Tester program to Test the program out and to make sure theres no decrepancies. A Tester class. Thank you. Highlighted part Some other

Need a Tester program to Test the program out and to make sure theres no decrepancies. A Tester class. Thank you. image text in transcribed
image text in transcribed Highlighted part
image text in transcribed
image text in transcribed
Some other info if needed.
image text in transcribed
/package for Line2D import java.awt.geom.Line2D //package for point2D impoxt java.awt.geom.Point2D public class LineDistanceTester //main function publis statie void main (Stringt args) //create the point 1 point2D, Double point 1-new point2DDouble(100, 100); //create the point 2 Point2D.Double point2new Point2D Double (200, 200) //create the 1ine for point 1 and point 2 Line2D.Double 1-new Line2D.Double(pointl,point2) //create the three points to find the distance from line Point2D.Double distl new Point2D Double(100, 200) Point2D.Double dist2 new Point2D Double(1s0, 150) Point2D.Double dist3new Point2D.Double (250 50) //display the distance from line of three points System.out printin(i.ptsegDist (distl)) yatem.out.printini.ptSegDist (dist2)) Syatem.out pxintini.ptsegbist (dist3)) Result Sjavac LineDistanceTester jave 141-4213562373095 Copyable Code: package for Line2D import java.awt.goom.Line2D package for point2D import java.awt.goom.Point2D class name public class LineDistanceTester main function public static void main(Stringl) ars) ereate the poimt Point2D.Double point new Point2D Double(100, 100) Wereate the point 2 Point2D.Double point2-new Point2D Double(200, 200) Wereate the line for point 1 and point 2 Line2D Double 1- new Line2D.Doublelpointl, point2) icreate the three points to find the distance from line Point2D Double dist new Point2D. Double(100, 200) Point2D.Double dist2-new Point2D Double(150, 150) Point2D Double dist3 new Point2D Double(250, 50); display the distance from line of three points System out printi.ptSegDisldist 1 )% System.outprintinl.ptSegDis(distZ) System.out printinlptSegDisldist3)

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

What is the difference between an assignment and a delegation?

Answered: 1 week ago

Question

Understand why empowerment is so important in many frontline jobs.

Answered: 1 week ago