11.15.09
Posted in Programming, School, c++ at 9:35 pm by bryan
Finally! I did it! Assignment #4 is complete, and I can manipulate dates pretty effing easily now.
No doubt there is already some vastly superior date manipulation library already out there… stupid school.
Just kidding. I learned a LOT with this assignment.
Permalink
10.07.09
Posted in Programming, School, c++ at 11:51 pm by bryan
One of these days I’ll actually know how to program c++ pretty well, and when that happens, I plan to write some kickass software. But when that happens, I figured it would be pretty amusing to look back at my very first c++ program (besides the mandatory “Hello World!” app).
This was our first assignment in Computer Science 210, page 98, #15 in Problem Solving, Abstraction & Design Using C++ (5th Edition)
. To quote:
Write a program that dispenses change. The program should read the amount of the purchase and the amount paid and then display the number of dollars, quarters, dimes, nickels, and pennies given in change.
Actually if you keep reading, they tell you the wrong way to do it, as a “hint”. Jerks.
But notwithstanding, this is what I wrote:
I promise, there was lots more whitespace in the actual program. Wordpress is just being stupid. Here's the file for download: ChangeDispenser.cpp.
Warning: Don't cheat off me.
UPDATE 10-19-09: Fixed a bug in how pennies were calculated.
UPDATE 11-01-09: Fixed formatting / lack of whitespace.
Permalink
07.08.08
Posted in School at 12:56 am by bryan
Who are you, and why do you care? You’re me (because I get no other traffic), and you don’t care for that reason. Just had to clarify that point before going any further.
Yeah, I just did a bunch of
quadratic equations, and I’m feeling pretty proud of myself. Sure, it’s a review of Algebra 2, Trigonometry, and College Algebra back in high school, but I was foolish and slept through much of the two latter. As for Algebra 2, I was afflicted with memorization of techniques for solving problems, without
really understanding.
Luckily, I now have a
pretty good professor who has clarified things. The crazy thing is that whenever I start thinking about the real world applications of this type of math, there’s too many to count.
One thing very applicable to my past life at
iFLOOR was curve fitting– taking observed data and fitting it to a curve. (Example: price point, units sold, revenue) If you graph the data, it will create a parabola (aka: bell curve). But here’s the cool part: You can take the equation for that bell curve and use it as a pricing model in order to price for maximum profit.
And I always figured that “pricing model” was just a buzzword…
Permalink