Rubric: Correct the syntax and logical errors Proper working code
Public Class SavingsAccount
{
float interest;
float FixedDeposit;
SeniorAccount(float interest, float FixedDeposit)
{
this. interest = interest;
this.fixedDeposit= FixedDeposit;
}
float calculateInterest();
{
System.out.println(“Calculating Savings Account Interest”);
return(FixedDeposit*interest/100);
}
}
Public Class SeniorAccount extends SavingAccount
{
float seniorInterest;
SeniorAccount(float interest, float FixedDeposit)
{
this.seniorInterest=interest;
super(interest, FixedDeposit)
}
float calculateInterest()
{
System.out.println(“Calculating Savings Account Interest”);
return(FixedDeposit*seniorinterest/10);
}
}
Public static void main(String args[])
{
SavingsAccount saving = new SavingsAccount(6,100000);
System.out.println(saving.calculateinterest());
SeniorAccount senior=new seniorAccount(10,100000);
System.out.println(Senior.calculateInterest());
}
Rubric:
- Correct the syntax and logical errors
- Proper working code
Step by step
Solved in 2 steps with 1 images