PBLJ Lab Worksheet 1.3
PBLJ Lab Worksheet 1.3
PBLJ Lab Worksheet 1.3
Code (Java):
package pkg;
import java.util.*;
interface Account{
double interestrate=0.0;
double amount=0.0;
abstract double calculateInterest();
}
if(choice==1){
18BCS6701 18_IS_10 A
sba.calculateInterest();
}
else if(choice==2){
fda.calculateInterest();
}
else if(choice==3){
rda.calculateInterest();
}
else if(choice==4){
System.out.println("exiting");
System.exit(0);
}
else
System.out.println("Please enter valid choice");
}
catch(Exception e){
System.out.println("Error occurred at: "+e);
}
}
Output: Screenshot
18BCS6701 18_IS_10 A
[Interest Calculator - FD]
18BCS6701 18_IS_10 A