Skip to content

things #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ public class Console =
}


public static String menuOption1() {
String prompt;
prompt = Console.getStringInput("1, 2, 3");
switch () {
case "1":
System.out.println("Here are some Basic Functions. \n+ \nAddition , - \n-Subtraction , / \n-Division , * \n-Multiplication");
break;
case "2":
System.out.println("Here are some Scientific Functions. \nSine() \nCosine() \nTangant");
break;
case "3":
System.out.println("Something Fun!");
break;
default:
Console.println("[ %s ] is not a valid input!", prompt);
break;
}


/*

System.out.println("Please enter a number");
Expand All @@ -32,8 +51,10 @@ public class Console =
System.out.println(x);


String s = Console.getStringInput("Enter a string");
String s = Console.getStringInput("Enter a string");
String s = CalculatorEngine.getStringInput("Enter a string");

Double d = Console.getDoubleInput("Enter a double.");

Console.println("The user input %s as a string", s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,88 @@
/*
public class Scientific {

public static Double triganometry(firstNum, secondNum)
public static void main(String[] args) {
int firstNum = 0;
double answer = 0.0;
char operator = 0;


switch (operator) {
case "cos":
answer = Math.cos(firstNum);
break;
case "tan":
answer = Math.sin(firstNum);
break;

case "sin":
answer = Math.tan(firstNum);
break;

case "acos":
answer = Math.acos(firstNum);
break;

case "atan":
answer = Math.atan(firstNum);
break;

case "asin":
answer = Math.asin(firstNum);
break;

default:
System.out.println("ERR");
}

switch (operator) {
case "x2":
answer = Math.pow(firstNum, 2);
break;
case "x^":
answer = Math.sqrt(firstNum);
break;

case "x3":
answer = Math.pow(firstNum, 3);
break;

case "!x":
long fact = 1;
for (int i = 2; i <= firstNum; i++) {
answer = fact * i;
}
break;

default:
System.out.println("ERR");
}
public Integer
}

public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
switch (operator) {
case "MC":
m1 = 0;
tfield.setText("");
break;
case "MR" :
tfield.setText("");
tfield.setText(tfield.getText() + m1);
break;
case "M-" :
//something I have no clue
break;

}
}

}
=======
switch (operator)(
case "cos":
)
}
*/
*/