<font color='#000000'>import java.io.*;
public class Calculator
{
public static void main (String []args)
{
try
{ System.out.println("Enter first number:");
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in), 1);
String input1 = bufferedreader.readLine();
int num1 = Integer.parseInt(input1);
System.out.println("Enter second number:");
BufferedReader bufferedreader2 = new BufferedReader(new InputStreamReader(System.in), 1);
String input2 = bufferedreader2.readLine();
int num2 = Integer.parseInt(input2);
System.out.println(num1 + " + " + num2 + " is : " + add(num1,num2));
System.out.println(num1 + " - " + num2 + " is : " + subtract(num1,num2));
System.out.println(num1 + " * " + num2 + " is : " + multiply(num1,num2));
System.out.println(num1 + " / " + num2 + " is : " + divide(num1,num2));
}
catch(IOException io)
{
System.out.println(io.getMessage());
}
}
public static int add(int inte1 , int inte2)
{
return inte1 + inte2;
}
public static int subtract(int inte1 , int inte2)
{
return inte1 - inte2;
}
public static int multiply(int inte1 , int inte2)
{
return inte1 * inte2;
}
public static int divide(int inte1 , int inte2)
{
return inte1 / inte2;
}
}
That is a simple class which do some calculations if you have questions just list them and i will answer them insha'ALLAH
I know there will be good question so .... go a head</font>
مواقع النشر (المفضلة)