2A

In this problem you will use various String methods. Complete the class StringPrinter

You must use the String replace method on strings of one character. No credit for simply printing the word with replacements or replacing the entire word.

For the draft, just print twice the length of the string. Note:: There is a String method length() which returns the length of the String

Note: When you submit your code to Codecheck, it will first run with the given word(separate) but then it will run again with a different word. You do not need to worry about that. It will happen automatically. If your code is correct, the second word will also execute correctly.

2A draft:
2A final:

2B

Winter Solstice is on December 21 this year. The winter solstice is officially the first day of winter in the Northern Hemisphere. It is also the shortest day of the year (has the fewest daylight hours).You will complete the application SolsticePrinter.

Do the following:

For the draft, just define the variable today and assign today's date to it. Use the no-argument constructor.

2B draft:
2B final:

2C

Finish the class TrafficLightViewer. Draw a black rectangle at (50, 20) with a width of 20 and a height of 60. Then fill red, yellow, and green circles inside the rectangle to look like a traffic light. The upper left hand corner of the red circle will also be at (50, 20). You figure out the other locations and the diameters. The circles will touch the sides of the box and each other.

Use the predefined colors Color.RED, Color.YELLOW, and Color.GREEN.

Draw in this order: rectangle, red circle, yellow circle, green circle.

Your finished image will look like this.

image of a traffic light

For the draft, draw the box and the top circle (the red one). Be sure to use fill for the circle

2C draft:
2C final: