Assignment 1 – Drawing Letters

Maximum Points = 50

 The purpose of this lab is to review your study of computer programming and algorithms from CS 1. In this lab you will write a program that allows a user to enter a word with a specified set of letters and then draws the word using lines and ellipses.

 

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).

 

The draw method show the letters H, E, L, or O on the graphics window, where the point p is the top-left corner of the letter. The draw method will draw lines and ellipses. Do not use the drawString method. Do not use System.out.

 

Your program will prompt the user (using the Scanner to read from the keyboard or a JOptionPanes) to enter a word like “HELLO” and “HOLE” and then call the constructors and draw methods to draw the word on the graphics display. Do not use the drawString method. Do not use System.out.

 

Do one or more of the following extra features:

a)    Use a GUI to interact with the user

b)    Add one or more letters to the choices of H, E, L, O.

c)    Anything else that you think might enhance this assignment (check with me first)

 

 (Due before class on Wendesday, January 26, 2011) Submit your .java files containing your program , a Word document describing your program and your timesheet documenting your time to the dropbox in WebCT..

 Grades are determined using the following scale:

Grading Rubric  (Word document)