WJP Exp 2
WJP Exp 2
SAKTHI ISWARYA S
DATE: 10.03.2022
AIM:
To write a Java program to perform basic arithmetic operations such as
addition, subtraction, multiplication and division.
ALGORITHM:
STEP I: Start
STEP II: InclassITC, define the functions and return the values to be returned.
STEP-III: For example, greeting() function returns the string “GOOD MORNING
PEEPS.” And add() function is of int type and has two arguments which are used as
operands to perform the operation.
STEP-IV: A function can be made static with the keyword static.
STEP-V: Define a main() function in which an object of the class is created and the
function and the function which are non-static are called using that object and the
result is printed.
STEP VI: Stop
PROGRAM:
INTERFACE:
import java.rmi.*;
public interface computation extends Remote{
public int add(int x, int y) throws Exception;
public int sub(int x, int y) throws Exception;
public int muli(int x, int y) throws Exception;
public int div(int x, int y) throws Exception;
20EUIT125
SAKTHI ISWARYA S
OUTPUT:
INTERFACE , IMPLEMENTATION,SERVER:
20EUIT125
SAKTHI ISWARYA S
CLIENT:
RESULT:
Thus the program to perform basic arithmetic operations has been implemented
and executed successfully.