:-|Hi all,
I'm new to programming and I've been learning on my own. I seem to be writing way too much code for simple exercises. I just finished one where all they wanted was to convert your change into a total dollar amount. I went ahead and created a method for each coin. For instance, quarterToDollar(), dimeToDollar() etc. When I looked up the answer they did it all in one line of code
dollars = (0.25 * quarters) + (0.10 * dimes)
+ (0.05 * nickles) + (0.01 * pennies);
Does every new programmer run into this or am I making things harder than they have to be?