Question: Repeat Exercise Graphics E8.23 by designing classes LetterH, LetterE, LetterL, and LetterO, each with a constructor that takes a Point2D.Double parameter (the top-left corner)
Repeat Exercise • Graphics E8.23 by designing classes LetterH, LetterE, LetterL, and LetterO, each with a constructor that takes a Point2D.Double parameter (the top-left corner) and a method draw(Graphics2D g2).Which solution is more object-oriented?
Data from Exercise Graphics E8.23
Write methods:

that show the letters H, E, L, O in the graphics window, where the point p is the top-left corner of the letter. Then call the methods to draw the words “HELLO”
and “HOLE” on the graphics display. Draw lines and ellipses. Do not use the drawString method. Do not use System.out.
••
public static void drawH (Graphics2D g2, Point2D.Double p); public static void drawE (Graphics2D g2, Point2D.Double p); public static void drawL (Graphics2D g2, Point 2D.Double p); public static void draw0 (Graphics2D g2, Point2D.Double p);
Step by Step Solution
3.32 Rating (152 Votes )
There are 3 Steps involved in it
The exercise you are referring to suggests two different approaches to drawing letters using Javas Graphics2D The first approach is procedural where y... View full answer
Get step-by-step solutions from verified subject matter experts
