Lab 6
Description
The purpose of this exercise is to give you some more practice with a bunch of things we have learned so far, up to and including how to write anequals method.
Create a new Java project in Eclipse and copy the code from both Lab6.java and InsecureCreditCard.java into Java classes in that project. Read through both files and try to understand what is happening. If you try to compile Lab6.java, you will see that it has several syntax errors. Your goal in this exercise is to correct the syntax errors and then to correct logic errors in the code.
Each time you find an error in the code, correct it and write down (in a text file) what you found.
class is misspelled at the top of the
program. Fix that error, and then rerun (recompile) to find
out what the next error is. Recompile again, and fix the next
error, until there are no more syntax errors.
equals method inside InsecureCreditCard.java
to get the program to do what it is supposed to do. Read the
description of the equals method in
InsecureCreditCard.java, and fill in the code for the method
accordingly. See pp. 302-307 for information on writing
an equals method.
Checking: .... a whole bunch of these lines that iterate
through months and years...
Checking: 7/2013
Checking: 8/2013
*** Match found! ***
Diner's Visa
MasterClubCard ... of Doom!
1234567812345678
08/2013
We will charge $21.29 on this card.