Java Program to Calculate Interest For FDs, RDs using Inheritance
Last Updated : 23 May, 2022
Inheritance is an important pillar of OOP(Object-Oriented Programming). It is the mechanism in java by which one class is allowed to inherit the features(fields and methods) of another class. In this article, we will create an application to calculate interest for FDs, RDs based on certain conditions using inheritance. Create three classes in a single package. Create their member function. Create a Menu Driven Program.
Steps
Create the Main Java File to take input of the choices on Interest Calculator like for Saving account, fixed deposit account, Recurring Deposits.
Create Another Class to calculate the Interest of fixed deposit. Calculate the FD Interest by Formula = FDAmount * FDinterestRate.
Also, Check If the Interest is Applicable in for normal Citizen Of the Senior Citizen. Create Another Class to calculate the Interest of Saving deposit. Calculate the saving account Interest by Formula = Amount * SavingAccountinterestRate. Also, check if it's a Normal Account or an NRI Account.
Create Another Class to calculate the Interest of Recurring Deposits. Calculate the RD Interest by Formula = RDAmount * RDinterestRate.
Also, Check The Months and the holder's age to Calculate the Interest.