Skip to content

tests #10

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 3 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
I greyed out a lot of code but the code that is there should now be c…
…onsistant with what you have.
  • Loading branch information
charnaexw committed Jun 28, 2021
commit 03f3aac366949f4eb578f5707787b533efc185a5
Original file line number Diff line number Diff line change
@@ -1,8 +1,63 @@
/*

package com.zipcodewilmington.scientificcalculator;

public class Scientific {
private static double value;

public static Double tan (double value) {
value = 0;
value = Math.tan(value;
return value;
}

public Double tanR(double value) {
value = 0;
value = Math.atan(value);
return value;
}


public Double cos(double value) {
value = 0;
value = Math.cos(value);
return value;
}

public double sin(double value) {
value = 0;
value = Math.sin(value);
}

public double cb(double value) {
value = 0;
value= Math.pow(value, 3);
}

public double sqrt(double value) {
value = 0;
value = Math.sqrt(value);
return value;
}

public double squ(double value) {
value = 0;
value = Math.pow(value, 2);
return value
}


public double sinR(double value) {
value = 0;
value = Math.asin(value);
return value;
}
public double cosR(double value){
value = 0;
value = Math.acos(value);
return value;
}
}
/*public double result;
public static void main(String[] args) {
int firstNum = 0;
double value = 0.0;
Expand Down Expand Up @@ -77,21 +132,14 @@ public static void main(String[] args) {
default
System.out.println("ERR");
}
*/public static boolean isRadian ( double input){
public static boolean isRadian ( double input){
double to180 = (input + ((180 / Math.PI) - input));
// 57 is 180 degrees rounded to whole number
if (Math.round(to180) == 57) {
return true;
} else {
/*}return false;


}
return false;
}
}
}
//<<<<<<< master
//=======
*/

*/

//>>>>>>> master
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package com.zipcodewilmington.scientific_calculator;

import com.zipcodewilmington.scientificcalculator.CalculatorEngine;
import com.zipcodewilmington.scientificcalculator.Scientific;
import org.junit.Assert;
import org.junit.Test;

public class ScientificTest {
@Test
public void testTan() {
Scientific scientific = new Scientific();
Double result;
result = scientific.tan(-1.995200412208242);
if (result != 90.0) ;
{ //
Assert.fail();
}
}
@Test
public void testTanR() {
Scientific scientific = new Scientific();
Double result;
result = scientific.tanR(-1.995200412208242);
if (result != 100) ;
{ //
Assert.fail();
}
}
@Test
public void testCos(){
Scientific scientific = new Scientific();
Double value;
value = scientific.cos(-1.995200412208242);
if value != scientific.cos(1.0){
Assert.fail();
}
}
@Test
public void testCosR(){
Scientific scientific = new Scientific();
Double value;
value = scientific.cos(-1.995200412208242);
if value != scientific.cos(1.0){
Assert.fail();
}
}
@Test
public void testSine (){
Scientific scientific = new Scientific();
double value;
value = scientific.sin(0.8939966636005579);
if value != scientific.sin(90){
Assert.fail();
}
}
@Test
public void testSineR (){
Scientific scientific = new Scientific();
double value;
value = scientific.sinR(8);
if value = scientific.sinR(5.0){
Assert.fail();
}
}
@Test
public void testCubed (){
Scientific scientific = Scientific();
double value;
value = scientific.cb(3);
if value = scientific.cb(10){
Assert.fail();
}
}
@Test
public void testSqrt (){
Scientific scientific = new Scientific();
double value;
value = scientific.sqrt(25);
if value != scientific.sqrt(5){
Assert.fail();
}
}
@Test
public void testSquare (){
Scientific scientific = new Scientific();
double value;
value = scientific.squ(5);
if value = scientific.squ(25){
Assert.fail();
}
}
}