Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions student-submission/BESE2018/Pradip/area-of-circle/MyClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Scanner;
public class MyClient{
public static void main(String args[]){
try{
Registry registry = LocateRegistry.getRegistry("localhost");
MyInterface stub=(MyInterface)registry.lookup("rmi://localhost:5000/sonoo");
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter radius: ");
double radius = sc.nextInt();
System.out.println("area is "+stub.area(radius)+"m²");
}
}catch(Exception e){
System.err.println("Client exception: " + e.toString());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.rmi.*;
import java.rmi.server.*;
public class MyImplementation extends UnicastRemoteObject implements MyInterface{
MyImplementation()throws RemoteException{
super();
}
public double area(double x){return (double) (Math.PI*x*x);};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import java.rmi.*;
public interface MyInterface extends Remote{
public double area(double x)throws RemoteException;
}
12 changes: 12 additions & 0 deletions student-submission/BESE2018/Pradip/area-of-circle/MyServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class MyServer{
public static void main(String args[]){
try{
MyInterface stub =new MyImplementation();
Registry registry = LocateRegistry.getRegistry();
registry.rebind("rmi://localhost:5000/sonoo",stub);
System.err.println("Server ready");
}catch(Exception e){System.out.println(e);}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions student-submission/BESE2018/Pradip/req-res/MyClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Scanner;
public class MyClient{
public static void main(String args[]){
try{
Registry registry = LocateRegistry.getRegistry("localhost");
MyInterface stub=(MyInterface)registry.lookup("rmi://localhost:5000/sonoo");
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter name: ");
String name = sc.nextLine();
System.out.println("name is "+stub.name(name));
}
}catch(Exception e){
System.err.println("Client exception: " + e.toString());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.rmi.*;
import java.rmi.server.*;
public class MyImplementation extends UnicastRemoteObject implements MyInterface{
MyImplementation()throws RemoteException{
super();
}
public String name(String name){return (String) (name);};
}
4 changes: 4 additions & 0 deletions student-submission/BESE2018/Pradip/req-res/MyInterface.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import java.rmi.*;
public interface MyInterface extends Remote{
public String name(String name)throws RemoteException;
}
12 changes: 12 additions & 0 deletions student-submission/BESE2018/Pradip/req-res/MyServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class MyServer{
public static void main(String args[]){
try{
MyInterface stub =new MyImplementation();
Registry registry = LocateRegistry.getRegistry();
registry.rebind("rmi://localhost:5000/sonoo",stub);
System.err.println("Server ready");
}catch(Exception e){System.out.println(e);}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions student-submission/BESE2018/Pradip/tax_calculation/MyClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Scanner;
public class MyClient{
public static void main(String args[]){
try{
Registry registry = LocateRegistry.getRegistry("localhost");
MyInterface stub=(MyInterface)registry.lookup("rmi://localhost:5000/sonoo");
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter amount: ");
double amount = sc.nextDouble();
System.out.println("Enter rate: ");
double rate = sc.nextDouble();
System.out.println("tax is "+stub.tax(amount, rate));
}
}catch(Exception e){
System.err.println("Client exception: " + e.toString());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.rmi.*;
import java.rmi.server.*;
public class MyImplementation extends UnicastRemoteObject implements MyInterface{
MyImplementation()throws RemoteException{
super();
}
public double tax(double amount, double rate){return (double) ((rate/100)*amount);
}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import java.rmi.*;
public interface MyInterface extends Remote{
public double tax(double amount,double rate)throws RemoteException;
}
12 changes: 12 additions & 0 deletions student-submission/BESE2018/Pradip/tax_calculation/MyServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class MyServer{
public static void main(String args[]){
try{
MyInterface stub =new MyImplementation();
Registry registry = LocateRegistry.getRegistry();
registry.rebind("rmi://localhost:5000/sonoo",stub);
System.err.println("Server ready");
}catch(Exception e){System.out.println(e);}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions student-submission/BESE2018/Pradip/volume_of_rect/MyClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Scanner;
public class MyClient{
public static void main(String args[]){
try{
Registry registry = LocateRegistry.getRegistry("localhost");
MyInterface stub=(MyInterface)registry.lookup("rmi://localhost:5000/sonoo");
try (Scanner sc = new Scanner(System.in)) {
System.out.println("Enter length: ");
double x = sc.nextDouble();
System.out.println("Enter breadth: ");
double y = sc.nextDouble();
System.out.println("Enter height: ");
double z = sc.nextDouble();
System.out.println("volume is "+stub.volume(x,y,z)+" cubic meter");
}
}catch(Exception e){
System.err.println("Client exception: " + e.toString());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.rmi.*;
import java.rmi.server.*;
public class MyImplementation extends UnicastRemoteObject implements MyInterface{
MyImplementation()throws RemoteException{
super();
}
public double volume(double x, double y, double z){return (double) (x*y*z);};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import java.rmi.*;
public interface MyInterface extends Remote{
public double volume(double x, double y, double z)throws RemoteException;
}
12 changes: 12 additions & 0 deletions student-submission/BESE2018/Pradip/volume_of_rect/MyServer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class MyServer{
public static void main(String args[]){
try{
MyInterface stub =new MyImplementation();
Registry registry = LocateRegistry.getRegistry();
registry.rebind("rmi://localhost:5000/sonoo",stub);
System.err.println("Server ready");
}catch(Exception e){System.out.println(e);}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.