Ayden-B / csis10aFinal

0 stars 0 forks source link

Final Project Grade #1

Open hohonuuli opened 1 month ago

hohonuuli commented 1 month ago

Grade

Criteria Possible Points Awarded Points
Presentation 10 10
Compiles 5 5
Runs without crashing 5 3
Solves the problem 35 35
Code comments/formatting/readability 20 14
Overall quality 25 23
Total 100 90

Comments

Used javac *.java; java -cp . Calculator to run it

This is very nice project and well done. I like the EQH and ANS feature.

Using spaces in an equation causes the calculator to crash. Putting more than one operation in parentheses causes the program to crash.

The code would benefit from comments to explain its flow and functions.

BigDecimal has to be used very carefully. Non-terminating decimals will crash your program. For example:

Welcome to this calculator!
---------------------------
Enter an Equation, type HELP for help, or type QUIT to stop calculating:
(1+1)/3
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: Range [-1, 0) out of bounds for length 7
    at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
    at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
    at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
    at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
    at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
    at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4914)
    at java.base/java.lang.String.substring(String.java:2876)
    at Equation.formatGroups(Equation.java:70)
    at Equation.collapseGroups(Equation.java:49)
    at Equation.solver(Equation.java:28)
    at Equation.<init>(Equation.java:11)
    at Calculator.calculate(Calculator.java:33)
    at Calculator.main(Calculator.java:9)
Ayden-B commented 1 month ago

Thank you! I had a lot of fun making it. The parentheses related error was I believe introduced during an ill-advised late commit. I tried to add a method that would insert multiplication symbols between parenthesis and their surroundings if necessary. I thought I had it working properly when I committed it, but after further testing right before class I realized that it not only didn’t fully work but seemed to have messed up the method that solved things within parenthesis. Lesson learned there. Im very glad you had us use GitHub.And thanks for catching the spaces thing, it never even occurred to me while testing it to put spaces into an equation.Sent by me iPhoneOn May 11, 2024, at 17:25, Brian Schlining @.***> wrote: Grade

Criteria Possible Points Awarded Points

Presentation 10 10

Compiles 5 5

Runs without crashing 5 3

Solves the problem 35 35

Code comments/formatting/readability 20 14

Overall quality 25 23

Total 100 90

Comments Used javac *.java; java -cp . Calculator to run it This is very nice project and well done. I like the EQH and ANS feature. Using spaces in an equation causes the calculator to crash. Putting more than one operation in parentheses causes the program to crash. The code would benefit from comments to explain its flow and functions. BigDecimal has to be used very carefully. Non-terminating decimals will crash your program. For example: Welcome to this calculator!

Enter an Equation, type HELP for help, or type QUIT to stop calculating: (1+1)/3 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: Range [-1, 0) out of bounds for length 7 at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55) at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112) at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349) at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4914) at java.base/java.lang.String.substring(String.java:2876) at Equation.formatGroups(Equation.java:70) at Equation.collapseGroups(Equation.java:49) at Equation.solver(Equation.java:28) at Equation.(Equation.java:11) at Calculator.calculate(Calculator.java:33) at Calculator.main(Calculator.java:9)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>