Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedCan 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions