Skip to content
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
@@ -1,5 +1,5 @@
package com.zipcodewilmington.scientificcalculator;
/*

public class Calculator {

private static int result;
Expand All @@ -13,4 +13,11 @@ public int subtract(int firstNum, int secondNum) {
result = firstNum - secondNum;
return result;
}
/*<<<<<<< HEAD

//>>>>>>> 67032e40a3e1b20aaf10917261cc55a57dbfe45b
}
=======

>>>>>>> 009177cc9de68c1f0401d32805d4a54e699cc1e5
*/
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
package com.zipcodewilmington.scientificcalculator;

import com.sun.codemodel.internal.JSwitch;
/*

public class Scientific {

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


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

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

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

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

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

default:
Expand All @@ -40,52 +39,56 @@ public static void main(String[] args) {

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

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

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

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

public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
switch (operator) {
case "MC":
m1 = 0;
tfield.setText("");
case ".log":
value = Math.log10(firstNum);
break;
case "e":
value = Math.exp(firstNum);
break;
case "10x":
value = Math.exp(firstNum, 10);
break;
case "MR" :
tfield.setText("");
tfield.setText(tfield.getText() + m1);
case "-x":
value = firstNum * -1;
break;
case "M-" :
//something I have no clue
case "Ln":
value = Math.log(firstNum);
break;

}
}
default
System.out.println("ERR");}
public Double (value){
if (Math.toRadians(value))







}

}

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