Question: Can I get help with this java code please B: Programming (FindFriends) Create a Java program FindFriends. Your program will have a method that takes
Can I get help with this java code please B: Programming (FindFriends) Create a Java program FindFriends. Your program will have a method that takes a Person object and a String as input. The method returns an integer (int) which is the number of friends the person has with the given input name (input string). The method will be called numberOfFriends Your program must first create the following Person object: "Cat" who was born in 2012. Cat has two friends: "Dog", who was born in 2011 and "Eel", who was born in 1997. Both Dog and Eel each have a single friend (who is Cat). Your program should then ask for user input (using a Scanner object) for a name. Using your numberOfFriends method, many friends Cat has with the input name. Finally, your program will output a message like the following: if the input name was "Owl", then the output would be Cat has 0 friends named Owl; if the input name "Eel", then the output would be Cat has 1 friends name Eel. Do not hard-code "Cat" (or "Owl or "Eel", etc) in the output message. It should print whatever name the Person object in your program has and the user input name. Your program should work correctly no matter what Person object we initially create. Your program must not create any indFrienda objects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
