2A

Complete the class StringMethods using String methods. Remember that all the String methods are accessors. They do not change the original String. If you want to apply multiple methods to a String, you will need to save the return value in a variable.

Complete the class by doing the following

You are given a word in the starter file and Codecheck will test with that word and with a different set of letters

I made a mistake when doing the draft for this problem so I am changing the directions to match what is expected. See below. (Feb 9, 2016)

For the draft, print the word in lowercase and then print the original word. Leave the code where I print the original word.

2A draft:
2A final:

2B

This problem originally asked for Cinco de Mayo. I made a mistake in my solution. When you create the second object, use May 1 and then it will pass Codecheck. My apologies for having to create Uno de Mayo rather than Cinco de Mayo. (Changed Feb 2, 2016)

In this problem you will complete an application to calculate how many days are left until May Day on May 1, 2016. Use the Day class presented in the Udacity. It is in Codecheck as well

Here is the set up.

Now you are ready to do the assignment. In the main method:

For the draft: Create a Day object representing the current day and assign it to a variable named today. (Don't change the print statement)

When you are ready to work on the final, copy the Bluej project hw2b_cinco_draft into the cs46a/homeworks/hw02/final folder. Change the word draft to final. Open the project hw2b_cinco_final in Bluej and complete the assignment.

2B draft:
2B final:

2C

Draw the word COAT using the Line and Ellipse class from the Udacity graphics package. Download and unzip the graphics packages if you have not done so. The URL is in the syllabus area of Canvas.

Create a new Bluej project. Select Project->Import ... Navigate to the graphics files and add to your project. Be sure the folder you import contains the files directly and does not contain an extra folder. Your workbench should look like this.

workbench

Create a class called CoatViewer in the project. Add a main method to the class. There is no starter file this time

Your drawing should follow these specifications. The code goes in the main method.

It is a good idea to figure out the coordinates of each letter before starting to draw. Trial and error is not efficient here.

For the draft, draw the C and the O. (You will fill the O in the final version)

Sample output:

hw2c screenshot

2C draft:
2C final: