Java’s class Graphics has the following method to draw a line between two given points:
/** Draws a line between the points (x1, y1) and (x2, y2).*/public void drawLine(int x1, int y1, int x2, int y2)
Graphics uses a coordinate system that measures points from the top left corner of a window. Write a recursive method that draws a picture of a 12-inch ruler. Mark inches, half inches, quarter inches, and eighth inches. Mark the half inches with marks that are smaller than those that mark the inches. Mark the quarter inches with marks that are smaller than those that mark the half inches, and so on. Your picture need not be full size. Hint: Draw a mark in the middle of the ruler and then draw rulers to the left and right of this mark.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.