/** * Write a description of class Operations here. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; public class Operations { // instance variables - replace the example below with your own private int x; scienticFunctions scientificOperator = new scienticFunctions(); /** * Constructor for objects of class Operations */ public Operations() { // initialise instance variables //x = 0; } /** * An example of a method - replace this comment with your own * * @param y a sample parameter for a method * @return the sum of x and y */ public static void runCommand() { // put your code here Scanner input = new Scanner(System.in); Double result = 0.0; double firstNumber = 0.0; double SecondNumber =0.0; //String userInput = scanner.nextLine(); scienticFunctions ScientificFunctions = new scienticFunctions(); // Calculator calc = new .... while (true) { System.out.print("Enter a command: "); String command = input.next(); if (command.equalsIgnoreCase("exit")) { System.out.print("Thanks for calculating with us!"); break; } if (command.equalsIgnoreCase("sine")) { // read first number System.out.print("Enter a number: "); firstNumber = input.nextDouble(); // read second number //double secondNumber = input.nextDouble(); // call the add method on calc and display result = ScientificFunctions.sine(firstNumber); //firstNumber = result; //result = firstNumber; Console.printResult(result); } if (command.equalsIgnoreCase("cos")) { // read first number firstNumber = input.nextDouble(); // call the cosine method on calc and display result = ScientificFunctions.cos(firstNumber); Console.printResult(result); } if (command.equalsIgnoreCase("tan")) { // call the square method on calc and display firstNumber = input.nextDouble(); result = ScientificFunctions.tangent(firstNumber); Console.printResult(result); } if (command.equalsIgnoreCase("cos-1")) { // call the square method on calc and display firstNumber = input.nextDouble(); result = ScientificFunctions.inverseCosine(firstNumber); Console.printResult(result); } if (command.equalsIgnoreCase("sin-1")) { // call the square method on calc and display firstNumber = input.nextDouble(); result = ScientificFunctions.inverseSine(firstNumber); Console.printResult(result); } if (command.equalsIgnoreCase("tan-1")) { // call the square method on calc and display firstNumber = input.nextDouble(); result = ScientificFunctions.inverseTangent(firstNumber); Console.printResult(result); } firstNumber = result; // and on and on } } //Add CommentCollapse  }