Skip to content
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

Deployment #28

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.zipcodewilmington.scientificcalculator;

public class CalcFunc {

public void displayMainMenu () {
System.out.println("********************");
System.out.println("Welcome to the JAVA CALC.");
System.out.println("********************");
System.out.println("MAIN MENU:");
System.out.println("1. Main Calculator");
System.out.println("2. Scientific Calculator");
System.out.println("3. Custom Features");
System.out.println("4. End Application");
// System.out.println("3. Use Memory");
System.out.println("********************");
System.out.println("Select an option:");
}

public void displayOperations (){
System.out.println("Type an operator:");
System.out.println("+ / - / x / %");
System.out.println("A. Square");
System.out.println("B. Square Root");
System.out.println("C. Exponentiation");
System.out.println("D. Inverse");
}

public void displayMemoryMenu () {
System.out.println("Select an option:");
System.out.println("1. M+");
System.out.println("2. MC");
System.out.println("3. MRC");
}

public void displaySciMenu () {
System.out.println("********************");
System.out.println("1. Change Display Mode");
System.out.println("2. Trigonometric Functions");
System.out.println("3. Logarithmic Functions");
System.out.println("4. Factorial Function");
System.out.println("5. Quit to Main Menu");
System.out.println("********************");
}

public void displaySciDisplayMode (){
System.out.println("Choose Display Options:");
System.out.println("1. Binary");
System.out.println("2. Octal");
System.out.println("3. Decimal");
System.out.println("4. Hexadecimal");
}

public void displayTrigMenu (){
System.out.println("Choose Trigonometric Function:");
System.out.println("1. Sine");
System.out.println("2. Cosine");
System.out.println("3. Tangent");
System.out.println("4. Inverse Sine");
System.out.println("5. Inverse Cosine");
System.out.println("6. Inverse Tangent");
}

public void displayLogMenu (){
System.out.println("Choose Logarithmic Functions:");
System.out.println("1. Log");
System.out.println("2. Inverse Log");
System.out.println("3. Natural Log");
System.out.println("4. Inverse Natural Log");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package com.zipcodewilmington.scientificcalculator;

import static java.lang.Math.sqrt;

public class Calculator {
//this is Coreye's CODE!!!! because his Git doesn't work
//anytime we do Calculator object just know it's from Coreye's code

public double add(double a, double b) {
System.out.println(">>> " + (a + b));
return a + b;
}
public double subtract(double a, double b) {
System.out.println(">>> " + (a - b)); // method to subtract two numbers
return a-b;
}
public double multiply(double a, double b) { //method to multiply two numbers
System.out.println(">>> " + (a * b));
return a * b;
}
public double divide(double a, double b) {
if (b == 0) {
System.out.println("ERROR!!!");
} else {
System.out.println(">>> " + (a / b));
}
return a / b;
}

public double squareRoot(double num) {
if (num < 0) {
throw new IllegalArgumentException("Square root of a negative number is not real");
}
return Math.sqrt(num);
}

public static double squareRootResult ( double x){
System.out.println(sqrt(x));
return sqrt(x);
}


public double square(double a) {
return a * a;
}

public double exponentiate(double base, double exponent) {
System.out.println(Math.pow(base, exponent));
return Math.pow(base, exponent);
}

public double inverse(double num){
return 1 / num;
}

public static double invertDouble ( double x){
// System.out.println("original number: " + x);
// System.out.println("inverted number: " + (x *= -1));
System.out.println(x * -1);
return x * -1; //it works!
}


// THIS IS AN ATTEMPT TO GET MEMORY VARIABLE WORKING!!!
// if (scanner.hasNextDouble){
// displayVar = scanner.nextDouble();
// System.out.println(displayVar);
// } else if (scanner.hasNext()){
// String memInput = scanner.next();
// if (memInput.equalsIgnoreCase(m)){
// displayVar = memoryVariable;
// System.out.println(displayVar);
// } else {
// result = displayVar;
// }
// }



//THIS SHOULD WORK FOR VARIABLE 2 INPUT THEORETICALLY
// System.out.println("Select another number: [or type M: MRC]");
// if (scanner.hasNextDouble()){
// displayVar2 = scanner.nextDouble();
// System.out.println(displayVar2);
// } else if (scanner.hasNext()){
// String memInput2 = scanner.next();
// if (memInput2.equalsIgnoreCase("m")){
// displayVar2 = memoryVariable;
// System.out.println(displayVar2);
// }
// }



}




Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Scanner;

/**
/**testing git pull request
* Created by leon on 2/9/18.
*/
public class Console {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.zipcodewilmington.scientificcalculator;

import static java.util.Calendar.PM;

public class LogCalc {

//log

//inverse logarithm

//natural logarithm

//inverse natural logarithm


//
// public double squareRoot(double num) {
// return Math.sqrt(num);
// }
// public double square(double a) {
// return a * a;
// }
// public double exponentiate(double base, double exponent) {
// return Math.pow(base, exponent);
// }
// public double inverse(double a){
// return 1/a;
// }
public double logarithm(double base, double number) {return Math.log(number) / Math.log(base);}

public double inverseLogarithm(double base, double logValue) {
return Math.pow(base, logValue);
}

public double naturalLogarithm(double number) {
return Math.log(number);
}

public double inverseNaturalLogarithm (double number){return Math.exp(number); }


}



Loading