Write an application that recommends a pet

Prompt the user to enter whether he or she lives in an apartment, a house, or a dormitory (1, 2, or 3, respectively) and the number of hours the user is home during an average day. The user will select an hour category from a menu:
1. 18 or more
2. 10 to 17
3. 8 to 9
4. 6 to 7
5. 0 to 5
Output your recommendation based on the following table:
Residence
Hours Home
Recommendation
House
18 or more
Pot-bellied pig
House
10 to 17
Dog
House
Fewer than 10
Snake
Apartment
10 or more
Cat
Apartment
Fewer than 10
Hamster
Dormitory
6 or more
Fish
Dormitory
Fewer than 6
Ant farm