A Word on Handing In Assignments
-
If you only hand in code
-
The hand in must be ONE, repeat ONE,
jar-file.
-
If you hand in code and/or text files
-
The code must be ONE, repeat ONE,
jar-file.
-
The text must be ONE, repeat ONE,
pdf-file
-
Code files must be have
their native filename extension, eg.
x.java, y.html, etc.
-
Put your academy login-id into the filenames, and
an "_7" to number the file individually,
eg:
EAANILA1_7.jar
-
Attach the jar and/or the pdf to an email.
-
Put the token idefix somewhere
in the subject line of the email,
eg:
Assignments idefix
-
Mail it to
nml@acm.org
Assignment 2.0, New Software
In todays lesson we have looked at installing new software as well as
updating software already in Eclipse.
Now in order to practice this:
-
Refer to the section called “Eclipse New Software” and install
the WST Server Adapters
-
This is a preparatory step before next weeks installation
of the Android SDK and the Eclipse Android Development Tools,
and therefore a necessary step.
Assignment 2.1, Some Java Hands On in Eclipse
The UML diagram, Figure 2.9, “UML Diagram of Class Inheritance” is a contract
to be filled in by the programmer. Fill it in! This means
- that class by class you must code whatever is specified in the diagram
- you may borrow all the code from the lesson, but DO key it in. Do NOT ctrl-v
- you must test the classes individually
- you must test the interaction of the classes
- you must ask me the proper questions, beyond what has been said, to enable you to do it
- you must work in Eclipse
-
you may work in pairs, not more, if you do, name both in the hand in mail
Assignment 2.2, Some Java Hands On in Eclipse
For the hell of it, and in order for me to gauge your basic programming
skills, and thoughts, please create
-
Write a program
WordPlay.java
that will check a string for being a palindrome.
This program will need the following considerations and
code
-
A palindrome is a word, phrase, number or other sequence of units
that can be read the same way in either direction (the adjustment
of punctuation and spaces between words is generally permitted).
(
http://en.wikipedia.org/wiki/Palindrome)
-
In order to achieve this write
first,
a method returning the first letter of the string
-
Then write
last, a method returning
the last character of the string
-
Now write a method,
middle, returning
the middle part of the string, ie the string without
the first and last characters.
Hint: Check the Sun/Oracle documentation for the
String class and look for substring,
a useful method
-
Let me return to the definition, and add that a word of one
letter is a palindrome, and a word of two letters is a
palindrome if the two letters are the same.
Any word with more than two characters is a palindrome if
the first and last characters are the same, and the middle part
is a palindrome
-
That last definition is the pseudo code for a
recursive method
isPalindrome,
having a string as input and returning a boolean value
containing the verdict on the input string. Write that
method
-
In order to practice Eclipse behaviour write
WordPlay.java before writing the utility methods.