Remember the good old hello world program? Ahh the first program any teacher in any type of programming course would assign was good old Hello World. But as students / new developers we were excited! Wow my first program and I got it to say Hello World and it displayed it right on my screen. "Just take a look" you'd say to the student next to you, I even included the header iostream.h.
How did our young minds go from writing programs like Hello World to robust database applications in the .net framework? Do you ever wonder how your mind has actually created the beasts that people are using today? Admit it, you are smart, better yet we are smart. Computer Science guys are engineers, we're doctors, we are artists, and we're even lawyer's. We have to take large business processes and convert it into a useable tool (engineers). We have to debug, optimize, and fix bugs (doctors). We have to design nice interfaces, whether web based or win form, and make them useable to end users (artists). We have to fight for what we believe, pointing blame on our clueless end users (lawyers).
How did we ever go from writing hello world, and a mini calculator to these fairly large applications? We've worked hard...that's how. So programmers / dba's / and even you system admins take a moment smile and pat yourself on the back because you've busted your butt doing this stuff and you're damn good at it.
Since we've gone to writing complex applications I sometimes look back at some basic programs and say wow this is so simple that its difficult. I've forgotten how to think in a simple manner. We sit day to day writing use cases, designing forms, and working on large databases that we forget how to do the simple things in life.
So its time for some old school CS 101 programming assignments. Here's 4 homework assignments you can do in any language:
1) In a pretty slick way output the maximum value of a unsigned integer. Try to not use a library which allows you to display the maximum of this value (in addition such as max.h in C++).
2) Write a cash register program which displays the amount of change given back to the customer in dollars, quarters, dimes, nickels and pennies. For instance:
Your total is 18.20
You give: 20 dollars
Output should be:
The program should try to use exact change using 1 nickel instead of 5 pennies for instance.
3) Write a program finding the first 500 prime numbers. You should try to use the least amount of code and remember the limits of how to check for prime numbers..hint square roots.
4) Write an assignment to the next person who responds to this blog. Please be nice and make it simple on the next guy or we wont get the next response!
Skip the ones you cant do, but #4 is a must!