Project: Face Paint

This project will test your skills using Java, printing text to the console, and commenting your code. Since it is the first project of the chapter, it will be fairly brief.

Assignment

The goal of this project is to print the following image and caption to the console:

  /////
 |     |
 | " " |
 | o o |
(|  ^  |)
 | \_/ |
  -----

A "drawing" of a face

To begin, create a project called FacePrinting. Find a way to print the text to the console. Even though it is not actually necessary, make use of a mix of println and print statements to get practice with both. You will have to use a few escape sequences in this project. Also, be mindful of the whitespace in the text. For example, there is a blank line between the image and the caption.

Add a multi-line comment at the beginning of your code that contains your name and grade in school. Then, use single-line comments to explain what part of the body is printed by each println and print statement.

Output

This embedded file illustrates what your program should print to the console once it works correctly. However, keep in mind that comments are part of this assignment too, so you might not be quite done just because your output looks like this.

Reference Implementation

There are an infinite number of ways to implement this program. However, if you are stuck, you can look at the reference implementation below to see one way of doing it.

Click to reveal the reference implementation

Last updated

Was this helpful?