Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Complete the following java programs inserting the suitable code in the missing places to compute the simple interest using java RMI

Complete the following java programs inserting the suitable code in the missing places to compute the simple interest using java RMI

Computer Science

Complete the following java programs inserting the suitable code in the missing places to compute the simple interest using java RMI.

Please copy the following code into answer box and insert/add the suitable/appropirate code (s) in the missing places.

 Underline (_________________) indicates the missing places for coding.

//Remote Interface definition

import java.rmi.*;
public interface SimpleInterest extends Remote{
    double getInterest(double p,double t, double r) throws RemoteException;
    }

//Method Implementation
import java.rmi.*;
import java.rmi.server.*;
public class Interest extends UnicastRemoteObject __________________________{
    public Interest() throws RemoteException{}
    public double getInterest(double p,double t, double r) throws RemoteException{
        return (p*t*r)/100;
    }

}


//RMI Server program
import java.rmi.*;
import java.net.*;
public class TestRMIServer{
    public static void main(String[] args){
        try{
            _____________;  
            _____________;  
             }
    catch(Exception e){ 
    System.out.println("Error In Server:"+e);
        }
    }
}

//RMIClient program
import java.rmi.*;
import java.util.*;
public class TestRMIClient{
    public static  void main(String[] args){
    //Reading input from user
    Scanner scan=new Scanner(System.in);
    System.out.println("Enter principle amount:");
    double p=scan.nextDouble();
    System.out.println("Enter time (in years):");
    double t=scan.nextDouble();
    System.out.println("Enter interest rate:");
    double r=scan.nextDouble();
    //calling remote method 
    try{    
    String strURL="______________________";
    ______________________________________;
    System.out.println("The simple interest is:"+__________________________);
    }
    catch(Exception e){
        System.out.println("Error in Client Machine:"+e);
        }
    }
}  

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions