//Created by mk 11.1.09 Last updated 11.5.09 (v3 to v5)

import java.util.Scanner;		//Import Scanner
import java.text.NumberFormat;	//Import NumberFormat for rounding

public class Calculator			//Class declaration

{
	static Scanner scan = new Scanner(System.in);				//Scanner name = scan
	static NumberFormat nf = NumberFormat.getNumberInstance();	//NumberFormat name = nf

	public static void main(String []args)						//Main method
	{
		int roundingInput1;		//Input for lines 17-21 (Select type of rounding)
		int roundingInput2;		//Input for lines 28-48 (Select decimal places for rouding)

		System.out.println("Calculator by mk. Updated 11.5.09 v5");		//Line 17
		System.out.println("\nPress 1 for automatic rounding");
		System.out.println("Press 2 for no rounding");
		System.out.println("Press 3 to select rounding after every calculation\n\n");	//Line 21

		roundingInput1 = scan.nextInt();

		if (roundingInput1 == 1)		//Auto rounding
		{
			System.out.print("\nWould you like to round to 1, 2, or 3 places? ");

			roundingInput2 = scan.nextInt();		//Line 28

			if (roundingInput2 == 1)
			{
				round1();
			}

			if (roundingInput2 == 2)
			{
				round2();
			}

			if (roundingInput2 == 3)
			{
				round3();
			}

			if (roundingInput2 < 1 | roundingInput2 > 3)
			{
				System.out.println("\nFail!");
			}										//Line 48
		}

		if (roundingInput1 == 2)		//No rounding,
		{
			noRound();
		}

		if (roundingInput1 == 3)		//Selective rounding
		{
			selectRound();
		}

		if (roundingInput1 < 1 | roundingInput1 > 3)
		{
			System.out.println("Fail!");
		}

	}	//End of main Method

	public static void round1()		//Auto rounding to 1 place
	{
		double addition, subtraction, multiplication, division, remainder;
		double power1, power2, power3, sqr1, sqr2;
		double abs1, abs2;							//For calculating input
		double input1, input2;							//Input of values
		int input3; 									//Choses operator
		power3 = 2;

		while (true)						//Loop
		{

			System.out.print("\nPlease enter the first value: ");

			input1 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input1);
			System.out.print("\nPlease enter the second value: ");

			input2 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input2);
			System.out.println("\nThe values you have entered are: " + input1 + " & " + input2);

			System.out.println("\n/////////\\\\\\\\\\\\\\\\\\ ");
			System.out.println("Enter a operation:");
			System.out.println("\\\\\\\\\\\\\\\\\\/////////");

			System.out.println("\nPress 1 for Addition");
			System.out.println("Press 2 for Subraction");
			System.out.println("Press 3 for Multiplication");
			System.out.println("Press 4 for Division");
			System.out.println("Press 5 for the Remainder from divisionision\n");
			System.out.println("Press 6 for the square of value 1");
			System.out.println("Press 7 for the square of value 2");
			System.out.println("Press 8 for the square root of value 1");
			System.out.println("Press 9 for the square root of value 2\n");
			System.out.println("Press 10 for the absolute value of value 1");
			System.out.println("Press 11 for the absolute value of value 2\n");

			input3 = scan.nextInt();

			if (input3 == 1)		//Addition
			{
				System.out.println("\nYou have entered Addition");
				System.out.println("for the values of " + input1 + " & " + input2);

				addition = input1+input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(addition)));
			}

			if (input3 == 2)		//Subtraction
			{
				System.out.println("\nYou have entered Subtraction");
				System.out.println("for the values of " + input1 + " & " + input2);

				subtraction = input1-input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(subtraction)));
			}

			if (input3 == 3)		//multiplicationiplication
			{
				System.out.println("\nYou have entered Multiplication");
				System.out.println("for the values of " + input1 + " & " + input2);

				multiplication = input1*input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(multiplication)));
			}

			if (input3 == 4)		//Division
			{
				System.out.println("\nYou have entered Division");
				System.out.println("for the values of " + input1 + " & " + input2);

				division = input1/input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(division)));
			}

			if (input3 == 5)		//Remainder
			{
				System.out.println("\nYou have entered Remainder");
				System.out.println("for the values of " + input1 + " & " + input2);

				remainder = input1%input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(remainder)));
			}

			if (input3 == 6)		//Square of input1
			{
				System.out.println("\nYou have entered square ");
				System.out.println("for the value of " + input1);

				power1 = input1;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
			}

			if (input3 == 7)
			{
				System.out.println("\nYou have entered square");
				System.out.println("for the value of " + input2);

				power2 = input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
			}

			if (input3 == 8)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input1);

				sqr1 = input1;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
			}

			if (input3 == 9)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input2);

				sqr2 = input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
			}

			if (input3 == 10)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input1);

				abs1 = input1;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
			}

			if (input3 == 11)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input2);

				abs2 = input2;

				nf.setMinimumFractionDigits(0);
				nf.setMaximumFractionDigits(1);

				System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
			}

			if(input3 < 1 | input3 > 11)		//For those that fail
			{
				System.out.println("\nYou fail! Read teh instructions!");
			}

		}	//End of loop
	}		//End of method

	public static void round2()		//Auto rounding to 2 places

	{
		double addition, subtraction, multiplication, division, remainder;
		double power1, power2, power3, sqr1, sqr2;
		double abs1, abs2; 					//For calculating input
		double input1, input2;					//Input of values
		int input3; 							//Choses operator
		power3 = 2;

		while (true)						//Loop
		{

			System.out.print("\nPlease enter the first value: ");

			input1 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input1);
			System.out.print("\nPlease enter the second value: ");

			input2 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input2);
			System.out.println("\nThe values you have entered are: " + input1 + " & " + input2);

			System.out.println("\n/////////\\\\\\\\\\\\\\\\\\ ");
			System.out.println("Enter a operation:");
			System.out.println("\\\\\\\\\\\\\\\\\\/////////");

			System.out.println("\nPress 1 for Addition");
			System.out.println("Press 2 for Subraction");
			System.out.println("Press 3 for Multiplication");
			System.out.println("Press 4 for Division");
			System.out.println("Press 5 for the Remainder from divisionision\n");
			System.out.println("Press 6 for the square of value 1");
			System.out.println("Press 7 for the square of value 2");
			System.out.println("Press 8 for the square root of value 1");
			System.out.println("Press 9 for the square root of value 2\n");
			System.out.println("Press 10 for the absolute value of value 1");
			System.out.println("Press 11 for the absolute value of value 2\n");

			input3 = scan.nextInt();

				if (input3 == 1)				//Addition
				{
					System.out.println("\nYou have entered Addition");
					System.out.println("for the values of " + input1 + " & " + input2);

					addition = input1+input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(addition)));
				}

				if (input3 == 2)				//Subtraction
				{
					System.out.println("\nYou have entered Subtraction");
					System.out.println("for the values of " + input1 + " & " + input2);

					subtraction = input1-input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(subtraction)));
				}

				if (input3 == 3)				//Multiplication
				{
					System.out.println("\nYou have entered Multiplication");
					System.out.println("for the values of " + input1 + " & " + input2);

					multiplication = input1*input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(multiplication)));
				}

				if (input3 == 4)				//Division
				{
					System.out.println("\nYou have entered Division");
					System.out.println("for the values of " + input1 + " & " + input2);

					division = input1/input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(division)));
				}

				if (input3 == 5)			//Remainder
				{
					System.out.println("\nYou have entered Remainder");
					System.out.println("for the values of " + input1 + " & " + input2);

					remainder = input1%input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(remainder)));
				}

				if (input3 == 6)		//Square of input1
				{
					System.out.println("\nYou have entered square ");
					System.out.println("for the value of " + input1);

					power1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
				}

				if (input3 == 7)
				{
					System.out.println("\nYou have entered square");
					System.out.println("for the value of " + input2);

					power2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
				}

				if (input3 == 8)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input1);

					sqr1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
				}

				if (input3 == 9)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input2);

					sqr2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
				}

				if (input3 == 10)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input1);

					abs1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
				}

				if (input3 == 11)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input2);

					abs2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
				}

				if(input3 < 1 | input3 > 11)		//For those that fail
				{
					System.out.println("\nYou fail! Read teh instructions!");
			}

		}	//End of loop
	} 		//End of method

	public static void round3()		//Auto rounding to 3 places
	{
		double addition, subtraction, multiplication, division, remainder;
		double power1, power2, power3, sqr1, sqr2;
		double abs1, abs2;					//For calculating input
		double input1, input2;					//Input of values
		int input3; 							//Choses operator
		power3 = 2;

		while (true)						//Loop
		{

			System.out.print("\nPlease enter the first value: ");

			input1 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input1);
			System.out.print("\nPlease enter the second value: ");

			input2 = scan.nextDouble();

			System.out.println("\nYou have entered: " + input2);
			System.out.println("\nThe values you have entered are: " + input1 + " & " + input2);

			System.out.println("\n/////////\\\\\\\\\\\\\\\\\\ ");
			System.out.println("Enter a operation:");
			System.out.println("\\\\\\\\\\\\\\\\\\/////////");

			System.out.println("\nPress 1 for Addition");
			System.out.println("Press 2 for Subraction");
			System.out.println("Press 3 for Multiplication");
			System.out.println("Press 4 for Division");
			System.out.println("Press 5 for the Remainder from divisionision\n");
			System.out.println("Press 6 for the square of value 1");
			System.out.println("Press 7 for the square of value 2");
			System.out.println("Press 8 for the square root of value 1");
			System.out.println("Press 9 for the square root of value 2\n");
			System.out.println("Press 10 for the absolute value of value 1");
			System.out.println("Press 11 for the absolute value of value 2\n");

			input3 = scan.nextInt();

				if (input3 == 1)			//Addition
				{
					System.out.println("\nYou have entered Addition");
					System.out.println("for the values of " + input1 + " & " + input2);

					addition = input1+input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(addition)));
				}

				if (input3 == 2)			//Subtraction
				{
					System.out.println("\nYou have entered Subtraction");
					System.out.println("for the values of " + input1 + " & " + input2);

					subtraction = input1-input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(subtraction)));
				}

				if (input3 == 3)			//Multiplication
				{
					System.out.println("\nYou have entered Multiplication");
					System.out.println("for the values of " + input1 + " & " + input2);

					multiplication = input1*input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(multiplication)));
				}

				if (input3 == 4)			//Division
				{
					System.out.println("\nYou have entered Division");
					System.out.println("for the values of " + input1 + " & " + input2);

					division = input1/input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(division)));
				}

				if (input3 == 5)			//Remainder
				{
					System.out.println("\nYou have entered Remainder");
					System.out.println("for the values of " + input1 + " & " + input2);

					remainder = input1%input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(remainder)));
				}

				if (input3 == 6)		//Square of input1
				{
					System.out.println("\nYou have entered square ");
					System.out.println("for the value of " + input1);

					power1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
				}

				if (input3 == 7)
				{
					System.out.println("\nYou have entered square");
					System.out.println("for the value of " + input2);

					power2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
				}

				if (input3 == 8)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input1);

					sqr1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
				}

				if (input3 == 9)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input2);

					sqr2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
				}

				if (input3 == 10)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input1);

					abs1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
				}

				if (input3 == 11)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input2);

					abs2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
				}

				if(input3 < 1 | input3 > 11)		//For those that fail
				{
					System.out.println("\nYou fail! Read teh instructions!");
				}
			}		//End of loop
	}				//End of method

	public static void noRound()	//No rounding at all

	{
		double addition, subtraction, multiplication, division, remainder;
		double power1, power2, power3, sqr1, sqr2;
		double abs1, abs2;		//Variables to calculate
		double input1, input2;		//Input for 2 vaules being calculated
		int input3;				//Input for which operator
		power3 = 2;

		while (true)			//Loop statement
		{

		System.out.print("\nPlease enter the first value: ");

		input1 = scan.nextDouble();	//First value

		System.out.println("\nYou have entered: " + input1);
		System.out.print("\nPlease enter the second value: ");

		input2 = scan.nextDouble();	//Second value

		System.out.println("\nYou have entered: " + input2);
		System.out.println("\nThe values you have entered are: " + input1 + " & " + input2);

		System.out.println("\n/////////\\\\\\\\\\\\\\\\\\ ");
		System.out.println("Enter a operation:");
		System.out.println("\\\\\\\\\\\\\\\\\\/////////");

		System.out.println("\nPress 1 for Addition");
		System.out.println("Press 2 for Subraction");
		System.out.println("Press 3 for Multiplication");
		System.out.println("Press 4 for Division");
		System.out.println("Press 5 for the Remainder from divisionision\n");
		System.out.println("Press 6 for the square of value 1");
		System.out.println("Press 7 for the square of value 2");
		System.out.println("Press 8 for the square root of value 1");
		System.out.println("Press 9 for the square root of value 2\n");
		System.out.println("Press 10 for the absolute value of value 1");
		System.out.println("Press 11 for the absolute value of value 2\n");

		input3 = scan.nextInt();		//Input for operator

			if (input3 == 1)			//Addition
			{
				System.out.println("\nYou have entered Addition");
				addition = input1+input2;
				System.out.println("for the values of " + input1 + " & " + input2);
				System.out.println("\nThe answer is: " + addition);
			}

			if (input3 == 2)			//Subtraction
			{
				System.out.println("\nYou have entered Subtraction");
				System.out.println("for the values of " + input1 + " & " + input2);
				subtraction = input1-input2;
				System.out.println("\nThe answer is: " + subtraction);
			}

			if (input3 == 3)			//Multiplication
			{
				System.out.println("\nYou have entered Multiplication");
				System.out.println("for the values of " + input1 + " & " + input2);
				multiplication = input1*input2;
				System.out.println("\nThe answer is: " + multiplication);
			}

			if (input3 == 4)			//Division
			{
				System.out.println("\nYou have entered Division");
				System.out.println("for the values of " + input1 + " & " + input2);
				division = input1/input2;
				System.out.println("\nThe answer is: " + division);
			}

			if (input3 == 5)			//Remainder
			{
				System.out.println("\nYou have entered Remainder");
				System.out.println("for the values of " + input1 + " & " + input2);
				remainder = input1%input2;
				System.out.println("\nThe answer is: " + remainder);
			}

			if(input3 < 1 | input3 > 9)		//For those that fail
			{
				System.out.println("\nYou fail! Read teh instructions!");
			}

			if (input3 == 6)		//Square of input1
			{
				System.out.println("\nYou have entered square ");
				System.out.println("for the value of " + input1);

				power1 = input1;

				System.out.println("\nThe answer is: " + (Math.pow(power1, power3)));
			}

			if (input3 == 7)
			{
				System.out.println("\nYou have entered square");
				System.out.println("for the value of " + input2);

				power2 = input2;

				System.out.println("\nThe answer is: " + (Math.pow(power2, power3)));
			}

			if (input3 == 8)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input1);

				sqr1 = input1;

				System.out.println("\nThe answer is: " + (Math.sqrt(sqr1)));
			}

			if (input3 == 9)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input2);

				sqr2 = input2;

				System.out.println("\nThe answer is: " + (Math.sqrt(sqr2)));
			}

			if (input3 == 10)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input1);

				abs1 = input1;

				System.out.println("\nThe answer is: " + (Math.abs(abs1)));
			}

			if (input3 == 11)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input2);

				abs2 = input2;

				System.out.println("\nThe answer is: " + (Math.abs(abs2)));
			}

			if(input3 < 1 | input3 > 11)		//For those that fail
			{
				System.out.println("\nYou fail! Read teh instructions!");
			}

		}	//End of loop
	}		//End of method


	public static void selectRound()	//Selective rounding

	{
		double addition, subtraction, multiplication, division, remainder;
		double power1, power2, power3, sqr1, sqr2;
		double abs1, abs2;					//For calculating input
		double input1, input2;					//Input of values
		int input3; 							//Choses operator
		int input4;							//Selects rounding or not
		int input5;							//Select decimal places ot round to
		power3 = 2;


		while (true)						//Loop
		{

		System.out.print("\nPlease enter the first value: ");

		input1 = scan.nextDouble();

		System.out.println("\nYou have entered: " + input1);
		System.out.print("\nPlease enter the second value: ");

		input2 = scan.nextDouble();

		System.out.println("\nYou have entered: " + input2);
		System.out.println("\nThe values you have entered are: " + input1 + " & " + input2);

		System.out.println("\n/////////\\\\\\\\\\\\\\\\\\ ");
		System.out.println("Enter a operation:");
		System.out.println("\\\\\\\\\\\\\\\\\\/////////");

		System.out.println("\nPress 1 for Addition");
		System.out.println("Press 2 for Subraction");
		System.out.println("Press 3 for Multiplication");
		System.out.println("Press 4 for Division");
		System.out.println("Press 5 for the Remainder from divisionision\n");
		System.out.println("Press 6 for the square of value 1");
		System.out.println("Press 7 for the square of value 2");
		System.out.println("Press 8 for the square root of value 1");
		System.out.println("Press 9 for the square root of value 2\n");
		System.out.println("Press 10 for the absolute value of value 1");
		System.out.println("Press 11 for the absolute value of value 2\n");

		input3 = scan.nextInt();		//Operator input

		System.out.print("\nWould you like to round? (1-Yes 2-No) ");

		input4 = scan.nextInt();		//Rounding input

		if (input4 == 1)				//Yes to rounding
		{
			System.out.print("\nTo 1, 2, or 3 places? ");

			input5 = scan.nextInt();	//Input for decimal places

			if (input5 == 1)			//1 place
			{
				if (input3 == 1)		//Addition
				{
					System.out.println("\nYou have entered Addition");
					System.out.println("for the values of " + input1 + " & " + input2);

					addition = input1+input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(addition)));
				}

				if (input3 == 2)		//Subtraction
				{
					System.out.println("\nYou have entered Subtraction");
					System.out.println("for the values of " + input1 + " & " + input2);

					subtraction = input1-input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(subtraction)));
				}

				if (input3 == 3)		//multiplicationiplication
				{
					System.out.println("\nYou have entered Multiplication");
					System.out.println("for the values of " + input1 + " & " + input2);

					multiplication = input1*input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(multiplication)));
				}

				if (input3 == 4)		//Division
				{
					System.out.println("\nYou have entered Division");
					System.out.println("for the values of " + input1 + " & " + input2);

					division = input1/input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(division)));
				}

				if (input3 == 5)		//Remainder
				{
					System.out.println("\nYou have entered Remainder");
					System.out.println("for the values of " + input1 + " & " + input2);

					remainder = input1%input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(remainder)));
				}

				if (input3 == 6)		//Square of input1
				{
					System.out.println("\nYou have entered square ");
					System.out.println("for the value of " + input1);

					power1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
				}

				if (input3 == 7)
				{
					System.out.println("\nYou have entered square");
					System.out.println("for the value of " + input2);

					power2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
				}

				if (input3 == 8)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input1);

					sqr1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
				}

				if (input3 == 9)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input2);

					sqr2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
				}

				if (input3 == 10)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input1);

					abs1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
				}

				if (input3 == 11)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input2);

					abs2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(1);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
				}

				if(input3 < 1 | input3 > 11)		//For those that fail
				{
					System.out.println("\nYou fail! Read teh instructions!");
				}
			} //End of if (input5 == 1)

			if (input5 == 2)					//if 2 places
			{
				if (input3 == 1)				//Addition
				{
					System.out.println("\nYou have entered Addition");
					System.out.println("for the values of " + input1 + " & " + input2);

					addition = input1+input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(addition)));
				}

				if (input3 == 2)				//Subtraction
				{
					System.out.println("\nYou have entered Subtraction");
					System.out.println("for the values of " + input1 + " & " + input2);

					subtraction = input1-input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(subtraction)));
				}

				if (input3 == 3)				//Multiplication
				{
					System.out.println("\nYou have entered Multiplication");
					System.out.println("for the values of " + input1 + " & " + input2);

					multiplication = input1*input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(multiplication)));
				}

				if (input3 == 4)				//Division
				{
					System.out.println("\nYou have entered Division");
					System.out.println("for the values of " + input1 + " & " + input2);

					division = input1/input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(division)));
				}

				if (input3 == 5)			//Remainder
				{
					System.out.println("\nYou have entered Remainder");
					System.out.println("for the values of " + input1 + " & " + input2);

					remainder = input1%input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(remainder)));
				}

				if (input3 == 6)		//Square of input1
				{
					System.out.println("\nYou have entered square ");
					System.out.println("for the value of " + input1);

					power1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
				}

				if (input3 == 7)
				{
					System.out.println("\nYou have entered square");
					System.out.println("for the value of " + input2);

					power2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
				}

				if (input3 == 8)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input1);

					sqr1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
				}

				if (input3 == 9)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input2);

					sqr2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
				}

				if (input3 == 10)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input1);

					abs1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
				}

				if (input3 == 11)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input2);

					abs2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(2);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
				}

				if(input3 < 1 | input3 > 11)		//For those that fail
				{
					System.out.println("\nYou fail! Read teh instructions!");
				}

			} //End of if (input5 == 2)

			if (input5 == 3)				//3 places
			{
				if (input3 == 1)			//Addition
				{
					System.out.println("\nYou have entered Addition");
					System.out.println("for the values of " + input1 + " & " + input2);

					addition = input1+input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(addition)));
				}

				if (input3 == 2)			//Subtraction
				{
					System.out.println("\nYou have entered Subtraction");
					System.out.println("for the values of " + input1 + " & " + input2);

					subtraction = input1-input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(subtraction)));
				}

				if (input3 == 3)			//Multiplication
				{
					System.out.println("\nYou have entered Multiplication");
					System.out.println("for the values of " + input1 + " & " + input2);

					multiplication = input1*input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(multiplication)));
				}

				if (input3 == 4)			//Division
				{
					System.out.println("\nYou have entered Division");
					System.out.println("for the values of " + input1 + " & " + input2);

					division = input1/input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(division)));
				}

				if (input3 == 5)			//Remainder
				{
					System.out.println("\nYou have entered Remainder");
					System.out.println("for the values of " + input1 + " & " + input2);

					remainder = input1%input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(remainder)));
				}

				if (input3 == 6)		//Square of input1
				{
					System.out.println("\nYou have entered square ");
					System.out.println("for the value of " + input1);

					power1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power1, power3))));
				}

				if (input3 == 7)
				{
					System.out.println("\nYou have entered square");
					System.out.println("for the value of " + input2);

					power2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.pow(power2, power3))));
				}

				if (input3 == 8)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input1);

					sqr1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr1))));
				}

				if (input3 == 9)
				{
					System.out.println("\nYou have entered square root");
					System.out.println("for the value of " + input2);

					sqr2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.sqrt(sqr2))));
				}

				if (input3 == 10)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input1);

					abs1 = input1;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs1))));
				}

				if (input3 == 11)
				{
					System.out.println("\nYou have absolute value");
					System.out.println("for the value of " + input2);

					abs2 = input2;

					nf.setMinimumFractionDigits(0);
					nf.setMaximumFractionDigits(3);

					System.out.println("\nThe answer is: " + (nf.format(Math.abs(abs2))));
				}

				if(input3 < 1 | input3 > 11)		//For those that fail
				{
					System.out.println("\nYou fail! Read teh instructions!");
				}


			} //End of if (input5 == 3)

		} //End of if (input4 == 1)

		if (input4 == 2)			//If no rounding
		{
			if (input3 == 1)		//Addition
			{
				System.out.println("\nYou have entered Addition");
				System.out.println("for the values of " + input1 + " & " + input2);
				addition = input1+input2;
				System.out.println("\nThe answer is: " + addition);
			}

			if (input3 == 2)		//Subtraction
			{
				System.out.println("\nYou have entered Subtraction");
				System.out.println("for the values of " + input1 + " & " + input2);
				subtraction = input1-input2;
				System.out.println("\nThe answer is: " + subtraction);
			}

			if (input3 == 3)		//Multiplication
			{
				System.out.println("\nYou have entered Multiplication");
				System.out.println("for the values of " + input1 + " & " + input2);
				multiplication = input1*input2;
				System.out.println("\nThe answer is: " + multiplication);
			}

			if (input3 == 4)		//Division
			{
				System.out.println("\nYou have entered Division");
				System.out.println("for the values of " + input1 + " & " + input2);
				division = input1/input2;
				System.out.println("\nThe answer is: " + division);
			}

			if (input3 == 5)		//Remainder
			{
				System.out.println("\nYou have entered Remainder");
				System.out.println("for the values of " + input1 + " & " + input2);
				remainder = input1%input2;
				System.out.println("\nThe answer is: " + remainder);
			}

			if (input3 == 6)		//Square of input1
			{
				System.out.println("\nYou have entered square ");
				System.out.println("for the value of " + input1);

				power1 = input1;

				System.out.println("\nThe answer is: " + (Math.pow(power1, power3)));
			}

			if (input3 == 7)
			{
				System.out.println("\nYou have entered square");
				System.out.println("for the value of " + input2);

				power2 = input2;

				System.out.println("\nThe answer is: " + (Math.pow(power2, power3)));
			}

			if (input3 == 8)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input1);

				sqr1 = input1;

				System.out.println("\nThe answer is: " + (Math.sqrt(sqr1)));
			}

			if (input3 == 9)
			{
				System.out.println("\nYou have entered square root");
				System.out.println("for the value of " + input2);

				sqr2 = input2;

				System.out.println("\nThe answer is: " + (Math.sqrt(sqr2)));
			}

			if (input3 == 10)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input1);

				abs1 = input1;

				System.out.println("\nThe answer is: " + (Math.abs(abs1)));
			}

			if (input3 == 11)
			{
				System.out.println("\nYou have absolute value");
				System.out.println("for the value of " + input2);

				abs2 = input2;

				System.out.println("\nThe answer is: " + (Math.abs(abs2)));
			}

			if(input3 < 1 | input3 > 11)		//For those that fail
			{
				System.out.println("\nYou fail! Read teh instructions!");
			}
		} 	//End of if (input4 == 2)

		}	//End of loop

	}		//End of method

}			//End of class



