From ab4090574575a42d73d5e0f5711fd94a8745df74 Mon Sep 17 00:00:00 2001 From: Raheel Uppal Date: Fri, 7 Feb 2020 19:12:31 -0500 Subject: [PATCH 1/9] phase 1 --- .../scientificcalculator/Calculator.java | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java new file mode 100644 index 00000000..29bf9987 --- /dev/null +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -0,0 +1,115 @@ +package com.zipcodewilmington.scientificcalculator; + +public class Calculator { + + public String mode = "dec"; + + + + public double add(double var1, double var2) { + return var1 + var2; + } + + public double subtract(double var1, double var2) { + return var1 - var2; + } + + public double multiply(double var1, double var2) { + return var1 * var2; + } + + public double divide(double var1, double var2) { + return var1 / var2; + } + + public double square(double var1) { + return var1 * var1; + } + + public double squareRoot(double var1) { + return Math.sqrt(var1); + } + + public double exponent(double var1, double var2) { + return Math.pow(var1, var2); + } + + public double inverse(double var1) { + return (1 / var1); + } + + public double signSwitch(double var1) { + return (var1 * -1); + } + + public double sin(double var1) { + return (Math.sin(var1)); + } + + public double cos(double var1) { + return (Math.cos(var1)); + } + + public double tangent(double var1) { + return (Math.tan(var1)); + + } + + public double InverseSin(double var1) { + return (Math.asin(var1)); + } + + public double InverseCos(double var1) { + return (Math.acos(var1)); + } + + public double InverseTangent(double var1) { + return (Math.atan(var1)); + } + + public double log(double var1) { + return (Math.log(var1)); + } + + public double log10X(double var1) { + return (Math.log10(var1)); + } + + public double tenToThe(double var1) { + return (Math.pow(10,var1)); + } + + public double Ex(double var1) { + return (Math.exp(var1)); + } + + public double Ln(double var1) { + return (-Math.log(1 - var1) / var1); + } + + public double factorial(double var1) { + double factorial = 1; + for (int i = 2; i <= var1; i++) { + factorial = factorial * i; + } + return factorial; + + } + + public int DecimalToOther(int var1, int radix){ + Integer.toString(var1, radix); + return var1; + } + + public int BinToDec( int var1 ){ + return var1; + } + public int OctToDec( int var1 ){ + return var1; + } + public int HexToODec( int var1 ){ + return var1; + } + +} + From 0a974545baf6081dfaddecb29793417b3a5e65d2 Mon Sep 17 00:00:00 2001 From: Leila Hsiao Date: Fri, 7 Feb 2020 20:04:57 -0500 Subject: [PATCH 2/9] test --- pom.xml | 9 ++++++++- .../scientificcalculator/Calculator.java | 13 +------------ .../scientificcalculator/MainApplication.java | 16 +++++++++------- .../TestMainApplication.java | 12 ++++++++++-- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index e7cb4f6b..1c0640f9 100644 --- a/pom.xml +++ b/pom.xml @@ -8,5 +8,12 @@ scientific_calculator 1.0-SNAPSHOT - + + + junit + junit + 4.12 + test + + \ No newline at end of file diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index 29bf9987..7e8ab74b 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -67,9 +67,7 @@ public double InverseTangent(double var1) { return (Math.atan(var1)); } - public double log(double var1) { - return (Math.log(var1)); - } + public double log(double var1) { return (Math.log(var1));} public double log10X(double var1) { return (Math.log10(var1)); @@ -101,15 +99,6 @@ public int DecimalToOther(int var1, int radix){ return var1; } - public int BinToDec( int var1 ){ - return var1; - } - public int OctToDec( int var1 ){ - return var1; - } - public int HexToODec( int var1 ){ - return var1; - } } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java index 5f421325..d6020dd6 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java @@ -5,13 +5,15 @@ */ public class MainApplication { public static void main(String[] args) { - Console.println("Welcome to my calculator!"); - String s = Console.getStringInput("Enter a string"); - Integer i = Console.getIntegerInput("Enter an integer"); - Double d = Console.getDoubleInput("Enter a double."); + Console.println("Welcome to the Calculator Team 3!"); - Console.println("The user input %s as a string", s); - Console.println("The user input %s as a integer", i); - Console.println("The user input %s as a d", d); + + //String s = Console.getStringInput("Enter a string"); + //Integer i = Console.getIntegerInput("Enter an integer"); + //Double d = Console.getDoubleInput("Enter a double."); + + //Console.println("The user input %s as a string", s); + //Console.println("The user input %s as a integer", i); + //Console.println("The user input %s as a d", d); } } diff --git a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java index 94e8d987..13022e6a 100644 --- a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java +++ b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java @@ -1,7 +1,15 @@ package com.zipcodewilmington.scientific_calculator; - +import com.zipcodewilmington.scientificcalculator.Calculator; +import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Created by leon on 2/9/18. */ public class TestMainApplication { -} + @Test + public void test1() + { + Calculator c1 = new Calculator(); + assertEquals(55.0 ,c1.add(10.0, 45.0), 0.01); + } +} \ No newline at end of file From b3231a17ee7b132d7ad1fad1852d102610098f5d Mon Sep 17 00:00:00 2001 From: chipfody <60615532+chipfody@users.noreply.github.com> Date: Sat, 8 Feb 2020 11:47:16 -0500 Subject: [PATCH 3/9] Sat1 --- .DS_Store | Bin 0 -> 6148 bytes pom.xml | 8 ++ src/.DS_Store | Bin 0 -> 6148 bytes src/main/.DS_Store | Bin 0 -> 6148 bytes src/main/java/.DS_Store | Bin 0 -> 6148 bytes src/main/java/com/.DS_Store | Bin 0 -> 6148 bytes src/main/java/com/zipcodewilmington/.DS_Store | Bin 0 -> 6148 bytes .../scientificcalculator/Calculator.java | 24 ++-- .../TestMainApplication.java | 134 +++++++++++++++++- 9 files changed, 149 insertions(+), 17 deletions(-) create mode 100644 .DS_Store create mode 100644 src/.DS_Store create mode 100644 src/main/.DS_Store create mode 100644 src/main/java/.DS_Store create mode 100644 src/main/java/com/.DS_Store create mode 100644 src/main/java/com/zipcodewilmington/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7a0dfc61ae91affce3f84d7a112e9d61e2c6ec7b GIT binary patch literal 6148 zcmeHK!EVz)5S>j@x(-6*fYcuMQi(%UC4eXhA-N$v^nipgDhFD%b{$bmt~ZJuLYoHp zH`+hwr|<=Q4$SOsBGR`BHZV?(MU66|N ztRM+PhWggT|fPgunJrM>s;S#T(S8zm1>;;K4`Ofovhrh4)G!?Q1ugF039hMf+gTg-oh6Zk!fu%C=2MYvqK>z>% literal 0 HcmV?d00001 diff --git a/pom.xml b/pom.xml index e7cb4f6b..a578ffa5 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,14 @@ com.zipcodewilmington scientific_calculator 1.0-SNAPSHOT + + + junit + junit + RELEASE + test + + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..78b6c8b2aa1d24a44081a38b3a3bf487c75e31c3 GIT binary patch literal 6148 zcmeHK%}T>S5T313w-vDmL65lz9(rh1{6U0J_25m2=s~3>wrC(`rAaMXD|rol10TgF z@NslzcP;*2i^>elezUVPo9wq?Hv<5o-f7kV$^aly2@6GRz7ZNH{UQbHaS#Q~u@kG) zFjgVS`XTX)Y}cR^U&IRO2q>^2=}8_w^5$nR7n;@Nvo}sqhbQStyb+<+}_Gcwc;)ejBOj&$`2Q&r?yz<*gtdcYIQM>~gv>=7-6G4wS_MRZ@vM>Y805k9x7_dj7 zocIeb%kRhxFatwnfX)XOmC&=88`MV!Ho62rq~Ay_XzO2pM3)?hp2gfCdQgN(MKr0x zmKefT4#K44xM$;YgC-q>elpHupDb*JB5dIyTpbR=GsrD7zzlq3V8nFGbpLPvT>pPe z;vO@=4E!qwgtO&u)p1GoZvC=2x@%q36I2q4%MA`v(9l;g#?nd|vE*XfP#oQoz QQ20kc)4&ZgFjNL!0dS0FwEzGB literal 0 HcmV?d00001 diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a31746febf2f7c7347b92d1c5507a6267753af19 GIT binary patch literal 6148 zcmeHK!AiqG5Z!I7ZYyFBf<5LUc<7;3v5E+x)o-`oGHR^%9 z_5$g_GcHK-{~5r&%dlJKvLSQ7?B4;*ZN4i}g-qkTxZgGV{OWZBzaN!KZ#fqkA+jRd$QMSVt^K{CRW6stMQc>4l#15Q_U?F`73&-2!+P`X{$cbu zetOn>!Qn$yvTASwFJMdy96G%)kl_vZCh?OvLSldzAO_}u0dus8(KeW9R7VF4ss#YdfLjUJ>enC8LIS5Z-O8ZYyFBf<5LUc<7;3@dpt?t%u%(h#pjGVv7c1R@&5}wUXD+H}VO5 z9G%&n7E1Ldf@KC~zsc;(hWR$^W`q#3)@xOTC<-AIC}JiL!#9HSs8f<5PZm((8u~hj zbO2Ad9Ls-T0QW8{u7wtNjc8*3_F-oI(}*dAqJn<+o_6^?xR1haQmK5%Og1++zo1k> z6_yH@-mUI?iJ$bkHNSI?Pse_88<2gXbu_m9;52Oao5htw9VdPmw>u^|Y_%ce;w+3? zx?j`1xYaf5cy>amyvjF=rNLlhZ@27JtCeBd8SLy-%Ffp2_HdY2t83MR#?{^9)8Kjd z@@jWN!bfUknQ#PeU{HAvUMG%pd;^|Q^eBpv8DIvOftg`|4mh z-8xkz-n9%Ee8hBs^{*-|)dQ4da literal 0 HcmV?d00001 diff --git a/src/main/java/com/.DS_Store b/src/main/java/com/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..382707c180f59557d574fcacfc360afb7cc6c868 GIT binary patch literal 6148 zcmeHKQEL-H5S~q=ZX#j?!9MPb;6ok~6|0DF#P*?Y!ihepw0FJG9$arja`CV+a(|=! zNBsr<9Q|f@Q7%kW|sZ#*u5blHJWEbq8<@xC}XRG;Sa*|tZUK=o(-UK zH7sQ`rkZjp)}qC69U0(vcaKi+#wK(?zrMd?_)0pY3f^+Jum@>jQ$+Kp@)G*!hZ9(r zs*u*RNvLq1PKtb14F=y;YomSR<}Izex_hVlDL%4wTqV_fHcF-+_~}hj9i_p3Yi)61 zC+WL4GPCu_&dY4(>coCR>yGa1^)?ra$1k4u&2Tta z_RV5zYtT1OpFCSGJNm)H;j7*K<1Z(RughDE=JVf-W z(yD@>Fdz&F16RU8IE?h|D_LC@6$XTX>&yV34+hE@1#CRJqXUC$0f23|oxtWFM9wh* zqkxS^%s`Y+1^QGKS`6jW;Wr^J3fOq`>7+vQp~A{4bSTQLj{3%hlZrgbC=3V#zcawS zAEd|k|IXk0e-|W!Fdz*4pA4w>cDy~p-oo9wwoATi4RjyM!f}nqixe2{Dn=|{#hXwk Z@EbOOQNYF{JP`R2a5Tsu4E$3Dega6qYZd?i literal 0 HcmV?d00001 diff --git a/src/main/java/com/zipcodewilmington/.DS_Store b/src/main/java/com/zipcodewilmington/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d6f72465fc6a69e26c3266d2b983a15b294d1573 GIT binary patch literal 6148 zcmeHKQEL-H5S~q=ZX#kH3ifed1RwH{Sg}ee9I-z1O*qkqD(zj8+Jp19wBlkD- zANdRXIr`1+rYNakUqY1`nEmEvXJ)x?kKG$0QiJKJPt+kI4P|V!FkB)$&$=Rw;Mo8w zSEHbcGCF|{SE9vn9U0)g+oTfvmC=}f-M=9vl*2#8m|$NmO%8H9Ommwehd-EI=z||l zU|pe3IxEjYop0$`o|RRv_gytMnm2CV(z>nNciL~`Q#*^Rq?(q4WOB$)FOups4facG z^9wskUuEOjQD^g+Evh6d#uJyEjm8Lh^ExX=b~donVpO_1v7gYorCUdxt@-@n(q{waY z4mrzu%Q}L>fG{8otbu`W^yu4bSWA`=284lsivd0#43senSbKCw2L{&y0Gn_-fz7{$ zoMQq;0c($#fheB}^r71CbvAM}rK)z*-sj39^!IR{#J2 literal 0 HcmV?d00001 diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index 29bf9987..7dc62930 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -75,17 +75,14 @@ public double log10X(double var1) { return (Math.log10(var1)); } - public double tenToThe(double var1) { + public double invLog(double var1) { return (Math.pow(10,var1)); } - public double Ex(double var1) { + public double invNatLog(double var1) { return (Math.exp(var1)); } - public double Ln(double var1) { - return (-Math.log(1 - var1) / var1); - } public double factorial(double var1) { double factorial = 1; @@ -96,19 +93,14 @@ public double factorial(double var1) { } - public int DecimalToOther(int var1, int radix){ - Integer.toString(var1, radix); - return var1; - } - - public int BinToDec( int var1 ){ - return var1; + public String DecimalToOther(int var1, int radix){ + return Integer.toString(var1, radix); } - public int OctToDec( int var1 ){ - return var1; + public double toRadians(double var1) { + return Math.toRadians(var1); } - public int HexToODec( int var1 ){ - return var1; + public double toDegrees(double var1) { + return Math.toDegrees(var1); } } diff --git a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java index 94e8d987..91b172bd 100644 --- a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java +++ b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java @@ -1,7 +1,139 @@ -package com.zipcodewilmington.scientific_calculator; +package com.zipcodewilmington.scientific_calculator; +import com.zipcodewilmington.scientificcalculator.Calculator; +import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Created by leon on 2/9/18. */ public class TestMainApplication { + @Test + public void test1() + { + Calculator c1 = new Calculator(); + assertEquals(55.0 ,c1.add(10.0, 45.0), 0.01); + } + @Test + public void test2() + { + Calculator c1 = new Calculator(); + assertEquals(10.0 ,c1.subtract(55.0, 45.0), 0.01); + } + @Test + public void test3() + { + Calculator c1 = new Calculator(); + assertEquals(50.0 ,c1.multiply(10.0, 5.0), 0.01); + } + @Test + public void test4() + { + Calculator c1 = new Calculator(); + assertEquals(2.0, c1.divide(10.0, 5.0), 0.01); + } + @Test + public void test5() + { + Calculator c1 = new Calculator(); + assertEquals(25.0, c1.square( 5.0), 0.01); + } + @Test + public void test6() { + Calculator c1 = new Calculator(); + assertEquals(5.0, c1.squareRoot(25.0), 0.01); + } + @Test + public void test7() { + Calculator c1 = new Calculator(); + assertEquals(32.0, c1.exponent(2.0, 5.0), 0.01); + } + @Test + public void test8() { + Calculator c1 = new Calculator(); + assertEquals(0.01, c1.inverse(100.0), 0.01); + } + @Test + public void test9() { + Calculator c1 = new Calculator(); + assertEquals(-7.0, c1.signSwitch(7.0), 0.01); + } + @Test + public void test10() { + Calculator c1 = new Calculator(); + assertEquals(-0.98, c1.sin(30.0), 0.01); + } + + @Test + public void test11() { + Calculator c1 = new Calculator(); + assertEquals(0.154, c1.cos(30.0), 0.01); + } + + @Test + public void test12() { + Calculator c1 = new Calculator(); + assertEquals(-1.995, c1.tangent(90.0), 0.01); + } + + @Test + public void test13() { + Calculator c1 = new Calculator(); + assertEquals(1.57, c1.InverseSin(1.0), 0.01); + } + @Test + public void test14() { + Calculator c1 = new Calculator(); + assertEquals(0.98, c1.InverseCos(30.0), 0.01); + } + @Test + public void test15() { + Calculator c1 = new Calculator(); + assertEquals(0.98, c1.InverseTangent(30.0), 0.01); + } + @Test + public void test16() { + Calculator c1 = new Calculator(); + assertEquals(4.499, c1.log(90.0), 0.01); + } + @Test + public void test17() { + Calculator c1 = new Calculator(); + assertEquals(0.301, c1.log10X(2.0), 0.01); + } + @Test + public void test18() { + Calculator c1 = new Calculator(); + assertEquals(100.00, c1.invLog(2.0), 0.01); + } + @Test + public void test19() { + Calculator c1 = new Calculator(); + assertEquals(148.41, c1.invNatLog(5.0), 0.01); + } + @Test + public void test20() { + Calculator c1 = new Calculator(); + assertEquals(720, c1.factorial(6), 0.01); + } + @Test + public void test21() { + Calculator c1 = new Calculator(); + assertEquals("ff", c1.DecimalToOther(255, 16)); + } + @Test + public void test22() { + Calculator c1 = new Calculator(); + assertEquals("10", c1.DecimalToOther(2, 2)); + } + @Test + public void test23() { + Calculator c1 = new Calculator(); + assertEquals(3.14, c1.toRadians(180), 0.01); + } + @Test + public void test24() { + Calculator c1 = new Calculator(); + assertEquals(180.00, c1.toDegrees(Math.PI), 0.001); + } + } From 3c2246cfa2e877c16ef1901c89d947eadaed77e7 Mon Sep 17 00:00:00 2001 From: Leila Hsiao Date: Sat, 8 Feb 2020 14:10:00 -0500 Subject: [PATCH 4/9] main --- .../scientificcalculator/Calculator.java | 21 +-- .../scientificcalculator/Console.java | 2 +- .../scientificcalculator/MainApplication.java | 130 +++++++++++++++++- 3 files changed, 135 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index 7e8ab74b..3f57af79 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -50,10 +50,7 @@ public double cos(double var1) { return (Math.cos(var1)); } - public double tangent(double var1) { - return (Math.tan(var1)); - - } + public double tangent(double var1) { return (Math.tan(var1)); } public double InverseSin(double var1) { return (Math.asin(var1)); @@ -73,11 +70,11 @@ public double log10X(double var1) { return (Math.log10(var1)); } - public double tenToThe(double var1) { + public double invLog(double var1) { return (Math.pow(10,var1)); } - public double Ex(double var1) { + public double invNatLog(double var1) { return (Math.exp(var1)); } @@ -91,12 +88,16 @@ public double factorial(double var1) { factorial = factorial * i; } return factorial; - } - public int DecimalToOther(int var1, int radix){ - Integer.toString(var1, radix); - return var1; + public String DecimalToOther(int var1, int radix){ + return Integer.toString(var1, radix); + } + public double toRadians(double var1) { + return Math.toRadians(var1); + } + public double toDegrees(double var1) { + return Math.toDegrees(var1); } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java index 83f0e97f..73a91e89 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java @@ -17,7 +17,7 @@ public static void println(String output, Object... args) { public static String getStringInput(String prompt) { Scanner scanner = new Scanner(System.in); - println(prompt); + print(prompt); String userInput = scanner.nextLine(); return userInput; } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java index d6020dd6..dba2278f 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java @@ -5,15 +5,131 @@ */ public class MainApplication { public static void main(String[] args) { - Console.println("Welcome to the Calculator Team 3!"); + //Create a instance of Calculator + Calculator c = new Calculator(); + String result = ""; + double cur = 0.0; + boolean byeFlag = false; + double num1 = 0; + String ans = "N" ; - //String s = Console.getStringInput("Enter a string"); - //Integer i = Console.getIntegerInput("Enter an integer"); - //Double d = Console.getDoubleInput("Enter a double."); - //Console.println("The user input %s as a string", s); - //Console.println("The user input %s as a integer", i); - //Console.println("The user input %s as a d", d); + Console.println("!!!!Welcome to the Calculator Team 3!!!!"); + while(!byeFlag){ + Console.println("Current value: " + cur); + String comment = Console.getStringInput("Please enter a comment! (Enter HELP for user manual) "); + + if(comment.equals("add") || comment.equals("subtract") || comment.equals("multiply") || comment.equals("divide") || comment.equals("exponent")) { + + if(ans.equals("N")) { + String input1 = Console.getStringInput("Please enter the 1st number: "); + num1 = Double.parseDouble(input1); + } + + String input2 = Console.getStringInput("Please enter the 2nd number: "); + double num2 = Double.parseDouble(input2); + if (comment.equals("add")) { + cur = c.add(num1, num2); + } else if (comment.equals("subtract")) { + cur = c.subtract(num1, num2); + } else if (comment.equals("multiply")) { + cur = c.multiply(num1, num2); + } else if (comment.equals("divide")) { + if(num2 == 0) { + result = "ERROR!!" ; + } + cur = c.divide(num1, num2); + } else if (comment.equals("exponent")) { + cur = c.exponent(num1, num2); + } + }else if(comment.equalsIgnoreCase("help")){ + Console.print("Here are the available commends:\n" + + printHelp("Sine", "sin") + + printHelp("Cosine", "cos") + + printHelp("Tangent", "tan") + + printHelp("Inverse Sine", "arcsin") + + printHelp("Inverse Cosine", "arccon") + + printHelp("Inverse Tangent", "arctan") + + printHelp("Logarithm", "log") + + printHelp("Inverse Log", "10to") + + printHelp("Natural Log ", "ln") + + printHelp("Inverse Natural Log", "ex") + + printHelp("Inverse number", "inv") + + printHelp("Square", "sq") + + printHelp("Square Root", "sqrt") + + printHelp("Factorial", "!") + + printHelp("Degree to Radian", "toRad") + + printHelp("Radian to Degree", "toDeg") + + printHelp("Decimal to Hexadecimal", "toHex") + + printHelp("Decimal to Octal", "toOct") + + printHelp("Decimal to Binary", "toBin") + + printHelp("Clear Value", "reset") + ); + }else if(comment.equalsIgnoreCase("BYE")){ + byeFlag = true; + }else{ + String input = Console.getStringInput("Please enter a number:"); + double num = Double.parseDouble(input); + + if(comment.equals("sq")) { + cur = c.square(num) ; + }else if(comment.equals("sqrt")){ + if(num == -1) { + result = "ERROR!!"; + } + cur = c.squareRoot(num) ; + }else if(comment.equals("sin")){ + cur = c.sin(num); + }else if(comment.equals("cos")){ + cur = c.cos(num); + }else if(comment.equals("tan")){ + cur = c.tangent(num); + }else if(comment.equals("arcsin")){ + cur = c.InverseSin(num); + }else if(comment.equals("arccos")){ + cur = c.InverseCos(num); + }else if(comment.equals("arctan")){ + cur = c.InverseTangent(num); + }else if(comment.equals("log")){ + cur = c.log(num); + }else if(comment.equals("log10X")) { + cur = c.log10X(num); + }else if(comment.equals("log")) { + cur = c.invLog(num); + }else if(comment.equals("log")) { + cur = c.invNatLog(num); + }else if(comment.equals("!")) { + cur = c.factorial(num); + }else if(comment.equals("log")) { + cur = c.log(num); + }else if(comment.equals("toDeg")) { + cur = c.toDegrees(num); + }else if(comment.equals("toRad")) { + cur = c.toRadians(num); + }else if(comment.equals("toHex`")) { + result = c.DecimalToOther((int)num, 16); + }else if(comment.equals("toOct")) { + result = c.DecimalToOther((int)num, 8); + }else if(comment.equals("toBin")) { + result = c.DecimalToOther((int)num, 1); + } + } + //print result + result = cur + ""; + Console.println("Your result is " + result + " :)"); + Console.println("What do you want to do next?"); + ans = Console.getStringInput("Keep the current number?(Y/N): "); + if(ans.equalsIgnoreCase("Y")){ + num1 = cur; + } + else{ + cur = 0; + } + } + } + + public static String printHelp(String description, String ops ){ + return String.format("%-27s%s\n", description, ops).replace(' ', '-'); } } From ba78954f8c14568c1053b163a170c12f76663b3c Mon Sep 17 00:00:00 2001 From: Leila Hsiao Date: Sat, 8 Feb 2020 17:51:57 -0500 Subject: [PATCH 5/9] main --- .../scientificcalculator/Calculator.java | 6 +- .../scientificcalculator/MainApplication.java | 206 +++++++++++++----- 2 files changed, 160 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index 3f57af79..f225835f 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -100,6 +100,10 @@ public double toDegrees(double var1) { return Math.toDegrees(var1); } - + public double secretof73 (double var1) { + double divisor = var1; + var1 = ((((var1 * 10001) /137)/var1)); + return var1; + } } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java index dba2278f..15a5920b 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java @@ -10,41 +10,54 @@ public static void main(String[] args) { Calculator c = new Calculator(); String result = ""; double cur = 0.0; + double curTemp = 0.0; boolean byeFlag = false; double num1 = 0; - String ans = "N" ; - + double num = 0; + double mem = 0; + boolean skip = false; + String ans = " " ; + Console.println("=================================================="); Console.println("!!!!Welcome to the Calculator Team 3!!!!"); - while(!byeFlag){ + Console.println("=================================================="); + while(!byeFlag) { + skip = false; + curTemp = cur; Console.println("Current value: " + cur); - String comment = Console.getStringInput("Please enter a comment! (Enter HELP for user manual) "); - if(comment.equals("add") || comment.equals("subtract") || comment.equals("multiply") || comment.equals("divide") || comment.equals("exponent")) { + String command = Console.getStringInput("Please enter a command! (Enter HELP for user manual) "); + + if (command.equalsIgnoreCase("add") || command.equalsIgnoreCase("subtract") || + command.equalsIgnoreCase("multiply") || command.equalsIgnoreCase("divide") + || command.equalsIgnoreCase("exponent")) { - if(ans.equals("N")) { + if (ans.equals("N") || ans.equals(" ")) { String input1 = Console.getStringInput("Please enter the 1st number: "); num1 = Double.parseDouble(input1); } String input2 = Console.getStringInput("Please enter the 2nd number: "); double num2 = Double.parseDouble(input2); - if (comment.equals("add")) { + if (command.equalsIgnoreCase("add")) { cur = c.add(num1, num2); - } else if (comment.equals("subtract")) { + } else if (command.equalsIgnoreCase("subtract")) { cur = c.subtract(num1, num2); - } else if (comment.equals("multiply")) { + } else if (command.equalsIgnoreCase("multiply")) { cur = c.multiply(num1, num2); - } else if (comment.equals("divide")) { - if(num2 == 0) { - result = "ERROR!!" ; - } + } else if (command.equalsIgnoreCase("divide")) { cur = c.divide(num1, num2); - } else if (comment.equals("exponent")) { + } else if (command.equalsIgnoreCase("exponent")) { cur = c.exponent(num1, num2); } - }else if(comment.equalsIgnoreCase("help")){ + } else if (command.equalsIgnoreCase("help")) { Console.print("Here are the available commends:\n" + + + printHelp("Add", "add") + + printHelp("Subtract", "subtract") + + printHelp("Multiply", "multiply") + + printHelp("Divide", "divide") + + printHelp("Exponent", "exponent") + printHelp("Sine", "sin") + printHelp("Cosine", "cos") + printHelp("Tangent", "tan") + @@ -63,69 +76,160 @@ public static void main(String[] args) { printHelp("Radian to Degree", "toDeg") + printHelp("Decimal to Hexadecimal", "toHex") + printHelp("Decimal to Octal", "toOct") + - printHelp("Decimal to Binary", "toBin") + - printHelp("Clear Value", "reset") + printHelp("Decimal to Binary", "toBin") ); - }else if(comment.equalsIgnoreCase("BYE")){ + }else if(command.equalsIgnoreCase("+M")) { + mem += cur; + Console.println("OK! I added "+ cur +" to memory! Memory is now "+mem); + skip = true; + }else if(command.equalsIgnoreCase("clearM")) { + mem = 0 ; + Console.println("OK! I reset the memory, memory is now "+mem); + skip = true; + }else if(command.equalsIgnoreCase("showM")) { + Console.println("M is "+mem); + skip = true; + }else if(command.equalsIgnoreCase("M")){ + mem = cur; + Console.println("OK! Memory is now set to "+mem); + skip = true; + }else if(command.equalsIgnoreCase("BYE")){ byeFlag = true; + break; + }else if(command.equalsIgnoreCase("zipcode")){ + Console.println("Cohort 6.0 is the BEST COHORT EVER!!!!!"); + skip = true; }else{ - String input = Console.getStringInput("Please enter a number:"); - double num = Double.parseDouble(input); + if(ans.equalsIgnoreCase("N") || ans.equalsIgnoreCase(" ") || command.equalsIgnoreCase("set")) { + if (command.equalsIgnoreCase("neg") || command.equalsIgnoreCase("inv") || + command.equalsIgnoreCase("sq") || command.equalsIgnoreCase("sqrt") || + command.equalsIgnoreCase("sin") || command.equalsIgnoreCase("cos") || + command.equalsIgnoreCase("tan") || command.equalsIgnoreCase("arcsin") + || command.equalsIgnoreCase("arccos") + || command.equalsIgnoreCase("arctan") || + command.equalsIgnoreCase("log") || command.equalsIgnoreCase("log10X") + || command.equalsIgnoreCase("invlog") + || command.equalsIgnoreCase("invnatlog") || + command.equalsIgnoreCase("ex") || command.equalsIgnoreCase("!") + || command.equalsIgnoreCase("toDeg") + || command.equalsIgnoreCase("toRad") || + command.equalsIgnoreCase("toHex") || command.equalsIgnoreCase("toOct") + || command.equalsIgnoreCase("toBin") || command.equalsIgnoreCase("set")) { + String input = Console.getStringInput("Please enter a number: "); + num = Double.parseDouble(input); + } + } - if(comment.equals("sq")) { + if(command.equalsIgnoreCase("set")) { + cur = num; + skip = true; + num1 = cur; + ans = "Y"; + }else if(command.equalsIgnoreCase("neg")) { + cur = c.signSwitch(num); + }else if(command.equalsIgnoreCase("inv")) { + cur = c.inverse(num) ; + }else if(command.equalsIgnoreCase("sq")) { cur = c.square(num) ; - }else if(comment.equals("sqrt")){ + }else if(command.equalsIgnoreCase("sqrt")){ if(num == -1) { result = "ERROR!!"; } cur = c.squareRoot(num) ; - }else if(comment.equals("sin")){ + }else if(command.equalsIgnoreCase("sin")){ cur = c.sin(num); - }else if(comment.equals("cos")){ + }else if(command.equalsIgnoreCase("cos")){ cur = c.cos(num); - }else if(comment.equals("tan")){ + }else if(command.equalsIgnoreCase("tan")){ cur = c.tangent(num); - }else if(comment.equals("arcsin")){ + }else if(command.equalsIgnoreCase("arcsin")){ cur = c.InverseSin(num); - }else if(comment.equals("arccos")){ + }else if(command.equalsIgnoreCase("arccos")){ cur = c.InverseCos(num); - }else if(comment.equals("arctan")){ + }else if(command.equalsIgnoreCase("arctan")){ cur = c.InverseTangent(num); - }else if(comment.equals("log")){ + }else if(command.equalsIgnoreCase("log")){ cur = c.log(num); - }else if(comment.equals("log10X")) { + }else if(command.equalsIgnoreCase("log10X")) { cur = c.log10X(num); - }else if(comment.equals("log")) { + }else if(command.equalsIgnoreCase("invlog")) { cur = c.invLog(num); - }else if(comment.equals("log")) { + }else if(command.equalsIgnoreCase("ex")) { cur = c.invNatLog(num); - }else if(comment.equals("!")) { + }else if(command.equalsIgnoreCase("!")) { cur = c.factorial(num); - }else if(comment.equals("log")) { - cur = c.log(num); - }else if(comment.equals("toDeg")) { + }else if(command.equalsIgnoreCase("toDeg")) { cur = c.toDegrees(num); - }else if(comment.equals("toRad")) { + }else if(command.equalsIgnoreCase("toRad")) { cur = c.toRadians(num); - }else if(comment.equals("toHex`")) { + }else if(command.equalsIgnoreCase("toHex")) { result = c.DecimalToOther((int)num, 16); - }else if(comment.equals("toOct")) { + }else if(command.equalsIgnoreCase("toOct")) { result = c.DecimalToOther((int)num, 8); - }else if(comment.equals("toBin")) { - result = c.DecimalToOther((int)num, 1); + }else if(command.equalsIgnoreCase("toBin")) { + result = c.DecimalToOther((int)num, 2); + }else if(command.equalsIgnoreCase("always73")) { + if(cur>=1000){ + cur = c.secretof73(num); + }else{ + Console.println("Sorry, this only works if input is a 4-digit number!"); + skip = true; + } + }else{ + Console.println("That's not a valid command!!"); + skip = true; } } - //print result - result = cur + ""; - Console.println("Your result is " + result + " :)"); - Console.println("What do you want to do next?"); - ans = Console.getStringInput("Keep the current number?(Y/N): "); - if(ans.equalsIgnoreCase("Y")){ - num1 = cur; - } - else{ - cur = 0; + + + if( !skip ){ + //print result + if(Double.isNaN(cur) || cur == Double.POSITIVE_INFINITY || cur == Double.NEGATIVE_INFINITY ) { + Console.println("ERROR!!! :("); + cur = curTemp; + }else if(command.equalsIgnoreCase("toHex")){ + Console.println("Decimal "+ (int)num +" is " + result + " in Hexadecimal!"); + num1 = num; + }else if(command.equalsIgnoreCase("toOct")){ + Console.println("Decimal "+ (int)num +" is " + result + " in Octal!"); + num1 = num; + }else if(command.equalsIgnoreCase("toBin")){ + Console.println("Decimal "+ (int)num +" is " + result + " in Binary!"); + num1 = num; + }else if(command.equalsIgnoreCase("always73")){ + double a = c.multiply(num,10001); + double b = c.divide(a,137); + double cc = c.divide(b,num); + + Console.println(num + " * 10001 = " + a ); + Console.println(a+" / 137 = "+ b); + Console.println(b + " / "+num+" = " + (int)cc ); + Console.println("Your result is " + (int)cur + " :)"); + + }else{ + Console.println("Your result is " + cur + " :)"); + } + + if(cur != curTemp && !Double.isNaN(cur)) { + Console.println("What do you want to do next?"); + ans = Console.getStringInput("Keep the current number?(Y/N): "); + //if the ans is bad then it will run this loop + while (!ans.equalsIgnoreCase("Y") && !ans.equalsIgnoreCase("N") && !ans.equalsIgnoreCase("bye")){ + ans = Console.getStringInput("Keep the current number?(Y/N): "); + } + if (ans.equalsIgnoreCase("Y")) { + num1 = cur; + num = cur; + } else if (ans.equalsIgnoreCase("N")) { + cur = 0; + } else if (ans.equalsIgnoreCase("bye")) { + byeFlag = true; + break; + } + } } + Console.println("=================================================="); + } } From c2e6ba1964400f0e162c7bc237cdfa5bccd97ac0 Mon Sep 17 00:00:00 2001 From: chipfody <60615532+chipfody@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:44:21 -0500 Subject: [PATCH 6/9] Sat Night --- .../scientificcalculator/Calculator.java | 20 ++- .../TestMainApplication.java | 115 +++++++++++++++--- 2 files changed, 116 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index 7dc62930..aa190e32 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -85,12 +85,15 @@ public double invNatLog(double var1) { public double factorial(double var1) { - double factorial = 1; - for (int i = 2; i <= var1; i++) { - factorial = factorial * i; - } - return factorial; + if (var1 < 0) {return (Double.NaN);} + else { + double factorial = 1; + for (int i = 2; i <= var1; i++) { + factorial = factorial * i; + } + return factorial; + } } public String DecimalToOther(int var1, int radix){ @@ -102,6 +105,13 @@ public double toRadians(double var1) { public double toDegrees(double var1) { return Math.toDegrees(var1); } + public double secretof73 (double var1) { + double divisor = var1; + var1 = ((((var1 * 10001) /137)/var1)); + return var1; + + + } } diff --git a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java index 91b172bd..0108417d 100644 --- a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java +++ b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java @@ -8,117 +8,200 @@ */ public class TestMainApplication { @Test - public void test1() - { + public void test1() { Calculator c1 = new Calculator(); - assertEquals(55.0 ,c1.add(10.0, 45.0), 0.01); + assertEquals(55.0, c1.add(10.0, 45.0), 0.01); + assertEquals(2.0, c1.add(-5.0, 7.0), 0.01); + assertEquals(-290.0, c1.add(-25.0, -265.0), 0.01); + assertEquals(100012345.0, c1.add(100000000, 12345.0), 0.01); + assertEquals(110.69, c1.add(23.567, 87.123), 0.01); } @Test - public void test2() - { + public void test2() { Calculator c1 = new Calculator(); - assertEquals(10.0 ,c1.subtract(55.0, 45.0), 0.01); + assertEquals(-35.0, c1.subtract(10.0, 45.0), 0.01); + assertEquals(-12.0 ,c1.subtract(-5.0, 7.0), 0.01); + assertEquals(240.0 ,c1.subtract(-25.0, -265.0), 0.01); + assertEquals(-33.15 ,c1.subtract(34.678, 67.832), 0.01); + assertEquals(-63.556 ,c1.subtract(23.567, 87.123), 0.01); } @Test public void test3() { Calculator c1 = new Calculator(); assertEquals(50.0 ,c1.multiply(10.0, 5.0), 0.01); + assertEquals(-53.0 ,c1.multiply(-10.0, 5.3), 0.01); + assertEquals(45.27 ,c1.multiply(1.002, 45.180), 0.01); + assertEquals(203.205 ,c1.multiply(-34.50, -5.89), 0.01); + assertEquals(60.795 ,c1.multiply(0.579, 105.0), 0.01); } @Test public void test4() { Calculator c1 = new Calculator(); assertEquals(2.0, c1.divide(10.0, 5.0), 0.01); + assertEquals(3.114, c1.divide(106.0, 34.04), 0.01); + assertEquals(-31.267, c1.divide(-23.45, 0.75), 0.01); + assertEquals(3.0, c1.divide(0.75, 0.25), 0.01); + assertEquals(300.0, c1.divide(.09, 0.0003), 0.01); } @Test public void test5() { Calculator c1 = new Calculator(); assertEquals(25.0, c1.square( 5.0), 0.01); + assertEquals(1.0, c1.square( 1.0), 0.01); + assertEquals(25.0, c1.square( -5.0), 0.01); + assertEquals(0.1369, c1.square( 0.370), 0.01); + assertEquals(1000000.0, c1.square( 1000.0), 0.01); } @Test public void test6() { Calculator c1 = new Calculator(); assertEquals(5.0, c1.squareRoot(25.0), 0.01); + assertEquals(Double.NaN, c1.squareRoot(-1.0), 0.01); + assertEquals(1.0, c1.squareRoot(1.0), 0.01); + assertEquals(12.0, c1.squareRoot(144.0), 0.01); + assertEquals(31.623, c1.squareRoot(1000.0), 0.01); } @Test public void test7() { Calculator c1 = new Calculator(); assertEquals(32.0, c1.exponent(2.0, 5.0), 0.01); + assertEquals(0.03125, c1.exponent(2.0, -5.0), 0.01); + assertEquals(1.189, c1.exponent(2.0, 0.25), 0.01); + assertEquals(0.01, c1.exponent(10.0, -2.0), 0.01); + assertEquals(282475249.0, c1.exponent(7.0, 10.0), 0.01); } @Test public void test8() { Calculator c1 = new Calculator(); assertEquals(0.01, c1.inverse(100.0), 0.01); + assertEquals(0.04, c1.inverse(25.0), 0.01); + assertEquals(2.0, c1.inverse(0.5), 0.01); + assertEquals(-0.0435, c1.inverse(-23.0), 0.01); + assertEquals(0.08734, c1.inverse(11.45), 0.01); } @Test public void test9() { Calculator c1 = new Calculator(); assertEquals(-7.0, c1.signSwitch(7.0), 0.01); + assertEquals(7.0, c1.signSwitch(-7.0), 0.01); + assertEquals(-0.04, c1.signSwitch(0.04), 0.01); + assertEquals(4.67, c1.signSwitch(-4.67), 0.01); + assertEquals(67.89, c1.signSwitch(-67.89), 0.01); } @Test public void test10() { Calculator c1 = new Calculator(); - assertEquals(-0.98, c1.sin(30.0), 0.01); + assertEquals(0.0, c1.sin(0.0), 0.01); + assertEquals(-0.468, c1.sin(500.0), 0.01); + assertEquals(-0.894, c1.sin(-90.0), 0.01); + assertEquals(0.102, c1.sin(75.5), 0.01); + assertEquals(-0.851, c1.sin(-310.0), 0.01); } @Test public void test11() { Calculator c1 = new Calculator(); assertEquals(0.154, c1.cos(30.0), 0.01); + assertEquals(1.0, c1.cos(0.0), 0.01); + assertEquals(0.814, c1.cos(-120.0), 0.01); + assertEquals(-0.884, c1.cos(500.0), 0.01); + assertEquals( -0.839, c1.cos(-10.0), 0.01); } @Test public void test12() { Calculator c1 = new Calculator(); - assertEquals(-1.995, c1.tangent(90.0), 0.01); + assertEquals(0.0, c1.tangent(0.0), 0.01); + assertEquals( 0.713, c1.tangent(120.0), 0.01); + assertEquals(0.134, c1.tangent(-25.0), 0.01); + assertEquals(-0.074, c1.tangent( 65.9), 0.01); + assertEquals(-3.38, c1.tangent(360.0), 0.01); + } @Test public void test13() { Calculator c1 = new Calculator(); - assertEquals(1.57, c1.InverseSin(1.0), 0.01); + assertEquals(Double.NaN, c1.InverseSin(30.0), 0.01); + assertEquals(1.571, c1.InverseSin(1.0), 0.01); + assertEquals(0.644, c1.InverseSin(0.6), 0.01); + assertEquals(-0.253, c1.InverseSin(-0.25), 0.01); + assertEquals(0.0, c1.InverseSin(0.0), 0.01); } @Test public void test14() { Calculator c1 = new Calculator(); - assertEquals(0.98, c1.InverseCos(30.0), 0.01); + assertEquals(Double.NaN, c1.InverseCos(30.0), 0.01); + assertEquals(2.587, c1.InverseCos(-0.85), 0.01); + assertEquals(0.00, c1.InverseCos(1.0), 0.01); + assertEquals(1.17, c1.InverseCos(0.39), 0.01); + assertEquals(2.214, c1.InverseCos(-0.60), 0.01); } @Test public void test15() { Calculator c1 = new Calculator(); - assertEquals(0.98, c1.InverseTangent(30.0), 0.01); + assertEquals(1.537, c1.InverseTangent(30.0), 0.01); + assertEquals(0.785, c1.InverseTangent(1.0), 0.01); + assertEquals(1.554, c1.InverseTangent(60.0), 0.01); + assertEquals(1.559, c1.InverseTangent(90.0), 0.01); + assertEquals(-1.559, c1.InverseTangent(-84.0), 0.01); } @Test public void test16() { Calculator c1 = new Calculator(); assertEquals(4.499, c1.log(90.0), 0.01); + assertEquals(0.0, c1.log(1.0), 0.01); + assertEquals(Double.NaN, c1.log(-60.0), 0.01); + assertEquals(3.912, c1.log(50.0), 0.01); + assertEquals(9.210, c1.log(10000.0), 0.01); } @Test public void test17() { Calculator c1 = new Calculator(); - assertEquals(0.301, c1.log10X(2.0), 0.01); + assertEquals(1.954, c1.log10X(90.0), 0.01); + assertEquals(0.0, c1.log10X(1.0), 0.01); + assertEquals(Double.NaN, c1.log10X(-60.0), 0.01); + assertEquals(1.699, c1.log10X(50.0), 0.01); + assertEquals(4.0, c1.log10X(10000.0), 0.01); } @Test public void test18() { Calculator c1 = new Calculator(); assertEquals(100.00, c1.invLog(2.0), 0.01); + assertEquals(1.0E25, c1.invLog(25.0), 0.01); + assertEquals(1.778, c1.invLog(0.25), 0.01); + assertEquals(0.00001, c1.invLog(-5.0), 0.01); + assertEquals(1.002, c1.invLog(0.001), 0.01); } @Test public void test19() { Calculator c1 = new Calculator(); assertEquals(148.41, c1.invNatLog(5.0), 0.01); + assertEquals(2.718, c1.invNatLog(1.0), 0.01); + assertEquals(0.0067, c1.invNatLog(-5.0), 0.01); + assertEquals(1.994, c1.invNatLog(0.69), 0.01); + assertEquals(22026.466, c1.invNatLog(10.0), 0.01); } @Test public void test20() { Calculator c1 = new Calculator(); - assertEquals(720, c1.factorial(6), 0.01); + assertEquals(720.0, c1.factorial(6.0), 0.01); + assertEquals(Double.NaN, c1.factorial(-1.0), 0.01); + assertEquals(1.0, c1.factorial(1.0), 0.01); + assertEquals(1.5511210043330986E25, c1.factorial( 25), 0.01); + assertEquals(1.0, c1.factorial(0), 0.01); } @Test public void test21() { Calculator c1 = new Calculator(); assertEquals("ff", c1.DecimalToOther(255, 16)); + assertEquals("1f4", c1.DecimalToOther(500, 16)); + assertEquals("1", c1.DecimalToOther(1, 16)); + assertEquals("-5a", c1.DecimalToOther(-90, 16)); + assertEquals("19", c1.DecimalToOther(25, 16)); } @Test public void test22() { @@ -135,5 +218,9 @@ public void test24() { Calculator c1 = new Calculator(); assertEquals(180.00, c1.toDegrees(Math.PI), 0.001); } - + @Test + public void test25() { + Calculator c1 = new Calculator(); + assertEquals(73.00, c1.secretof73(8419), 0.001); + } } From 6b106019364e488eefe1ddcbecdfca6435715634 Mon Sep 17 00:00:00 2001 From: chipfody <60615532+chipfody@users.noreply.github.com> Date: Sat, 8 Feb 2020 19:21:25 -0500 Subject: [PATCH 7/9] Sat Night part 2 --- .../TestMainApplication.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java index 0108417d..f42eb64f 100644 --- a/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java +++ b/src/test/java/com/zipcodewilmington/scientific_calculator/TestMainApplication.java @@ -207,20 +207,36 @@ public void test21() { public void test22() { Calculator c1 = new Calculator(); assertEquals("10", c1.DecimalToOther(2, 2)); + assertEquals("1111100", c1.DecimalToOther(124, 2)); + assertEquals("0", c1.DecimalToOther(0, 2)); + assertEquals("10000000001", c1.DecimalToOther(1025, 2)); + assertEquals("1010011101", c1.DecimalToOther(669, 2)); } @Test public void test23() { Calculator c1 = new Calculator(); assertEquals(3.14, c1.toRadians(180), 0.01); + assertEquals(4.451, c1.toRadians(255), 0.01); + assertEquals(0.261, c1.toRadians(15), 0.01); + assertEquals(-1.571, c1.toRadians(-90), 0.01); + assertEquals(0, c1.toRadians(0), 0.01); } @Test public void test24() { Calculator c1 = new Calculator(); assertEquals(180.00, c1.toDegrees(Math.PI), 0.001); + assertEquals(515.662, c1.toDegrees(9), 0.001); + assertEquals(0.00, c1.toDegrees(0), 0.001); + assertEquals(572.958, c1.toDegrees(10), 0.001); + assertEquals(20626.480624, c1.toDegrees(360), 0.001); } @Test public void test25() { Calculator c1 = new Calculator(); assertEquals(73.00, c1.secretof73(8419), 0.001); + assertEquals(73.00, c1.secretof73(52), 0.001); + assertEquals(73.00, c1.secretof73(1492), 0.001); + assertEquals(73.00, c1.secretof73(813), 0.001); + assertEquals(73.00, c1.secretof73(2468), 0.001); } } From 07ea73d7adf2495f77b4892d4c1df2ce490e1e02 Mon Sep 17 00:00:00 2001 From: Leila Hsiao Date: Sat, 8 Feb 2020 23:42:19 -0500 Subject: [PATCH 8/9] sat --- .../scientificcalculator/Calculator.java | 20 +- .../scientificcalculator/Console.java | 10 +- .../scientificcalculator/MainApplication.java | 301 +++++++++--------- 3 files changed, 177 insertions(+), 154 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java index f225835f..2a0a5004 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Calculator.java @@ -90,7 +90,7 @@ public double factorial(double var1) { return factorial; } - public String DecimalToOther(int var1, int radix){ + public String DecimalToOther(int var1, int radix){ return Integer.toString(var1, radix); } public double toRadians(double var1) { @@ -105,5 +105,23 @@ public double secretof73 (double var1) { var1 = ((((var1 * 10001) /137)/var1)); return var1; } + + public int OtherToDecimal(String var1, int radix){ + return Integer.parseInt(var1, radix); + } + + public boolean isPrime(double n) { + if (n <= 1 || n != (int)n) { + return false; + } + + for (int i = 2; i < Math.sqrt(n); i++) { + if (n % i == 0) { + return false; + } + } + return true; + } + } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java b/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java index 73a91e89..582f163b 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Console.java @@ -27,6 +27,14 @@ public static Integer getIntegerInput(String prompt) { } public static Double getDoubleInput(String prompt) { - return null; + Scanner scanner = new Scanner(System.in); + print(prompt); + while(true){ + try { + return Double.valueOf(scanner.nextLine()); + } catch (Exception e) { + print("Input invalid, please enter again:"); + } + } } } diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java index 15a5920b..1582e2dc 100644 --- a/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java @@ -1,5 +1,8 @@ package com.zipcodewilmington.scientificcalculator; +import java.text.DecimalFormat; +import java.text.NumberFormat; + /** * Created by leon on 2/9/18. */ @@ -8,226 +11,208 @@ public static void main(String[] args) { //Create a instance of Calculator Calculator c = new Calculator(); + NumberFormat nf = new DecimalFormat("0.#####################"); String result = ""; double cur = 0.0; double curTemp = 0.0; - boolean byeFlag = false; - double num1 = 0; - double num = 0; double mem = 0; - boolean skip = false; - String ans = " " ; + int mode = 10; Console.println("=================================================="); Console.println("!!!!Welcome to the Calculator Team 3!!!!"); Console.println("=================================================="); - while(!byeFlag) { - skip = false; + while(true) { curTemp = cur; - Console.println("Current value: " + cur); + if(mode != 10) { + Console.println("[ "+modeName(mode)+" Mode ] (Any decimal point will be truncated)"); + Console.println("Current Value: " + c.DecimalToOther((int)cur,mode)); + }else { + Console.println("Current Value: " + nf.format(cur)); + } String command = Console.getStringInput("Please enter a command! (Enter HELP for user manual) "); - if (command.equalsIgnoreCase("add") || command.equalsIgnoreCase("subtract") || - command.equalsIgnoreCase("multiply") || command.equalsIgnoreCase("divide") - || command.equalsIgnoreCase("exponent")) { + if (command.equalsIgnoreCase("add") || command.equalsIgnoreCase("sub") || + command.equalsIgnoreCase("mul") || command.equalsIgnoreCase("div") + || command.equalsIgnoreCase("pow") || command.equalsIgnoreCase("set")) { - if (ans.equals("N") || ans.equals(" ")) { - String input1 = Console.getStringInput("Please enter the 1st number: "); - num1 = Double.parseDouble(input1); - } - String input2 = Console.getStringInput("Please enter the 2nd number: "); - double num2 = Double.parseDouble(input2); + double num1 = Console.getDoubleInput("Please enter a number: "); + if (command.equalsIgnoreCase("add")) { - cur = c.add(num1, num2); - } else if (command.equalsIgnoreCase("subtract")) { - cur = c.subtract(num1, num2); - } else if (command.equalsIgnoreCase("multiply")) { - cur = c.multiply(num1, num2); - } else if (command.equalsIgnoreCase("divide")) { - cur = c.divide(num1, num2); - } else if (command.equalsIgnoreCase("exponent")) { - cur = c.exponent(num1, num2); + cur = c.add(cur, num1); + } else if (command.equalsIgnoreCase("sub")) { + cur = c.subtract(cur, num1); + } else if (command.equalsIgnoreCase("mul")) { + cur = c.multiply(cur, num1); + } else if (command.equalsIgnoreCase("div")) { + cur = c.divide(cur, num1); + } else if (command.equalsIgnoreCase("pow")) { + cur = c.exponent(cur, num1); + } else if(command.equalsIgnoreCase("set")) { + cur = num1; + //num1 = cur; + //ans = "Y"; } - } else if (command.equalsIgnoreCase("help")) { - Console.print("Here are the available commends:\n" + - - printHelp("Add", "add") + - printHelp("Subtract", "subtract") + - printHelp("Multiply", "multiply") + - printHelp("Divide", "divide") + - printHelp("Exponent", "exponent") + - printHelp("Sine", "sin") + - printHelp("Cosine", "cos") + - printHelp("Tangent", "tan") + - printHelp("Inverse Sine", "arcsin") + - printHelp("Inverse Cosine", "arccon") + - printHelp("Inverse Tangent", "arctan") + - printHelp("Logarithm", "log") + - printHelp("Inverse Log", "10to") + - printHelp("Natural Log ", "ln") + - printHelp("Inverse Natural Log", "ex") + - printHelp("Inverse number", "inv") + - printHelp("Square", "sq") + - printHelp("Square Root", "sqrt") + - printHelp("Factorial", "!") + - printHelp("Degree to Radian", "toRad") + - printHelp("Radian to Degree", "toDeg") + - printHelp("Decimal to Hexadecimal", "toHex") + - printHelp("Decimal to Octal", "toOct") + - printHelp("Decimal to Binary", "toBin") - ); - }else if(command.equalsIgnoreCase("+M")) { + + }else if(command.equalsIgnoreCase("useM")) { + cur = mem; + }else if(command.equalsIgnoreCase("M+")) { mem += cur; - Console.println("OK! I added "+ cur +" to memory! Memory is now "+mem); - skip = true; + Console.println("OK! I added "+ nf.format(cur) +" to memory! Memory is now "+nf.format(mem)); }else if(command.equalsIgnoreCase("clearM")) { mem = 0 ; - Console.println("OK! I reset the memory, memory is now "+mem); - skip = true; + Console.println("OK! I reset the memory, memory is now "+nf.format(mem)); }else if(command.equalsIgnoreCase("showM")) { - Console.println("M is "+mem); - skip = true; + Console.println("M is "+nf.format(mem)); }else if(command.equalsIgnoreCase("M")){ mem = cur; - Console.println("OK! Memory is now set to "+mem); - skip = true; + Console.println("OK! Memory is now set to "+nf.format(mem)); }else if(command.equalsIgnoreCase("BYE")){ - byeFlag = true; break; }else if(command.equalsIgnoreCase("zipcode")){ Console.println("Cohort 6.0 is the BEST COHORT EVER!!!!!"); - skip = true; }else{ - if(ans.equalsIgnoreCase("N") || ans.equalsIgnoreCase(" ") || command.equalsIgnoreCase("set")) { - if (command.equalsIgnoreCase("neg") || command.equalsIgnoreCase("inv") || - command.equalsIgnoreCase("sq") || command.equalsIgnoreCase("sqrt") || - command.equalsIgnoreCase("sin") || command.equalsIgnoreCase("cos") || - command.equalsIgnoreCase("tan") || command.equalsIgnoreCase("arcsin") - || command.equalsIgnoreCase("arccos") - || command.equalsIgnoreCase("arctan") || - command.equalsIgnoreCase("log") || command.equalsIgnoreCase("log10X") - || command.equalsIgnoreCase("invlog") - || command.equalsIgnoreCase("invnatlog") || - command.equalsIgnoreCase("ex") || command.equalsIgnoreCase("!") - || command.equalsIgnoreCase("toDeg") - || command.equalsIgnoreCase("toRad") || - command.equalsIgnoreCase("toHex") || command.equalsIgnoreCase("toOct") - || command.equalsIgnoreCase("toBin") || command.equalsIgnoreCase("set")) { - String input = Console.getStringInput("Please enter a number: "); - num = Double.parseDouble(input); - } - } - if(command.equalsIgnoreCase("set")) { - cur = num; - skip = true; - num1 = cur; - ans = "Y"; - }else if(command.equalsIgnoreCase("neg")) { - cur = c.signSwitch(num); + if(command.equalsIgnoreCase("neg")) { + cur = c.signSwitch(cur); }else if(command.equalsIgnoreCase("inv")) { - cur = c.inverse(num) ; + cur = c.inverse(cur) ; }else if(command.equalsIgnoreCase("sq")) { - cur = c.square(num) ; + cur = c.square(cur) ; }else if(command.equalsIgnoreCase("sqrt")){ - if(num == -1) { - result = "ERROR!!"; - } - cur = c.squareRoot(num) ; + cur = c.squareRoot(cur) ; }else if(command.equalsIgnoreCase("sin")){ - cur = c.sin(num); + cur = c.sin(cur); }else if(command.equalsIgnoreCase("cos")){ - cur = c.cos(num); + cur = c.cos(cur); }else if(command.equalsIgnoreCase("tan")){ - cur = c.tangent(num); + cur = c.tangent(cur); }else if(command.equalsIgnoreCase("arcsin")){ - cur = c.InverseSin(num); + cur = c.InverseSin(cur); }else if(command.equalsIgnoreCase("arccos")){ - cur = c.InverseCos(num); + cur = c.InverseCos(cur); }else if(command.equalsIgnoreCase("arctan")){ - cur = c.InverseTangent(num); - }else if(command.equalsIgnoreCase("log")){ - cur = c.log(num); - }else if(command.equalsIgnoreCase("log10X")) { - cur = c.log10X(num); + cur = c.InverseTangent(cur); + }else if(command.equalsIgnoreCase("ln")){ + cur = c.log(cur); + }else if(command.equalsIgnoreCase("log10")) { + cur = c.log10X(cur); }else if(command.equalsIgnoreCase("invlog")) { - cur = c.invLog(num); + cur = c.invLog(cur); }else if(command.equalsIgnoreCase("ex")) { - cur = c.invNatLog(num); + cur = c.invNatLog(cur); }else if(command.equalsIgnoreCase("!")) { - cur = c.factorial(num); + cur = c.factorial(cur); }else if(command.equalsIgnoreCase("toDeg")) { - cur = c.toDegrees(num); + cur = c.toDegrees(cur); }else if(command.equalsIgnoreCase("toRad")) { - cur = c.toRadians(num); + cur = c.toRadians(cur); }else if(command.equalsIgnoreCase("toHex")) { - result = c.DecimalToOther((int)num, 16); + result = c.DecimalToOther((int)cur, 16); }else if(command.equalsIgnoreCase("toOct")) { - result = c.DecimalToOther((int)num, 8); + result = c.DecimalToOther((int)cur, 8); }else if(command.equalsIgnoreCase("toBin")) { - result = c.DecimalToOther((int)num, 2); + result = c.DecimalToOther((int)cur, 2); }else if(command.equalsIgnoreCase("always73")) { - if(cur>=1000){ - cur = c.secretof73(num); - }else{ + if(cur<1000){ Console.println("Sorry, this only works if input is a 4-digit number!"); - skip = true; } + }else if(command.equalsIgnoreCase("c")){ + cur = 0; + }else if(command.equalsIgnoreCase("isPrime")||command.equalsIgnoreCase("mode16")|| + command.equalsIgnoreCase("mode10")|| command.equalsIgnoreCase("mode8")|| + command.equalsIgnoreCase("mode2")||command.equalsIgnoreCase("mode2")) { + }else{ Console.println("That's not a valid command!!"); - skip = true; } } - if( !skip ){ + //print result if(Double.isNaN(cur) || cur == Double.POSITIVE_INFINITY || cur == Double.NEGATIVE_INFINITY ) { Console.println("ERROR!!! :("); cur = curTemp; }else if(command.equalsIgnoreCase("toHex")){ - Console.println("Decimal "+ (int)num +" is " + result + " in Hexadecimal!"); - num1 = num; + Console.println("Decimal "+ (int)cur +" is " + result + " in Hexadecimal!"); }else if(command.equalsIgnoreCase("toOct")){ - Console.println("Decimal "+ (int)num +" is " + result + " in Octal!"); - num1 = num; + Console.println("Decimal "+ (int)cur +" is " + result + " in Octal!"); }else if(command.equalsIgnoreCase("toBin")){ - Console.println("Decimal "+ (int)num +" is " + result + " in Binary!"); - num1 = num; + Console.println("Decimal "+ (int)cur +" is " + result + " in Binary!"); }else if(command.equalsIgnoreCase("always73")){ - double a = c.multiply(num,10001); + double a = c.multiply(cur,10001); double b = c.divide(a,137); - double cc = c.divide(b,num); + double cc = c.divide(b,cur); - Console.println(num + " * 10001 = " + a ); + Console.println(cur + " * 10001 = " + a ); Console.println(a+" / 137 = "+ b); - Console.println(b + " / "+num+" = " + (int)cc ); - Console.println("Your result is " + (int)cur + " :)"); - + Console.println(b + " / "+cur+" = " + cc ); + cur = c.secretof73(cur); + Console.println("Your result is " + nf.format(cur) + " :)"); + + }else if(command.equalsIgnoreCase("isPrime")) { + if(c.isPrime(cur)) + Console.println((int)cur + " is a prime"); + else{ + Console.println(nf.format(cur) + " is not a prime"); + } + }else if(command.equalsIgnoreCase("mode10")){ + mode = 10; + Console.println("Ok! Switched to mode "+mode); + }else if(command.equalsIgnoreCase("mode16")){ + mode = 16; + Console.println("Ok! Switched to mode "+mode); + }else if(command.equalsIgnoreCase("mode8")){ + mode = 8; + Console.println("Ok! Switched to mode "+mode); + }else if(command.equalsIgnoreCase("mode2")){ + mode = 2; + Console.println("Ok! Switched to mode "+mode); + }else if (command.equalsIgnoreCase("help")) { + Console.print("Here are the available commends:\n" + + printHelp("Set Value", "set") + + printHelp("Clear Value", "c") + + printHelp("Add", "add") + + printHelp("Subtract", "sub") + + printHelp("Multiply", "mul") + + printHelp("Divide", "div") + + printHelp("Exponent", "pow") + + printHelp("Switch Sign", "neg") + + printHelp("Inverse", "inv") + + printHelp("Sine", "sin") + + printHelp("Cosine", "cos") + + printHelp("Tangent", "tan") + + printHelp("Inverse Sine", "arcsin") + + printHelp("Inverse Cosine", "arccon") + + printHelp("Inverse Tangent", "arctan") + + printHelp("Logarithm", "log10") + + printHelp("Inverse Log", "invlog") + + printHelp("Natural Log ", "ln") + + printHelp("Inverse Natural Log", "ex") + + printHelp("Inverse number", "inv") + + printHelp("Square", "sq") + + printHelp("Square Root", "sqrt") + + printHelp("Factorial", "!") + + printHelp("Degree to Radian", "toRad") + + printHelp("Radian to Degree", "toDeg") + + printHelp("Hexadecimal Mode", "mode16") + + printHelp("Decimal Mode", "mode10") + + printHelp("Octal Mode", "mode8") + + printHelp("Binary Mode", "mode2") + + printHelp("Set memory", "M") + + printHelp("Add value to memory", "M+") + + printHelp("Show value in memory", "showM")+ + printHelp("Use the value in memory", "useM")+ + printHelp("Clear memory", "clearM") + ); }else{ - Console.println("Your result is " + cur + " :)"); + String d = ""; + if(mode != 10) { d = "decimal "; } + Console.println("Your "+d+"result is " + nf.format(cur) + " :)"); } - if(cur != curTemp && !Double.isNaN(cur)) { - Console.println("What do you want to do next?"); - ans = Console.getStringInput("Keep the current number?(Y/N): "); - //if the ans is bad then it will run this loop - while (!ans.equalsIgnoreCase("Y") && !ans.equalsIgnoreCase("N") && !ans.equalsIgnoreCase("bye")){ - ans = Console.getStringInput("Keep the current number?(Y/N): "); - } - if (ans.equalsIgnoreCase("Y")) { - num1 = cur; - num = cur; - } else if (ans.equalsIgnoreCase("N")) { - cur = 0; - } else if (ans.equalsIgnoreCase("bye")) { - byeFlag = true; - break; - } - } - } Console.println("=================================================="); } @@ -236,4 +221,16 @@ public static void main(String[] args) { public static String printHelp(String description, String ops ){ return String.format("%-27s%s\n", description, ops).replace(' ', '-'); } + public static String modeName(int radix){ + if(radix == 10){ + return "Decimal"; + }else if(radix == 2){ + return "Binary"; + }else if(radix == 8){ + return "Octal"; + }else if(radix ==16){ + return "Hexadecimal"; + } + return "Not Possible"; + } } From 20d86db96d196b747603b74d56aee7916fa40ab7 Mon Sep 17 00:00:00 2001 From: chipfody <60615532+chipfody@users.noreply.github.com> Date: Mon, 10 Feb 2020 10:33:12 -0500 Subject: [PATCH 9/9] 0210 --- .DS_Store | Bin 6148 -> 6148 bytes ScientificCalculator.Maven | 1 + src/.idea/.gitignore | 2 ++ src/.idea/misc.xml | 7 +++++++ src/.idea/modules.xml | 8 ++++++++ src/.idea/vcs.xml | 6 ++++++ .../Scientific Calculator.uml | 16 ++++++++++++++++ 7 files changed, 40 insertions(+) create mode 160000 ScientificCalculator.Maven create mode 100644 src/.idea/.gitignore create mode 100644 src/.idea/misc.xml create mode 100644 src/.idea/modules.xml create mode 100644 src/.idea/vcs.xml create mode 100644 src/main/java/com/zipcodewilmington/scientificcalculator/Scientific Calculator.uml diff --git a/.DS_Store b/.DS_Store index 7a0dfc61ae91affce3f84d7a112e9d61e2c6ec7b..06981ed5540846e7892dd9f4d1e4c1c0eea9acad 100644 GIT binary patch delta 401 zcmZoMXfc=|#>B!ku~2NHo+2aH#(>?7ix)66F>+1jVM?x-WGH4xX2@hnWyoVF0n%we zoXijp#EA?!K(Z7_CIV&h8HyP6fO5GEIi5NB$w@i+Nem1O0t^g{tw37iKNtX63=C2X z!B|Xm#%i8#3{bcXWI39lpD8gEX6EEMOg9`!at=&qS#VKaPJUiG&=riEbC~29)!Bey zkO&Nebf9BPP#w!)4OBJ*5&{zo<2SQ&@N)nIeDg%+@640=MI1R885o#=N*Fdrh^%1- E0G9}1LI3~& delta 71 zcmZoMXfc=|#>B)qu~2NHo+2ab#(>?7jI5J+SdurVu}L#-7U2+Pnb?rEnVo~51E_4X ZAjfy+$^0UY91K9f$iTp|IYML&GXQrN5B&fD diff --git a/ScientificCalculator.Maven b/ScientificCalculator.Maven new file mode 160000 index 00000000..8628a3ce --- /dev/null +++ b/ScientificCalculator.Maven @@ -0,0 +1 @@ +Subproject commit 8628a3ce18b94b2beac74fcccaa21c2fa2ab0f8d diff --git a/src/.idea/.gitignore b/src/.idea/.gitignore new file mode 100644 index 00000000..e7e9d11d --- /dev/null +++ b/src/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/src/.idea/misc.xml b/src/.idea/misc.xml new file mode 100644 index 00000000..aa66c766 --- /dev/null +++ b/src/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/src/.idea/modules.xml b/src/.idea/modules.xml new file mode 100644 index 00000000..f669a0e5 --- /dev/null +++ b/src/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/.idea/vcs.xml b/src/.idea/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/src/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/com/zipcodewilmington/scientificcalculator/Scientific Calculator.uml b/src/main/java/com/zipcodewilmington/scientificcalculator/Scientific Calculator.uml new file mode 100644 index 00000000..7998e554 --- /dev/null +++ b/src/main/java/com/zipcodewilmington/scientificcalculator/Scientific Calculator.uml @@ -0,0 +1,16 @@ + + + JAVA + + + + + + + + Methods + + All + private + +