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. 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 FamilyInsurance 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 FamilyInsurance.java, Car.java, Health.java and MyLoan.java. **Find at least 5 relevant elements for each of insurance.**

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 2PE
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.

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 FamilyInsurance 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 FamilyInsurance.java, Car.java, Health.java and MyLoan.java.

**Find at least 5 relevant elements for each of insurance.**

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,