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()); } Correct the syntax and logical error
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());
}
Correct the syntax and logical error
Step by step
Solved in 3 steps