import java.io.*;

import java.util.*;

public class Calculator

{

public static void main(String[] args) throws IOException

{

BufferedReader keyboard = new BufferedReader (new InputStreamReader (System.in));

String input, input1, input2;

double num1, num2, answer;

System.out.println ("\t\t\tWelcome to the calculator!");

do

{

System.out.print ("\nWould you like to Multiply(m), Divide(d), Subtract(s), Add(a)?: ");

input = keyboard.readLine();

if (input.equals("m"))

{

System.out.print ("Please enter the first number!: ");

num1 = Double.parseDouble (input1 = keyboard.readLine());

System.out.print ("Please enter the second number!: ");

num2 = Double.parseDouble (input1 = keyboard.readLine());

answer = num1*num2;

System.out.print ("You chose to multiply."+"\t"+"The Product is: "+answer);

}

if (input.equals("d"))

{

System.out.print ("Please enter the first number!: ");

num1 = Double.parseDouble (input1 = keyboard.readLine());

System.out.print ("Please enter the second number!: ");

num2 = Double.parseDouble (input2 = keyboard.readLine());

answer = num1/num2;

System.out.print ("You chose to divide."+"\t"+"The Dividend is: "+answer);

}

if (input.equals("a"))

{

System.out.print ("Please enter the first number!: ");

num1 = Double.parseDouble (input1 = keyboard.readLine());

System.out.print ("Please enter the second number!: ");

num2 = Double.parseDouble (input2 = keyboard.readLine());

answer = num1+num2;

System.out.print ("You chose to add."+"\t"+"The Sum is: "+answer);

}

if (input.equals("s"))

{

System.out.print ("Please enter the first number!: ");

num1 = Double.parseDouble (input1 = keyboard.readLine());

System.out.print ("Please enter the second number!: ");

num2 = Double.parseDouble (input2 = keyboard.readLine());

answer = num1-num2;

System.out.print ("You chose to subtract."+"\t"+"The Diffrence is: "+answer);

}

System.out.print ("\nWould you like another calculation (y/n)?: ");

input = keyboard.readLine();

}

while(input.equals("y"));

if(input.equals("n"));

System.exit(0);

}

}