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

Group 1 - Calc #14

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2d4cc2e
created Calculations class and basic calculations
Jun 25, 2022
0b2ab07
updated core methods
Jun 25, 2022
88a9517
Add DisplayMode enum and ScientificCalc class
linjiayo Jun 25, 2022
0115245
Add calc GUI
linjiayo Jun 26, 2022
d1c9301
Add scientific functions
linjiayo Jun 26, 2022
a7aca11
add conversion method to degrees based on trig mode
linjiayo Jun 26, 2022
018d6df
added scientific calc testing
Jun 26, 2022
be41b11
update scientific calc methods
linjiayo Jun 26, 2022
629992a
resolving conficts
Jun 26, 2022
20b90b4
updated test coding with method names
Jun 26, 2022
9fc3b0a
added additional scientific tests
Jun 26, 2022
57a98ca
Add number and operator action listeners
linjiayo Jun 26, 2022
8618eee
updated tests
Jun 26, 2022
63ea2d4
Add scientific feature action listeners
linjiayo Jun 27, 2022
35b760d
fix CalcDisplayMode modenum method
linjiayo Jun 27, 2022
a2a5464
add backspace action listener
linjiayo Jun 27, 2022
d4a5d1f
add power action listener function
linjiayo Jun 27, 2022
faaa302
Ran tests
dulleydoo Jun 27, 2022
686af11
Add displayMode conversions
linjiayo Jun 27, 2022
6d0adc2
fixed non-working tests
Jun 27, 2022
efb34ed
added more trig tests
Jun 27, 2022
5a8e404
handle division by zero
linjiayo Jun 27, 2022
9421c0a
add number conversion
linjiayo Jun 27, 2022
338b079
Merge pull request #1 from ZipcodeCalc-1/gui
linjiayo Jun 27, 2022
740ae21
Merge branch 'master' into feature
linjiayo Jun 27, 2022
1bc9b9b
Merge pull request #2 from ZipcodeCalc-1/feature
linjiayo Jun 27, 2022
ee56c78
Merge branch 'master' into TestBranch
linjiayo Jun 27, 2022
87e8e1c
Merge pull request #3 from ZipcodeCalc-1/TestBranch
linjiayo Jun 27, 2022
c90433c
add uml
Jun 27, 2022
562e1da
Fix factorial test
linjiayo Jun 27, 2022
1073f74
add inverse division by zero error
linjiayo Jun 27, 2022
4e716b4
fix divide by zero check
linjiayo Jun 27, 2022
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
Binary file added .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,6 @@ fabric.properties


#maven build target
target/
target/

.DS_Store
Binary file added calc-uml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
<groupId>com.zipcodewilmington</groupId>
<artifactId>scientific_calculator</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>


</project>
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
Binary file added src/main/java/.DS_Store
Binary file not shown.
Binary file added src/main/java/com/.DS_Store
Binary file not shown.
Binary file added src/main/java/com/zipcodewilmington/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.zipcodewilmington.scientificcalculator;

public enum CalcDisplayMode {
DECIMAL(1, "DEC"),
BINARY(2, "BIN"),
HEXADECIMAL(3, "HEX"),
OCTAL(4, "OCT");

int modeNum;
String abbrev;

CalcDisplayMode(int modeNum, String abbrev) {
this.modeNum = modeNum;
this.abbrev = abbrev;
}

public int getModeNum() {
return modeNum;
}

public String getAbbrev() {
return abbrev;
}
public int nextMode() {
if (this.modeNum == 4) {
return this.DECIMAL.modeNum;
}
return this.modeNum + 1;
}

public static CalcDisplayMode getModeByNum(int num) {
for (CalcDisplayMode mode : values()) {
if (mode.modeNum == num) {
return mode;
}
}
return null;
}
}
Loading