Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a class Lines containing a static method dashedLine to draw dashed lines,

ID: 3550987 • Letter: W

Question

Write a class Lines containing a static method dashedLine to draw dashed lines, so it can write:

Lines,dashedLine(g, xA, yA, xB, yB, dashLength);

Where g is a variable of type Graphics, xA, yA, xB, yB are the device coordinates of the endpoints A and B, anddashLength is the desired length (in device coordinated) of a single dash. There should be a dash, not a gap, at each endpoint of a dashed line.

For example, the image below show 8 dashed lines drawn this way, with dashLength = 20.

Write a class Lines containing a static method dashed Line to draw dashed lines, so it can write: Lines, dashed Line(g, xA, yA, xB, yB, dash Length); Where g is a variable of type Graphics, xA, yA, xB, yB are the device coordinates of the endpoints A and B, and dash Length is the desired length (in device coordinated) of a single dash. There should be a dash, not a gap, at each endpoint of a dashed line. For example, the image below show 8 dashed lines drawn this way, with dash Length = 20.

Explanation / Answer


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote