Moving Right Along in CS 0007, Intro to Programming in Java
So class is moving along at a regular clip. I am learning about syntax and seeing similarities between other languages. I have written four text-based programs using Java that were pretty easy, seeing as I already have some clue as to how to code. Today, however, she threw us into the fire and, like many times before, I opened up a blank Atom text document and froze.
I know I am going to write bugs. Everyone does. No one gets it write the first time. But sitting there at my Mac, staring at Atom, knowing I had a day to complete calculating the average of three test scores and then printing the average to the screen using two decimal places stopped me in my tracks. We just learned about formatters, which I was familiar with in Python, but there was this extra way to format. For instance, take the number 5,876.98. You could format this like:
I don’t know if they have that in Python, but it looks pretty silly and verbose to me.
Anyway.
I completely froze up. I do it all the time. I am a perfectionist. To a fault. This can’t happen if I am to get anything done. So I looked at my professor’s code and my old code and started coding.
Ran into a bug. Thanks to Bill Laboon for his help debugging. I kept getting an exception error. I was using “%,.2f” when my numbers didn’t require a comma– they weren’t big enough. So my program is full of whitespace which I am going to fix, just want to read it better. This is the program I wrote:
© tiff.RSS