The goal of this lab is to exercise your understanding of Java types and practice the recent Java constructs you have seen.
First open a terminal window.
We'll do one more set of modifications to the palindrome program. To get started, grab a copy of the version from class:
mkdir lab3 cd lab3 cp /cslab/class/csci235/lab3/Palindrome.java .
The first change to make is to make the program work for input
with mixed case. You may find it helpful to check the available methods
on class String
.
Your previous program tests whether a string is a palindrome. In exercises II and III, you will be writing programs for two other word games.
A sentence is a pangram if it contains every letter of the alphabet at least once. Examples include
Write a program which prompts the user for a string and determines whether or not that string is a pangram. Ignore spaces, punctuation, and capitalization. Your program should also include an opening documentation block (following the style we've seen in class) and a comment on every variable you declare.
Two words or phrases are anagrams of each other if they contain all the same letters (with the same frequency). Examples include
Write a program which prompts the user for two strings. Test whether the two strings are anagrams of each other. Ignore spaces, punctuation, and capitalization. Your program should also include an opening documentation block (following the style we've seen in class) and a comment on every variable you declare.
Make a script file that shows you compiling your programs and running them with inputs that make it clear that they work correctly. (See how to script,)
Print your three .java
files. (See how to print,)
Use handin
to hand in the files as lab3
, too. (See
how to do that, too.)