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.**
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a java
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.**
Trending now
This is a popular solution!
Step by step
Solved in 2 steps