In-Depth Blog Post #3

Since my last blog post, I’ve been quite productive and made lots of progress!

 

Calculator progress update

I finished a basic version of my calculator, and I highly encourage you to try it out. Here’s the link:

Calculator download

Firstly, I must tell you that you need Java Runtime Environment to run this app (if you’ve ever played Minecraft [Java Edition] you probably already have it). To run the application, click on the link, then click “Download” => Direct Download. Lastly, you may get a prompt saying, “This type of file can harm your computer. Do you want to keep ColinsCalculatorAp…jar anyway?” Click on the “keep” (I promise the file isn’t harmful).

Now you can just go to the downloads folder on your computer, and double-click on the file.

This calculator has the four basic arithmetic operations (addition, subtraction, multiplication, and division), and works with order of operations. I also made it so you can do things like “7(2+5)” or “(1+2)(3-4)”, and it should still work properly. If you notice any problems with my calculator, please leave a comment with a description of the problem and how it happened so I can fix it.

This will definitely not be the last version of my calculator. Right now, there are still many improvements I can make with this calculator. It currently doesn’t have functionality with exponents or other functions like “log” or trigonometric functions like sine or tangent. I think I will add the functionality for exponents and roots first, and then I might add other features later (these would require a whole change of concept to work).

A second improvement I will make is that instead of using iteration to go through the expression, I can use recursion instead, which would likely be a bit more efficient (except in the case where a user inputs thousands of numbers, where recursion would be significantly more efficient) and also much “cleaner”. Recursion is a lot harder to do than iteration, though, so could take a couple weeks until I’m done.

How to have a beautiful mind

In my third meeting of my mentor, I applied the tips and skills from chapters four and five of the book “How to Have a Beautiful Mind.”

  1. How to be interesting

    Here’s an example of me being interesting. We were talking about some already interesting properties of searching through an arrayList and its time complexities. I mentioned a “what if” scenario that’s really bad in terms of runtime, which was if the user were to input 100+ operators and the program would have to search through all the operators for each operator search. My code would have been extremely inefficient in that case.

  2. How to respond

    Here’s an example of me responding to my mentor. My mentor was talking about how I was accumulating all the characters into a string, then handling them at the end. Because at this time in development, my calculator used a textbox input, he suggested to allow the user to type in the whole expression (which is more convenient than inputting characters individually). I responded by sort of “reminding” my mentor that the final product would have buttons and an actual GUI, to which (after thinking a bit about how it will work in the end) we both agreed that my original code would work pretty well in the end.

Once again, I encourage you to try out my calculator (and try to pick out glitches and bugs if you can)! Hopefully I will be done changing my calculator to use recursion by the next time I post in two weeks.

Thanks for reading!

Posted in Uncategorized.

3 thoughts on “In-Depth Blog Post #3

  1. I just realized that I compiled the calculator using JDK 15, which is a fairly new version. This means most people probably won’t be able to rut the application because they don’t have the right version of Java Runtime Environment.

    I will downgrade my version of JDK tomorrow and recompile the application so people running JRE 1.8 (which is by far the most popular) will be able to run it.

    Stay tuned!
    Colin

    1. Update: I recompiled the calculator so now you should be able to run it as long as you have JRE 1.8 or better.

      Colin

Leave a Reply

Your email address will not be published. Required fields are marked *