inspiration: I wanted to program something that presented my interest in both math and computer science. A simple algebraic task is actually much harder to write an extensive program for.
function: It solves two linear equations using matrix multiplication (inverses, determinants, etc.).
process: First, the math behind the matrix multiplication needed to be correct, so the movement and logic through/behind the arrays needed to be established first. Then, it was all about entering in the correct numbers into the matrices/arrays: integers, negative numbers, fractions. Lastly, I implemented a scanner to include user interaction in the console.
challenges: There were a lot of errors regarding Strings and parsing, which took a lot of debugging. The if-else statements also have to be in the perfect order to avoid errors. The equations are entered as Strings, so parsing fractions takes multiple steps that were bound to error out. The first version was so overcomplicated that I basically started from half-scratch the second time around.
learning: I learned a lot about efficiently using substrings and String functions - parentheses can get really annoying when you have many String functions at once. I also learned it's better to use doubles instead of integers for these type of precise math calculations.
next steps: implementing the use of decimals (most complicated it does right now is fractions), maybe moving on to more complex calculations: e.g. system of three equations
Built With
- java
- repl
Log in or sign up for Devpost to join the conversation.