Calc


Project Overview and Documentation

Displayed Below is an example overview of a design document.

[ Download ]

Application Description:


For people who don't carry a calculator in their pocket. We've got the next best thing. The ideal scientific calculator for preparation towards university exams, work, or general mathematics needs.


A general mathematics calculator and general science calculator for courses such as:


- Algebra

- Geometry

- Statistics 


******************************

*** Functions Featured ***

******************************


Store Constants. Store Variables. Store Simple Programs / Custom Functions.


Trigonometric Operations:


[ Sine, Cosine, Tangent, inverse sine (arcsine), inverse cosine (arccosine), inverse tangent (arctangent), hyperbolic sine, hyperbolic cosine, hyperbolic tangent, inverse hyperbolic sine (hyperbolic arcsine), inverse hyperbolic cosine (hyperbolic arccosine), inverse hyperbolic tangent (arctangent)]


Exponential Operations:


[ Logarithms, Natural Logarithms, Square Root, Nth Root, 10^x, e^x, x^-1, EE (Enter Exponent), %, ^ ]


Fractions, Mixed Numbers, and Numeric Notations:


[ Transform Fractions to Decimals, Simplify Mixed Fractions, Round to "FIX" -ed digits. Supports Engineering Notation. Supports Scientific Notation. Supports some Unit Conversion. ]


- R<>P [ Rectangular or Polar Coordinate ]

- R > Pr [ Rectangular to polar radius ]

- R >Pθ [ Rectangular to polar θ ]

- P > Rx [ polar to rectangular x-coordinate ]

- P > Ry [ polar to rectangular y-coordinate ]


Supports calculating statistics. [ 1 Variable Statistics. 2 Variable Statistics. 


Support Probability Calculations. Combinations, Permutations, Factorial, Random Number Generation, Random Integer generation. [ !, rand, nPr, nCr ]


Supports Various Angle Modes for Calculation. [ Degrees, Radians, Gradians ]




Progression:


Day 1: Portrait Phone Layout Drafted. (6hrs.)


Day 2: Landscape Phone Layout Drafted. Updated Portrait Phone Layout. (4hrs.)


Day 3: Updated Landscape Phone Layout. Tested app on Hardware and Virtual Devices. (4hrs.)


Day 4: Icon and Color Palette Drafted. Arithmetic Functions Architecture & Sprint Events Mapped. (4hrs.)


Day 5: Tablet Landscape Layout Drafted. Rebuilt layout to leverage “Weights”. Defined differences between Ti-30 and TI-84 Plus. (4hrs.)


Day 6: Drafted Tablet Portrait Layout. Updated Tablet Landscape Layout. Drafted Small Tablet Layout Design. (4hrs.)


Day 7: Drafted Foldable Layout Designs (Portrait and Landscape). Updated Small Tablet Layout Design to Support Foldable Devices.  Confirmed proper “Responsive Design” appears in the "Layout Validation" Window, across all reference device types. (2hrs.)


Day 8: Drafted Classes and Methods for Fundamental Arithmetic Operations (Addition, Subtraction, Division, Multiplication). (4 hrs.)


Day 9: Updated Classes and Methods to support some orders of operations (PEMDAS). (4hrs.)


Day 10: Updated “Portrait Phone” activity. Resized and aligned buttons. Straightened buttons horizontally and vertically. Drafted button “OnClickEvents”. Buttons (Clear, Delete, Numeric, Trigonometric, Exponential, and Fundamental Operations) now update “Response Textview”. (4hrs.)



[ 40 Hours ]



Day 11: Created Desktop / Large Tablet Layout. Update all layouts with appropriate IDs for “Onclick events". Discovered Issue with Rotation/Orientation Changes. (07/19/2024). (4hrs.)


Day 12: Fixed Rotation Issues. Verified all layouts contain appropriate IDs. (7/22/2024). (2hrs.)


Day 13: Merged PEMDAS & Test Java Classes with Calc Project. Updated MainActivity.java with lifecycle “Logcat” messages to track screen rotation. Fixed Request Textview so that user entries now persist on screen rotation. (7/26/2024) (2hrs.)


Day 14: Brainstormed PEMDAS integration. Discovered issue with text file directory complications, “item not found”. Migrated math “Test” classes to separate files. Validated “Basic Arithmetic Operations” work on calculator application. Updated divide function to verify double/integer and decimal formatting. Pondered how to implement the second button, secondary activity overlay or text file. (7/27/2024) (4hrs.)


Day 15: PEMDAS Fundamental Operations ( +,-,*,/ ) Completed. Explored Files API implementation options. PEMDAS Calc Tests Needed. (07/31/2024). (4 hrs.)


Day 16: PEMDAS Fundamental Operations ( +,-,*,/ ) Integrated into Android Application. Various testing completed. (08/01/2024). (2 hrs.)


Day 17: Updated Second Button Logic to trigger "onLongClick" for all buttons. Updated ON/OFF button to close application. Updated PEMDAS Logic to complete "Exponent Operations". Fixed PEMDAS Logic bug, application now appends left and right fragments of expression when completing fundamental +, -, *, / operations. Fixed "Show History" log bug that was recording redundant mathematical steps. 

(08/02/2024). (4 hrs.)


Day 17 - Part 2: Updated Equate to check for parentheses syntax errors. Update Main Activity to include premium feature toast for incomplete functionality. Updated String Arithmetic to support Fundamental Operations, Exponential Operations, and Basic Trigonometric Operations. (08/02/2024). (4 hrs.)


Day 18: Updated Layout. Drafted Button Reorganization. Added Inverse of Function. Drafted Handling Negative Numbers. Updated Negative Number Symbol Inclusion. (08/03/2024). (2 hrs.)


Day 19: Updated String Arithmetic Functions to support negative numbers by accurately formatting and parsing strings and primitives with appropriate negative symbols (“ - ” or  “ ⁻ ”). Updated various layouts with minor visual improvements. (08/05/2024). (4 hrs.)


Day 20: Completed percentage support. Completed mixed fraction and decimal to fraction conversion. Fixed an issue with division rounding. Updated Division symbol usage to distinguish the operation from fractions. Updated button color scheme and organization. Updated String Arithmetic to support hyperbolic functions. Considering treating “E” like decimal and allowing Java to manage formatting. (08/06/2024). (4hrs.)


Day 20 - Part 2: Updated String Arithmetic PEMDAS method to properly handle “E”. Fixed numerous Android Studio warnings, generally cleaning up Java specific code. Updated String 
Arithmetic class to support “Inverse Hyperbolic Trigonometric Expressions”. Updated XML Layouts to resolve various Warnings, such as Content Description. (08/06/2024). (4hrs.)



[ 80 Hours ]



Day 21: Update Application Logo. Added Monochrome Logo. Updated "Light Theme” and "Dark Theme". Discovered negative symbol, E bug. Created Dialog boxes for PRB, DMS, and DRG. Dialog templates can be applied to STAT, STOR, and MVAR. (08/07/2024).(8 hrs.) 


Day 22: Fixed an issue with % String concatenation. Fixed an issue with "E" symbol arithmetic and negative symbol syntax. Fixed an issue with incorrect loop = false assignment in % "else if" conditional block. Fixed an issue with PEMDAS while loop assigning loop = false instead of returning unique error messages. Fixed an issue with e^ inaccurately displaying a negative/ subtraction symbol. Validated all operations can handle the new negative symbol. Fixed numerous, miscellaneous "tool:ignore" and other warnings in various layouts throughout the project. Added a dialog box for Cartesian / Rectangular & Polar Coordinates. Improved overall StringArithmetic l, PEMDAS method performance by reducing the number of string object evaluations if/else conditional calls. (08/08/2024). (4 hrs.)


Day 22 - Part 2: Updated Layout details to include new ids. Extracted strings. Updated dialog boxes with new colors. Created Float, Scientific, Engineering Dialog Box (FSE). Migrated Equate to MainActivity to test in context file reading. Updated all dialog boxes to support scroll view when device is in landscape. Fixed numerous Android Studio warning messages. Added, “Premium Feature Coming Soon” Toast to all included items. (08/08/2024). (4 hrs.)


Day 23: Updated "K" functionality. Updated "RESET" functionality. Updated F<>D functionality. Completed "STO>" Dialog Box. Completed “RCL” Dialog Box/ Completed the "MVAR" Dialog Box. Completed CLRVAR functionality. Updated "colors.xml" palette. Created more dialog gradients. Updated the application to leverage the radical symbol. Fixed bug with order of operations; added + / - "Left to Right" priority. Created FIX dialog box. (08/11/2024). (8 hrs.)


Day 24: Completed “Fix Notation”. Completed “Scientific And Engineering Notation”. Completed RAND, nPr, nCr, and ! functionality. RANDI incomplete. Completed Degree, Minute, Second, r, g functionality. Degree Mode incomplete. Gradian mode incomplete. Updated Modes Indicators (Red/White Subtext) below “Answer Box”. Updated Activity Layouts. Relabeled layout elements. Updated PRB functionality.  Updated R<>P Functionality. (08/12/2024). (8hrs.) 


Day 25: Started History / Show Work Dialog Box. Completed "PRB Button" features (RANDI). Completed R<>P Button (Rectangular & Polar Coordinate) features (R>Pr, R>P∅, P>Rx, P>Ry). Fixed Fraction/Decimal Output. Reorganized Project Documentation. Started Ads on Dialog Pop-up Implementation. (08/13/2024). (4 hrs.)


Day 25 - Part 2: Started Stat dialog, started data button. Fixed bugs with scientific notation. Observed unexpected behavior with engineering notation. Implemented temporary Degrees and Gradian translation functions. (08/13/2024). (4 hrs.)


[ 120 Hours ]


Day 26: Completed Show Work / History / Answer Dialog Box. Noticed bug with Scientific Notation. Duplicate values given. Change double if to if & else if. Noticed syntax missing for engineering notification. Add x10^0.  Noticed bug when handling infinity. Add, if answer.contains("infinity") return "OVERFLOW".  Noticed a bug when pressing “>d/e”; Too early symbol substitution or d/e needs immediate removal. Noticed bug, lack of check for NaN, Infinity, etc. (08/14/2024). (4hrs.)


Day 27: Fixed bug with Scientific Notation. Added "else if". Fixed engineering notation. Added x10^0. Fixed bug when handling infinity, NaN, and undefined. Fixed bug when >d/e. Completed “Implied Multiplication”. Completed” Implied DMS Addition”. Fixed persistent radian bug. Fixed C substitution error. Fixed implied addition error for DMS.  (08/15/2024). (4 hrs.)



Day 28: Fixed ID tag bug. Created Coordinate Point class. Created Statistics Logic. Created Statistics Dialog Box. Updated Stat Dialog Box. Fixed Addition false loop assignment bug. Updated various dialog box root IDs. (08/16/2024). (8 hrs.)


Day 29: Updated PEMDAS' continue loop symbols. Updated implied multiplication. Completed stat data entry. Renamed package. Made STO variables persist after screen rotation. Solved sequential symbol bug. (08/17/2024). (8 hrs.)


Day 30: Completed Angle modes. Updated PEMDAS to support nested parentheses and new angle modes. Updated all layouts and text bars to support orientation changes, persistent coloring, and new modes. Updated StringArithmetic to better support large numbers (BigInteger and BigDecimal). (08/19/2024) (8 hrs.)


Day 31: Updated Layouts, removed premiumFeature method. Added tips and start dialog boxes. Updated all gradients and activities to reduce some lint warnings. Updated PEMDAS order of operations and parentheses parsing. Project (version 1.0) is considered completed. (08/20/2024). (4 hrs.)


Day 32: Ran diagnostics and tests for each function and compared results to a secondary device to verify proper arithmetic. Updated Project Variables, Names, and Values. (08/21/2024). (4 hrs.)


[ 160 Hours - Version 1.01 Published for Review ]


Day 33: Designed Free version Portrait Layout. Defined features, ads placement, and new logo design. (08/22/2024). (4 hrs.) 


Day 34: Minor Tweaks Nested Parentheses Bug fixed. (2 hrs.) (09/26/2024).







Texas Calc To Do 


(FREE) Custom Layout, Semi-Persistent Ads

(0.99) Base [ Remove Ads - TI Layout ]

(0.99) Graphing

(0.99) Integrals

(0.99) Cosmetics & Metrics


(0.99) Separate App:

- (AI) Scan / Write & Solve, Import & Solve







Color Science


Palette Base Color: #FA980B


Color Source: https://mycolor.space/?hex=%23FA980B&sub=1


Icon Sources: https://static.vecteezy.com/system/resources/previews/010/187/370/large_2x/texas-state-line-icon-illustration-vector.jpg

https://cdn2.iconfinder.com/data/icons/ios7-inspired-mac-icon-set/512/Calculator_512.png


Key Colors:


Dark Red: #C35353

Red:#FD685B

Light Red: #FFAD89

Orange: #FA980B

Yellow: #FFEBCD

Green: #00CD77

Teal: #97ffd3

Blue: #C3FCF1

Purple:#8D5B98

Pink:#FFC0BA

Off-White: #FFF7E9

Gray: #DFE0DF

Brown: #AE8A68


Color Palette:


#4b8077

#804b54

#4b805d

#4b6e80

#4b5480

#774b80



https://tools.oratory.com/altcodes.html

https://mycolor.space/?hex=%23FA980B&sub=1







 

Universal Design (Big Button Mode)


Layout Organization Pseudocode:

Request

Answer

Logo,

ON, mem, mode, Delete, clear,

Angl, trig, Exp, prb, Stat,

More, 7,8,9, ×

(, 4,5,6, -

), 1,2,3, +

=, 0, . , -, ÷



GROUPINGS (ON BUTTON CLICK)

ANGL (°, ', ", DMS, R>Pr, R>P∅, P>Rx, P>Ry)

TRIG (sin, cos, tan, asin, acos, atan, sinh, cosh, tanh...)

PRB (!, rand, nPr, nCr, et.)

EXP (sqrt(), log, ln, etc.)

STAT

VAR







Pseudo Code & Brainstorming:


Make Dynamic System Elements in Layout with Custom Themes and Alias:

https://stackoverflow.com/questions/6004450/application-themes-change-and-imageview-src-based-on-app-theme-name


For All Input Buttons:

- Onclick() append symbol to Request


Enter Button:

Onclick()

- save Request to CSV

- define PEMDAS (Order of Operations)

- Complete Arithmetic

- Clear Answer Textview

- Update Answer Textview with Answer.


PEMDAS Class


Input is a string


Methods:


FindParenthesis(string) {if found PEMDAS(substring)} return string with parenthesis solution substring concentrated replacing the previous parenthesis text.


Find exponent(base, super) calls PEMDAS with answer replacing exponent substring


AI SCANNING:


https://www.tensorflow.org/lite/examples


CONSIDER FIXING:


Change every int to long

Add a space after engineering (decimal notation)



Radians, Degrees, Gradian Functions:


1 Radian = 180/π Degrees

1 Degree = 400/360 Gradians

1 Gradian = π/200 Radian

1 Radian = 200/π Gradian 




Button layout

Button press update Textview

Enter update history

Loop Calculations update steps / history

Answer update response Textview



Work on updating the original string when old expressions are solved.



// solves the expression contained in parenthesis and returns original expression with no parenthesis sub operations


Evaluate Parenthesis {


If you have parenthesis

Then check if you have equal number of open and close

Then find first open

Then find the first Open's close.


New expression = substring (first open, opens close)


Answer = Math(New Expression)


NoParenthesis = (ogExpression(0, first open) + Answer+ ogExpression(opensclose, ogExpression.length)


Return NoParenthesis}

Make sure FindParenthesis does not return anything.


Have find Parenthesis update answer and call equate


Have final equate method check and return updated answer



Contains °


If index of ° +1 is digit

While (I< length) 

// Check for proper dms syntax 

DMS = D+m+s

Return left + DMS + right

Sequential Symbols 

Main activity 


Boolean symbol typed 


Update button (request, "", true/false)


If symbol typed.


S = request.gettext.tostring()


Set request = Substring(0, s.length() - text.length())








Activity Layout:



Phone Portrait:

layout > activity_main.xml


Phone Landscape:

layout-land > activity_main.xml


Small Tablet / Foldable Portrait:

layout-w601dp-port > activity_main.xml


Small Tablet / Foldable Landscape:

layout-h601dp-land > activity_main.xml


Desktop / Tablet Portrait:

layout-w800dp-port > activity_main.xml


Desktop / Tablet Landscape:

layout-h800dp-land > activity_main.xml




Future Features:


Outline a "Show Your Work" console log for validation and review purposes. 







Feature Organization and Breakdown


Free Version of the App Offers


Paid Version of the App Offers




TI-84 Plus vs TI-30X - UX Differences


40 Buttons on TI-30X


New Buttons:


Alternate Buttons:



Features Apple Math Notes does not have
 







Calc Operations


Features Comparison: 


https://docs.google.com/spreadsheets/d/1QjCVVpSEsMqxj6ajlDW5dHDi8JPC0CJrKZBOJP8T_Pg/edit?usp=sharing





Basic / Fundamental Operations:


- Addition [ + ]

- Subtraction [ - ]

- Multiplication [ * ]

- Division [ ÷ ]


Fractions/Decimals Function:


- F <> D [ Fractions to Decimals ]

- A b/c <> d/e [ Mix or Improper Fractions ] 

- % [ Percentage ]


Exponential Functions:


- x^-1 [ Inverse Function ]

- x^2 [ Squared Function ]

- 10^x [ Powers of Ten ]

- e^x [ E to the Powers of X ]

- ^ [exponent function ]

- log() [ logarithm ]

- ln() [ natural logarithm ]

- x√( [nth Root ]

- √( [Square Root ]


Trigonometric Functions:


- sin() [ Sine ]

- cos() [ Cosine ]

- tan() [ Tangent ]

- asin() [ Inverse Sine ]

- acos() [ Inverse Cosine ]

- atan() [ Inverse Tangent ]

- pi


Circle Arithmetic:


- ° ' " Button (Degrees, Minutes, Seconds)


Statistics Functions:


- Data Button [start data entry ]

- STAT [ start stat mode ]

- VARSTAT Button [ display various statistical analysis ]

- EXIT STAT [ close stat mode ]

- 1-VAR [ 1 variable statistics ]

- 2-VAR [ 2 variable statistics ]

- CLRDATA [ Clear Data ]


Usage History Feature


Hyperbolic Functions:


- sinh() [ Hyperbolic Sine ]

- cosh() [ Hyperbolic Cosine ]

- tanh() [ Hyperbolic Tangent ]

- asinh() [ Inverse Hyperbolic Sine ]

- acosh() [ Inverse Hyperbolic  Cosine ]

- atanh() [ Inverse Hyperbolic Tangent ]


Formatting:


- DEL [ Delete ]

- FIX [ Fixed Notation ]

- EE [ Enter Exponent ]

- , [ Coordinate Pair Input separator ]

- SCI/ENG [Scientific or Engineering Notation ]


Memory Functions:


- K [ Constant ]

- STO > [ Store Memory Variables ]

- MEMVAR [ Memory Variables List ]

- CLRVAR [ Clear Variables from memory ]

- RESET [ Reset Calculator and stored data ]

- A B C D E [ Memory Variables ]

- ANS [ Answer Text / Variable ]


Probability Functions:


- PRB [ Probability ]

- nPr [ Permutations ]

- nCr [ Combinations ]

- ! [ Factorial ]

- RAND [ Random ]

- RANDI [ Random Integer ]


Rectangular/Polar Coordinate Functions:


- R<>P [ Rectangular or Polar Coordinate ]

- R > Pr [ Rectangular to polar radius ]

- R >Pθ [ Rectangular to polar θ ]

- P > Rx [ polar to rectangular x-coordinate ]

- P > Ry [ polar to rectangular y-coordinate ]


- DRG [ Degrees, Radians, or Gradians ]




ADDITIONAL RESOURCES:

  1. https://stackoverflow.com/questions/52095306/custom-dialog-with-listview-on-orientation-change-landscape-mode

  1. https://m.youtube.com/watch?v=5M0AilIN61I

  1. https://stackoverflow.com/questions/10636635/disable-keyboard-on-edittext

  1. https://www.youtube.com/watch?v=TMQNvnU0_wE

  1. https://www.reddit.com/r/learnpython/comments/l1ybvx/making_a_pemdas_calculator/

  1. https://mamackay.weebly.com/uploads/1/3/3/8/13382344/converting_between_decimal_form_and_dms_form.pdf

  1. http://tibasicdev.wikidot.com/p-ry

  1. https://education.ti.com//html/eguides/scientifics/TI-30XIIS/TI-30XIIS-Quick-Reference-Guide_EN.pdf

  1. https://drive.google.com/file/d/1TclOW2IGIvQFRTNG-69eWo2gbCoyFzYt/view?usp=drivesdk

  1. https://education.ti.com/en/customer-support/kbase_search_results?technology=science-elem

  1. Architext Font · 1001 Fonts https://www.1001fonts.com/architext-font.html

  1. Nexa Rust Font Family · 1001 Fonts  https://www.1001fonts.com/nexa-rust-font.html

  1. https://education.ti.com/en/customer-support/knowledge-base/scientific-elem-calculators/product-usage/12292

  1. https://github.com/tensorflow/examples/tree/master/lite/examples/digit_classifier/android

  1. For More Tips: https://education.ti.com//html/eguides/scientifics/TI-30XIIS/TI-30XIIS-Quick-Reference-Guide_EN.pdf

  2. https://people.math.wisc.edu/~gemeyer/math141/TI30XS.pdf

  1.  http://www.labbookpages.co.uk/software/java/engNotation.html

  2.  https://en.wikipedia.org/wiki/Engineering_notation