import java.*;
import java.io.*;
import java.util.*;

abstract class Bank{    
abstract void getRateOfInterest();    
}    
    
class SBI extends Bank
{    
Scanner sc = new Scanner(System.in);
 void getRateOfInterest()
 {
   System.out.print("Enter Your Amount of Interest : "); 
	int balance = sc.nextInt();
	int interest = (balance * 10)/100;
   System.out.println("10% Interest is : "+interest);
    }    
}    
class PNB extends Bank
{    
Scanner sc = new Scanner(System.in);
  void getRateOfInterest()
   {
   System.out.print("Enter Your Amount of Interest : "); 
	int balance = sc.nextInt();
	int interest = (balance * 15)/100;
   System.out.println("15% Interest is : "+interest);
	}    
}    
    
class TestBank
{    
   public static void main(String args[])
   {    
   Bank s=new SBI();//if object is SBI, method of SBI will be invoked    
   s.getRateOfInterest();    
   
   Bank p=new PNB();//if object is PNB, method of PNB will be invoked    
   p.getRateOfInterest();    
 }
}
OUTPUT
Enter Your Amount of Interest : 10000
10% Interest is : 1000
Enter Your Amount of Interest : 10000
15% Interest is : 1000

Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA