Question
I need help on this particular problem. This is in relevance to Chapter.11: Advance Inheritance Concepts in the book Java Programming 8th Edition by Joyce
I need help on this particular problem. This is in relevance to Chapter.11: Advance Inheritance Concepts in the book Java Programming 8th Edition by Joyce Farrell. I'm not too sure how to begin since I am fairly new into programming. I have to submit this work within 24 hours.
1.Create an Interface named Phone. The Phone interface will have the following methods: call, end, and text. Next create the following classes: iPhone and Samsung. The iPhone class will implement the Phone Interface call method will print out "Call iPhone," and the end method will print out "End iPhone." The Samsung call method will print "Call Samsung," and the end method will print "End Samsung." Save the files as Phone.java, iPhone.java, and Samsung.java.
2.Create a class Person.java. The class will have the fields, name and phone number, that will be set through the constructor. The Person class will have the methods getName and getNumber. In addition, override the toString method to return the name and number. Create test class TestPerson that will create an array of Person and iterate through them calling their toString() method. Save the files as Person.java and TestPerson.java.
3.Create an application Call.java. The Call class will have an array of Phones (Samsung and iPhone). In addition, the application will populate an array of Person from above with the following information:
"Joe", "555-1234", "Bob", "555-4444", "Alice", "555-6565", "Sally","555-1111"
4.Modify the Phone Interface call method from above to accept a Person object. The implementation will output and append the Person number to the end. The Call class will prompt the user to make a call by allowing the user to select phone and person.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started