Professional Documents
Culture Documents
Amandeep Singh (20BCS5399) PBLJ Worksheet 1.3
Amandeep Singh (20BCS5399) PBLJ Worksheet 1.3
Amandeep Singh (20BCS5399) PBLJ Worksheet 1.3
Task to be done:
The goal of this project is to design and implement an application which can
easily calculate the interest for FDs, RDs based on some condition on the
amount which user stores in bank for a specific time.
Apparatus/Simulator used:
• Java JDK
• VS Code
Code:
A. account.java
public abstract class account {
double interestRate;
double amount;
B. FDAccount.java
import java.util.Scanner;
@Override
double calculateInterest(double amount) {
this.amount = amount;
System.out.println("Enter FD days");
noOfDays = sc.nextInt();
System.out.println("Enter FD age holder ");
ageOfACHolder = sc.nextInt();
@Override
double calculateInterest(double amount) {
this.amount = amount;
System.out.println(
"Select account type \n1. NRI \n2. Normal ");
int accountChoice = sc.nextInt();
switch (accountChoice) {
case 1:
interestRate = .06;
break;
case 2:
interestRate = .04;
break;
default:
System.out.println(
"Please choose right account again");
}
return amount * interestRate;
}
}
D. RDAccount.java
import java.util.Scanner;
@Override
double calculateInterest(double amount) {
this.amount = amount;
System.out.println("Enter RD months");
noOfMonths = sc.nextInt();
System.out.println("Enter RD holder age");
int age = sc.nextInt();
E. interestCalculator.java
import java.util.Scanner;
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):