« All Events
7 PM – Intro To Java – Gamas
March 24, 2022 @ 7:00 pm - 8:00 pm
Today We Do
- We learned about how to fix Java errors.
- We continued on PetSystem
Homework
- Continue with PetSystem
- Add feature to change name and change age.
- When you want to change pet’s name and age, aside from calling the setName and setAge in the Pet class, you also have to remove the old Pet from the map because it is using the old name. And add the new Pet with the new name.
- Look at expected behavior below
Menu
1. Add pet
2. List all pets
3. Find pet by name
4. Change pet's age
5. Change pet's name
6. Exit
Please make your selection (1-4):1
ENTER NEW PET
Pet Species: Dog
Pet Name: Stitch
Pet age: 6
Menu
1. Add pet
2. List all pets
3. Find pet by name
4. Change pet's age
5. Change pet's name
6. Exit
Please make your selection (1-4):2
Stitch - Dog - 6
Menu
1. Add pet
2. List all pets
3. Find pet by name
4. Change pet's age
5. Change pet's name
6. Exit
Please make your selection (1-4):5
CHANGE PET NAME
Enter the pet's name that you want to find: Stitch
Give me a new name: Atlas
You changed Stitch to Atlas
Menu
1. Add pet
2. List all pets
3. Find pet by name
4. Change pet's age
5. Change pet's name
6. Exit
Please make your selection (1-4):2
Atlas - Dog - 6