/* Sup! Loop here! Please note: There are a lot of bugs. Check notes and credits for details. Before I get into the introduction and further information, I'm just going to put instructions here for those of you who would like to skip ahead to running the program without all the information on the math behind it. The program will ask you for an a, b, and c value. Enter them one at a time and only the number! Do not include any form of x! So for example, if I have 5x^2 + 3x + 4, I'll enter 5 for a 3 for b and 4 for c. If you would like to run again, just type "Y" or "y". Anything else will end the program. Sorry, I was a little tired and didn't feel like fixing errors. So . . . welcome to the Factoring Machine! This is a project I've been dreaming of making since Spring 2020. Now, two years later I've kind of done it! (Though I only took a couple days on this, not two years, let's be honest here) So, this program factors quadratics that are entered in standard form. If you've never heard of quadratics, that's okay, they're introduced in Algebra I, which you'll most likely take in 8th Grade or as a Freshman. Quadratics can be written in three ways: (^ is for exponents) * Standard Form --> f(x) = ax^2 + bx + c * Vertex Form -- > f(x) = a(bx-h) + k * Factored Form --> f(x) = a(x-m)(x-n) This project factors standard form to give you the factored form. I also provided the x-intercepts. If you want to learn how it works, you can read through my code or look up how to do it yourself. This method uses grouping. */
/* Code by me. Art by me Thank you to my math teachers for teaching me this stuff! Thanks to my computer science teachers! Who knew modulo division would be so important? Bugs: 1.) Can only factor by grouping. Sometimes doesn't work if it needs to be solved another way. 2.) If it can be factored by grouping but the whole problem can have something factored out (like in the case of 8x^2 + 4x + 2, which could potentially have a 2 factored out) it may not work correctly. 3.) Sometimes says somethings not factorable when in reality, it just isn't factorable by grouping but may be factored by square roots or perfect squares. 4.) In the case of a quadratic having no x-intercepts, the program gives random x-intercepts. I think it's an overflow error because the computer doesn't know what to do with negative square roots. Let me know about any other bugs you find! Maybe one day I'll make a better version! How it Works: 1.) First I found all of the possible factors of the product of a and c. 2.) Then I look for which two factors add up to b. 3.) Then it really comes down to formatting. Though, in case of |a| being greater than 1, I had to try to accommodate that. It has mixed results. 4.) For finding x-intercepts, I use the quadratic formula. You could technically just solve each factor in factored form for x, but I wanted to include them for things that are unfactorable as well. */