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

Completed Scientific Calculator #109

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5818c90
commnit
Oct 29, 2021
117e31c
adding team
keerthana-java Oct 29, 2021
17fe64e
Merge pull request #1 from keerthana-java/master
Roggam Oct 29, 2021
f05320e
team
keerthana-java Oct 29, 2021
601cd78
Merge pull request #2 from keerthana-java/master
Roggam Oct 29, 2021
0ce0444
test commit to keerthana brnach
keerthana-java Oct 29, 2021
4d3399f
Merge branch 'master' into Keerthana
keerthana-java Oct 29, 2021
f37f57d
Merge pull request #3 from Roggam/Keerthana
Roggam Oct 29, 2021
f2568de
3rd commit
Oct 30, 2021
b2e1ce6
added hello
Oct 30, 2021
311ee2f
added some input validation
Oct 30, 2021
ea7e508
Added input validation
Oct 30, 2021
26cfb82
removed unused code
Oct 30, 2021
bd3083a
made adjustment to the validation
Oct 30, 2021
b1fcd00
made more ajustments to input validation
Oct 30, 2021
2997012
added basic calc methods and updated console for integer and double
keerthana-java Oct 30, 2021
9d8f82e
created fibonacci class and working
Oct 30, 2021
2f31465
revert to original state
keerthana-java Oct 30, 2021
a71a1f6
revert to original state
keerthana-java Oct 30, 2021
0db2037
small adj to fibonacci
Oct 30, 2021
e6cbb8a
Merge branch 'master' of https://github.com/Roggam/ScientificCalculat…
keerthana-java Oct 30, 2021
3286a66
Merge pull request #5 from Roggam/Keerthana
Roggam Oct 30, 2021
c7faef5
updated main application with basic operations
keerthana-java Oct 30, 2021
e5bc7da
updated main application with basic operations
keerthana-java Oct 30, 2021
a718dec
added Unit Tests
Oct 30, 2021
5dd6e57
Merge branch 'master' into Keerthana
Roggam Oct 30, 2021
748c71f
Merge pull request #6 from Roggam/Keerthana
Roggam Oct 30, 2021
deded33
added new fibonacci method and convert to Binary, Octal and Hex
Oct 30, 2021
7427d34
added Test for binary, octal and Hex(Still not working)
Oct 30, 2021
0a5f6c0
changes made in main application
keerthana-java Oct 30, 2021
d6a3a52
Revert "changes made in main application"
keerthana-java Oct 30, 2021
341568c
fixed Hex Test
Oct 30, 2021
0e29820
Merge branch 'Keerthana' of https://github.com/Roggam/ScientificCalcu…
keerthana-java Oct 30, 2021
4dc3b0d
Merge branch 'master' of https://github.com/Roggam/ScientificCalculat…
keerthana-java Oct 30, 2021
e498dbb
ScientificCalculatorUML
Roggam Oct 30, 2021
e8c1d09
Update Untitled Diagram.drawio
Roggam Oct 30, 2021
f82e4c0
completed
keerthana-java Oct 31, 2021
5a23179
Merge pull request #7 from Roggam/Keerthana
Roggam Oct 31, 2021
cebe582
Updated UML Diagram
Roggam Oct 31, 2021
75a4082
final output
keerthana-java Oct 31, 2021
6053b98
Merge pull request #10 from Roggam/Keerthana
Roggam Oct 31, 2021
375e1f2
added more methods to UML Diagram
Roggam Oct 31, 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
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# ScientificCalculator (maven) ZCW
=======
#Team Members

teAM MEMBER
Keerthana

# com.zipcodewilmington.scientificcalculator.ScientificCalculator (maven) ZCW

## Description

In this project your team will build a small app to function as a calculator. This app will be built in Java, and will use the topics and techniques discussed during the week.
In this project your team will build a small app to function as a calculator. This app will be built in Java, and will use the topics and techniques discussed during the week..

Your team should work on this project in a single repository. Click the `fork` button in the top right corner to create a copy of this repository in one of your github accounts. You can go through the [GitHub forking tutorial](https://help.github.com/articles/fork-a-repo/) if you need additional practice with this.

Expand Down
126 changes: 126 additions & 0 deletions Untitled Diagram.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<mxfile host="app.diagrams.net" modified="2021-10-31T18:49:10.612Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15" etag="jvRd4ORnY1L2My95VCYm" version="15.6.2" type="github">
<diagram id="RymQl5_oODCLrHPwavor" name="Page-1">
<mxGraphModel dx="1284" dy="1075" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="mk51jWXhCHLpo1xptCBX-1" value="BasicCalculator" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="70" y="470" width="230" height="230" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-2" value="- result: Double" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-1" vertex="1">
<mxGeometry y="26" width="230" height="26" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-1" vertex="1">
<mxGeometry y="52" width="230" height="8" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-4" value="+add (input1, input2): Double&#xa;+subtract (input1, input2): Double&#xa;+multiply (input1, input2): Double&#xa;+divide (input1, input2): Double&#xa;+squareRoot (input1): Double&#xa;+square (input1): Double&#xa;+exponent(input1, input2):Double&#xa;+inverse (input1): Double&#xa;+invertNumber(input1): Double&#xa;+percentage(input1) : Double" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-1" vertex="1">
<mxGeometry y="60" width="230" height="170" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-5" value="ScFunctions" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="590" y="360" width="240" height="358" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-6" value="- result: Double&#xa;-unitsMode: Int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-5" vertex="1">
<mxGeometry y="26" width="240" height="44" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-5" vertex="1">
<mxGeometry y="70" width="240" height="8" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-8" value="+sin(input1): Double&#xa;+cosine(input1): Double&#xa;+tangent(input1: Double&#xa;+inverseSin(input1): Double&#xa;+inverseCosine(input1):Double&#xa;+inverseTangent(input1):Double&#xa;+log(input1): Double&#xa;+inverseLog(input1):Double&#xa;+inverseNaturalLog(input1):Double&#xa;+factorial(input1):Double&#xa;+Octal(input1): Double&#xa;+Binary(input1):Double&#xa;+Hexadecimal(input1): Double&#xa;+rad(inout1): Double&#xa;+degree(input1):Double&#xa;+applyUnitMode(result): Double&#xa;+switchUnitMode(): void&#xa;+setUnitMode(input1): void&#xa;+getUnitMode(): String&#xa;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-5" vertex="1">
<mxGeometry y="78" width="240" height="280" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-9" value="Console" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="30" y="130" width="330" height="200" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-10" value="- field: type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-9" vertex="1">
<mxGeometry y="26" width="330" height="26" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-11" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-9" vertex="1">
<mxGeometry y="52" width="330" height="8" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-12" value="+ display(currentVal): Double&#xa;+ getStringInput(prompt): String&#xa;+getIntegerInput(prompt, rangeStart, rangeStop):String, Int&#xa;+getDoubleInput(prompt): String&#xa;+applyDisplay(currentVal, displayMode): String&#xa;+applyDisplayMode(input1, displayMode): Int&#xa;+getDisplayMode(): String&#xa;&#xa;&#xa;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-9" vertex="1">
<mxGeometry y="60" width="330" height="140" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-13" value="Fibonacci" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" parent="1" vertex="1">
<mxGeometry x="630" y="150" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-15" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-13" vertex="1">
<mxGeometry y="26" width="160" height="8" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-16" value="fibonacci(input1): Double" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="mk51jWXhCHLpo1xptCBX-13" vertex="1">
<mxGeometry y="34" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-17" value="name" style="endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;rounded=0;exitX=1.019;exitY=0.115;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="f8Tqhg3Ib41jFK50YA1g-5" target="mk51jWXhCHLpo1xptCBX-5" edge="1">
<mxGeometry x="0.5392" y="10" relative="1" as="geometry">
<mxPoint x="560" y="438" as="sourcePoint" />
<mxPoint x="500" y="460" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-18" value="1" style="edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;" parent="mk51jWXhCHLpo1xptCBX-17" connectable="0" vertex="1">
<mxGeometry x="-1" relative="1" as="geometry">
<mxPoint x="-20" y="-26" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-21" value="name" style="endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;rounded=0;exitX=1.019;exitY=0.192;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="f8Tqhg3Ib41jFK50YA1g-3" target="mk51jWXhCHLpo1xptCBX-16" edge="1">
<mxGeometry x="-0.5062" y="-10" relative="1" as="geometry">
<mxPoint x="548.96" y="324.8520000000001" as="sourcePoint" />
<mxPoint x="480" y="460" as="targetPoint" />
<Array as="points">
<mxPoint x="549" y="391" />
<mxPoint x="549" y="370" />
<mxPoint x="540" y="370" />
<mxPoint x="540" y="180" />
<mxPoint x="630" y="180" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-22" value="1" style="edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;" parent="mk51jWXhCHLpo1xptCBX-21" connectable="0" vertex="1">
<mxGeometry x="-1" relative="1" as="geometry" />
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-23" value="name" style="endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;rounded=0;exitX=0.131;exitY=-0.012;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.612;entryY=0.006;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="mk51jWXhCHLpo1xptCBX-9" edge="1" source="f8Tqhg3Ib41jFK50YA1g-2">
<mxGeometry x="0.1333" y="20" relative="1" as="geometry">
<mxPoint x="470" y="330" as="sourcePoint" />
<mxPoint x="240" y="149" as="targetPoint" />
<Array as="points">
<mxPoint x="361" y="330" />
<mxPoint x="470" y="330" />
<mxPoint x="470" y="60" />
<mxPoint x="220" y="60" />
<mxPoint x="220" y="131" />
</Array>
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="mk51jWXhCHLpo1xptCBX-24" value="1" style="edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;" parent="mk51jWXhCHLpo1xptCBX-23" connectable="0" vertex="1">
<mxGeometry x="-1" relative="1" as="geometry">
<mxPoint y="-10" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-2" value="MainApplication" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;" vertex="1" parent="1">
<mxGeometry x="340" y="360" width="160" height="288" as="geometry" />
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-3" value="-currentValue: Double&#xa;-calculatorType: Int&#xa;-basicCalc: BasicCalculator&#xa;-scientificCal: ScFunction&#xa;-fibo: Fibonacci&#xa;&#xa;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="f8Tqhg3Ib41jFK50YA1g-2">
<mxGeometry y="26" width="160" height="134" as="geometry" />
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-4" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" vertex="1" parent="f8Tqhg3Ib41jFK50YA1g-2">
<mxGeometry y="160" width="160" height="8" as="geometry" />
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-5" value="-runCalculator(): void&#xa;-runBasicCalculator(): int&#xa;-sunScientificCalculator(): int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="f8Tqhg3Ib41jFK50YA1g-2">
<mxGeometry y="168" width="160" height="120" as="geometry" />
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-6" value="" style="endArrow=block;endFill=1;html=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=top;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" target="mk51jWXhCHLpo1xptCBX-1">
<mxGeometry x="-1" relative="1" as="geometry">
<mxPoint x="340" y="410" as="sourcePoint" />
<mxPoint x="500" y="410" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="f8Tqhg3Ib41jFK50YA1g-7" value="1" style="edgeLabel;resizable=0;html=1;align=left;verticalAlign=bottom;" connectable="0" vertex="1" parent="f8Tqhg3Ib41jFK50YA1g-6">
<mxGeometry x="-1" relative="1" as="geometry">
<mxPoint x="-40" y="-10" as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
<groupId>com.zipcodewilmington</groupId>
<artifactId>scientific_calculator</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.zipcodewilmington.scientificcalculator;

public class BasicCalculator {

private Double result;

public BasicCalculator(){
result = 0.0;
}

public Double add(double num1, double num2){
result = num1 + num2;
return result;
}

public Double subtract(double num1, double num2){
result = num1 - num2;
return result;
}

public Double multiply(double num1, double num2){
result = num1 * num2;
return result;
}

public Double divide(double num1, double num2){
result = num1 / num2;
return result;
}

public Double squareRoot(Double num1) {
result = Math.sqrt(num1);
return result;
}

public Double square(Double num1) {
result = Math.pow(num1, 2);
return result;
}

public Double exponentiation(Double num1, Double num2) {
result = Math.pow(num1, num2);
return result;
}

public Double inverse(Double num1) {
result = 1 / num1;
return result;
}

public Double invertNumber(Double num1) {
result = -1 * num1;
return result;
}

public Double percentage(Double num1) {
result = num1 / 100;
return result;
}
}
Loading