ITEC 120 LAB 11 | Back to Lab index page |
Lunchcard
You will write a Java class to represent a lunchcard (much like your RU id).
Lunchcard
|
- name : String |
+ Lunchcard ( String owner
) |
Write a driver program which tests all of these methods. The purpose of this program is just to test the methods in your class file. (You don't need to get any info from the user, just make up all the data in your driver program.) Make println statements to let you know what the program is doing.
A sample run will look like this:
Two lunchcards
created. Ethel Mertz- Meals remaining: 0 Fred Mertz- Meals remaining: 12 Ethel buys 25 meals Fred's card swiped once Swiped 4 meals from Ethel's card. Fred buys 10 meals. Swiped 7 meals from Fred's card |
Once you have your program
working, show your lab to the Peer Instructor to be checked off.