Write a java program named MyLoan that uses an abstract class named FamilyInsurance and subclasses which can display two different types of loans, Car and Health. And the cost per month for each loan. Please extend your program in question 3 by applying encapsulation and polymorphism concepts. Understand the definition of both concepts and try as much as possible to convert your program and met with the criteria. The criteria are as follows: 1) Superclass able to define reference of subclass. 2) The usage of private data field. 3) Subclass with two parents class. Please use implements.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a java program named MyLoan that uses an abstract class named
FamilyInsurance and subclasses which can display two different types of loans,
Car and Health. And the cost per month for each loan.
Please extend your program in question 3 by applying encapsulation and
polymorphism concepts. Understand the definition of both concepts and try as much as possible to convert your program and met with the
criteria. The criteria are as follows:
1) Superclass able to define reference of subclass.
2) The usage of private data field.
3) Subclass with two parents class. Please use implements.

Question 3
Write a java program named MyLoan that uses an abstract class named
Familylnsurance and subclasses which can display two different types of loans,
Car and Health. And the cost per month for each loan.
Each of the subclasses contains constructor which will sets the cost per month
based on the type of loan, and prompt the user any appropriate data entry for
the loan calculation. For example, Car loan, you might ask the user the age of
the car or want to protect windscreen or not, flood and etc. Same goes to Health
insurance. Please find the correct data for your program.
Include and abstract toData( method in the Familylnsurance class that
constructs a String containing all the required data. Ask the user for the type of
insurance and then display the appropriate Object. Save your files as
Familylnsurance.java, Car.java, Health.java and MyLoan.java.
Find at least 5 relevant elements for each of insurance.
Transcribed Image Text:Question 3 Write a java program named MyLoan that uses an abstract class named Familylnsurance and subclasses which can display two different types of loans, Car and Health. And the cost per month for each loan. Each of the subclasses contains constructor which will sets the cost per month based on the type of loan, and prompt the user any appropriate data entry for the loan calculation. For example, Car loan, you might ask the user the age of the car or want to protect windscreen or not, flood and etc. Same goes to Health insurance. Please find the correct data for your program. Include and abstract toData( method in the Familylnsurance class that constructs a String containing all the required data. Ask the user for the type of insurance and then display the appropriate Object. Save your files as Familylnsurance.java, Car.java, Health.java and MyLoan.java. Find at least 5 relevant elements for each of insurance.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY