Lab 8
Explanation:
I told you in class that we were going to do an Applet in class today, but I have decided to make that an outlab due
the next lab class. I don't feel I've explained applets well enough in class to assign an inlab on it yet.
I will cover Applets a little more in tomorrow's class.
I also didn't feel people did well enough on last week's lab so in today's inlab I'm going to give you
some more practice using the tools to solve problems.
Don't forget about the outLab due next lab class (after Spring Break) get it done early so you don't have to do it over Spring break.
Today's lab
You will write a program to identify if user input is a palidrome.
A palidrome is a string of characters that reads the same forward or backward. For example, the following strings are palidromes:
- radar
- drab bard
- ab cde xxxx edc ba
- kayak
- deified
Note that some palidromes have an even number of characters and some have and odd number.
You will use the charAt and match the first letter with the last letter, the second letter with the second to last letter and so on.
It should be done in as little as code as possible.
After you get it working put it in a loop so the user can keep entering strings if they want, or they can exit if they want.
First draw out the algorithm (logic) on a sheet of paper. Once you get the logic where you think it will work, then you can start writing your code.
Make sure you plan out the solution deciding what methods, variables and classes you will need before you start writing code.
Turn in
When you finish make sure your TA gives you credit for the doing the assignment correctly.
If you finish early start on your outlab due next lab class.
Make sure you get credit for the lab before you leave.