So you have -
User - a class to represent a user. Has name, pet info, etc. User can have many or no pets
Pet - A pet that represents some type of animals. Have some common attributes like name, age..some common actions like eat.
Dog - Extends pet has some attributes like name, age, color, breed, some actions specifially for dog like barks, fetches balls
Cat - Extends pet has some attributes like name, age, color, breed, some actions like being useless by sleeping twenty times a day
Ask the user for-
- The user info (Build User)
- Ask if the user has a pet. If no pet, update the user profile to state no pets.
- If has a pet, ask if they have a dog. If they have, ask how many. Read the info on each dog. Build user's dog profile. If no dog, update user profile to indicate no dogs.
- If has a pet, ask if they have a cat. If they have, ask how many. Read the info on each cat. Build user's cat profile like you did for dog in step 3 so on..
UPDATE:
For you to know if the user entered either a dog or a cat, you can have something like-
Scanner scan = new Scanner(System.in);
String response;
do{
System.out.print("Do you have a pet ? (Y/N): ");
response = scan.nextLine();
} while(!response.equalsIgnoreCase("Y") && !response.equalsIgnoreCase("N"));
if(response.equalsIgnoreCase("N")){
System.exit(0);
}
do{
System.out.print("Cat or a dog ? (C/D): ");
response = scan.nextLine();
} while(!response.equalsIgnoreCase("C") && !response.equalsIgnoreCase("D"));