The above link goes to my CS 50 Dropbox folder that has the three wee programs I had to write.
Pennies.c asks the user for how many days in the month and how many pennies they initially have. It outputs how much those pennies add up to when treated exponentially. I need to learn how to include commas in large numbers. The course doesnt say it explicitly, but I believe the point behind this program was to experience how inaccurate computers really are. Its all bits and bytes and this is something to sit and go over with Dr. Dave. It’s somewhat foggy to me. I was also surprising to learn that C does not have an operator for exponentiation. I later learned that if you use the math.h library you have the pow function.
Greedy.c asks the user for how much change is due. It then computes the fastest way to reach that number with the least amount of coins. Starting with quarters and moving to pennies. Its pretty easy conceptually especially if you use a modulus operator but for some reason I cant get it to compile. Help.
Lastly, chart.c asks for how many specific types of sightings occurred between the sexes. It then needs to take that input, calculate it to a percentage of 80 asterisks (*) printed on the screen to act as a graph. Its pretty silly. The formula I came up with/came across doesn’t really seem to work. It prints all the * on the same line.
Overall, it rocked. It was a much more reasonable problem set for an introductory class than MIT provided. Also, I’ve taken to C much easier than I thought. Although its freakishly annoying when I forget something like a simple “;”. The copious documentation (and the fact that C apparently hasnt changed at all for about 15 or so years) helps. I’m curious to learn the actual differences between C and C++, C#, and Objective-C. Are they like brothers from the same mother, or cousins far removed from a distant sire and constantly seeking to usurp the throne of the other… oh wait, I’m mixing my studies with my enthusiasm for the new season of Game Of Thrones.
Speaking of which, I’m tired. Off to relax world.