Skip to content

pull request #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

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b181a67
Added 1 Sum test.
JeremySabina Jun 27, 2021
8837f22
Connected with Main Application and Console
JeremySabina Jun 27, 2021
fd36d98
It Works
JeremySabina Jun 27, 2021
2f024f1
Added Subtraction with test cases <Incomplete>
JeremySabina Jun 27, 2021
3bf3e26
Worked on switch statement <Incomplete>
JeremySabina Jun 27, 2021
3f110d2
Added the start of switch.
charnaexw Jun 27, 2021
67032e4
Merge pull request #1 from charnaexw/master
charnaexw Jun 27, 2021
a8b9bc0
Tried to fix the switch statement in the Main application.
JeremySabina Jun 27, 2021
890ec4e
Worked on switch statement.
JeremySabina Jun 27, 2021
d86c99d
Added COS SIN TAN + inverse
charnaexw Jun 27, 2021
322ed80
Added another switch(sqrt, sq, factorial, cubed)
charnaexw Jun 27, 2021
103cd7e
Adding the MR MC M-
charnaexw Jun 27, 2021
2b8319e
ignore the red.
charnaexw Jun 27, 2021
3da4d22
Testing branches
JeremySabina Jun 27, 2021
1139866
Making Chnages.
charnaexw Jun 27, 2021
009177c
Merge branch 'master' into master
JeremySabina Jun 27, 2021
42020a1
the struggle
Bobbi-Z Jun 27, 2021
6efee4c
Merge remote-tracking branch 'origin/master'
Bobbi-Z Jun 27, 2021
013a00d
the struggle is real
Bobbi-Z Jun 27, 2021
a187e13
Merge pull request #2 from charnaexw/master
JeremySabina Jun 27, 2021
4af3d2a
.log maybe
charnaexw Jun 27, 2021
a3d897a
Added Basic Arithmatic test cases
JeremySabina Jun 28, 2021
32a1e29
added Radians.
charnaexw Jun 28, 2021
26f8601
Merge pull request #4 from charnaexw/master
JeremySabina Jun 28, 2021
301d738
Merge branch 'master' into master
Bobbi-Z Jun 28, 2021
4566f5d
Merge pull request #3 from Bobbi-Z/master
Bobbi-Z Jun 28, 2021
92b065e
This is what we have for science.
charnaexw Jun 28, 2021
91eb470
Fixed up some of the display.
JeremySabina Jun 28, 2021
7882cfa
again.
charnaexw Jun 28, 2021
836ac70
Merge branch 'master' into master
charnaexw Jun 28, 2021
b8fc513
Merge pull request #5 from charnaexw/master
charnaexw Jun 28, 2021
035f89a
Merge pull request #1 from Professional-Coding-Developments/master
charnaexw Jun 28, 2021
c9f0b6c
square root
Bobbi-Z Jun 28, 2021
9b9dc25
square root test
Bobbi-Z Jun 28, 2021
e7307cf
square root test
Bobbi-Z Jun 28, 2021
c70a2ac
square root test2
Bobbi-Z Jun 28, 2021
ba0e062
Added some more things to the display.
JeremySabina Jun 28, 2021
fe1be29
Merge branch 'master' of https://github.com/Professional-Coding-Devel…
JeremySabina Jun 28, 2021
31183ba
Merge remote-tracking branch 'origin/master'
Bobbi-Z Jun 28, 2021
03f3aac
I greyed out a lot of code but the code that is there should now be c…
charnaexw Jun 28, 2021
9bdb4e0
Merge pull request #6 from charnaexw/master
charnaexw Jun 28, 2021
8d6131c
Added some basic calculator and scientific functionality.
JeremySabina Jun 28, 2021
e182dba
Merge branch 'master' of https://github.com/Professional-Coding-Devel…
JeremySabina Jun 28, 2021
60531d5
fixing tests
Bobbi-Z Jun 28, 2021
d39280c
I'm sleepy.
charnaexw Jun 28, 2021
42e7a08
root and square - all tests pass
Bobbi-Z Jun 28, 2021
28fcabe
Add files via upload
Bobbi-Z Jun 28, 2021
21c0fca
Merge branch 'Professional-Coding-Developments:master' into master
Bobbi-Z Jun 28, 2021
7023e24
Delete TestMainApplication.java
Bobbi-Z Jun 28, 2021
9113a1a
Delete CalculatorEngineTest.java
Bobbi-Z Jun 28, 2021
bd48d04
Merge remote-tracking branch 'origin/master'
Bobbi-Z Jun 28, 2021
7d29c67
double check all code
Bobbi-Z Jun 28, 2021
f823789
Merge pull request #8 from Bobbi-Z/master
Bobbi-Z Jun 28, 2021
7dad93f
Add files via upload
Bobbi-Z Jun 28, 2021
5dd441e
Add files via upload
Bobbi-Z Jun 28, 2021
bb4b97e
Merge pull request #9 from Bobbi-Z/master
Bobbi-Z Jun 28, 2021
030d5ed
all my tests pass
charnaexw Jun 28, 2021
7c53258
Merge pull request #10 from charnaexw/master
charnaexw Jun 28, 2021
f74c1f3
added static to the class in my code.
charnaexw Jun 28, 2021
a239c87
Merge pull request #11 from charnaexw/master
charnaexw Jun 28, 2021
30c242d
Add files via upload
Bobbi-Z Jun 28, 2021
e7fd8fe
Merge pull request #12 from Bobbi-Z/master
Bobbi-Z Jun 28, 2021
831537d
last minute updates
Bobbi-Z Jun 28, 2021
600e015
Merge pull request #13 from Bobbi-Z/master
Bobbi-Z Jun 28, 2021
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
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
<groupId>com.zipcodewilmington</groupId>
<artifactId>scientific_calculator</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.zipcodewilmington.scientificcalculator;

public class Calculator {
<<<<<<< HEAD
=======

private static int result;

public static int sum(int firstNum, int secondNum) {
Expand All @@ -14,6 +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,6 +1,36 @@
package com.zipcodewilmington.scientificcalculator;

public class CalculatorEngine {
CalculatorEngine calculatorEngine = new CalculatorEngine();

public void run(){
Console.println("Welcome to the calculator!\nWhat would you like to do?");
Console.println("1. Basic Functions \n2. Scientific Functions \n3. Something Fun!");
menuOption1();
}


public void menuOption1() {
String firstChoice;
do {
firstChoice = Console.getStringInput("1, 2, 3");
switch (firstChoice.toLowerCase()) {
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()");
break;
case "3":
System.out.println("Something Fun!");
break;
default:
Console.println("[ %s ] is not a valid input!", firstChoice);
break;
}
} while (true);
}

private static int result;

public static int sum(int firstNum, int secondNum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@
*/
public class MainApplication {

static Integer y = 0;
static Integer z = 0;
private static String prompt;


public static void main(String[] args) {

Scanner scanObject = new Scanner(System.in);

Console.println("Welcome to the calculator!\nWhat would you like to do?");
System.out.println("1. Basic Functions \n2. Scientific Functions \n3. Something Fun!");
menuOption1();
public class Console =
CalculatorEngine = new CalculatorEngine();
}
}


public static String menuOption1() {
String prompt;
Expand All @@ -39,6 +32,7 @@ public static String menuOption1() {
break;
}


/*

System.out.println("Please enter a number");
Expand All @@ -55,22 +49,16 @@ public static String menuOption1() {
System.out.println("Adding now...");
int x = Calculator.sum(y, z);
System.out.println(x);
*/

//<<<<<<< HEAD:src/main/java/com/zipcodewilmington/scientificcalculator/MainApplication.java
String s = Console.getStringInput("Enter a string");
=======
String

String s = Console.getStringInput("Enter a string");
String s = Console.getStringInput("Enter a string");
String s = CalculatorEngine.getStringInput("Enter a string");
//>>>>>>> 67032e40a3e1b20aaf10917261cc55a57dbfe45b:src/main/java/com/zipcodewilmington/scientificcalculator/CalculatorInterface.java



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);
}
}
} */

Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ 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 @@ -39,31 +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");}

switch (operator) {
case ".log":
value = Math.log10(firstNum);
break;
case "e":
value = Math.exp(firstNum);
break;
case "10x":
value = Math.exp(firstNum, 10);
break;
case "-x":
value = firstNum * -1;
break;
case "Ln":
value = Math.log(firstNum);
break;

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




switch {



}
}

}
}

}