home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs
hw-ec
Extra Credit Homework
The following problems can be completed for extra credit points.
-
The extra credit contributes toward your homework total
(not your exam total);
-
All extra-credit homeworks require
(as usual)
test cases
and
javadoc documentation for all methods,
and the use of helper functions as appropriate.
For a function returning a random result,
you can simply print an actual result along with a
brief description of the sort of value you expect back.
(E.g. “After scoring 20 points at random,
the first team is:”)
-
Extra credit homework will be accepted up through the last
day of the semester (Dec.16 (Thu)), 17:00.
Campus closure update:
The hw is still due today (Thu) 17:00 on WebCT
(since the school closure doesn't change working on the hw).
But you can get the hard copy to me (i.e. under my office door)
Friday.
You are encouraged to do any work well before then.
-
Although you can look on the web for programs,
follow the same guideline as for homework-redos:
Any code you submit must be authored by you,
without reference to any posted solutions.
(You might want to wait 30min between studying others' code
and writing your own solution;
anything you remember about the solution can be considered
as coming from your own brain.)
- (5pts)
Write a function to “normalize” credit-card numbers:
Whether given a string which has four blocks of four digits separated
by spaces, or by hyphens, or by nothing,
return one definitive version.
(You may presume the input is otherwise correct — that is,
there really are a total of 16 digits, and they are separated by one
of the three conventions above.)
- (5pts)
Write a function to tell if two strings are equal,
without calling equals!
- (5pts)
Write a function to tell if a String is a palindrome:
whether it reads the same forward and backwards
(for example, “eve” and “ABBA”
are both palindromes).
For 5pts additional credit, ignore punctuation and spaces
(e.g. “Madam, I'm Adam.” or
“A man -- a plan -- Panama!”).
hint:Write a helper function similar to
one used for the credit-card normalization.
- (5-10pts)
Write a function to generate random strings.
(It's up to you to somewhat formalize this notion;
the amount of points received depends in part on
what you choose to have your code do.)
- (up to 20pts)
Complete the sequence of ISBN problems on lab09b—looping over strings.
- (up to 30pts)
Complete the sequence of encryption problems
as discussed on lab11a—Command-line Java: optional: encoding messages.
Further points if you process
puncuation and word-boundaries
in an appropriate way for each situation.
-
(variable pts)
Complete image-processing filters
as suggested on the
upcoming image processing lab,
or write your own.
home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs