[CSC 204] You already have the tools...

Andrew J. Pounds pounds_aj at mercer.edu
Sun Sep 28 07:57:05 EDT 2014


Students -- I got a few questions overnight from folks having problems 
with their ShippingCube.java classes.  When I went to look at the code I 
noticed that the students were trying to do several things that we have 
not yet covered in class (or that are not in chapters 1-4 of the text).  
For example, I saw code with "if" statements, loops, exception clauses 
-- lots of things that we will see later but that we have not seen yet.  
Did I mention that none of these programs were running properly...

I know that there are several of you in the class that already know a 
lot of Java.  Some of you have personally demonstrated to me your skill 
at using the Java language.  That's great -- but java is just the tool 
we use to solve the problems and there is a time to use appropriate 
techniques with the tool.  It would be silly for me to try and crack a 
walnut with an anvil and a sledgehammer.  Sure - it will work - but I 
guarantee you that it is going to make a mess and I probably won't get 
to enjoy what remains. A much more efficient - and elegant method - 
would be to use a pair of pliers or, if I had one, a nutcracker.

This class is as much about learning how to solve problems using the 
proper tools as it is about leaning the Java language.   Based on what I 
am seeing, some  of you that have programmed before are big on language 
features but weak on algorithm design and problem solving.  When you 
can't figure out a clean solution to a problem (like the one we did in 
class to get change) you start running to more advanced language 
features.   Since we won't start covering booleans and if statements 
until this week, and haven't even thought about loops, I would be a 
pretty sick individual to expect you to use those techniques to solve 
the problems associated with the programming assignment due Wednesday.

That being said, we have talked a lot about mathematical operations, 
using  the Math class and the Math API.  EVERYTHING in this programming 
assignment can be accomplished using the things discussed in chapters 
1-4 of your text.

Last thing -- as you work on each method think about what you need and 
how you can get that information from the instance variables. For 
example, how can you get the length of the shipping cube side from the 
number of balls and the ball diameter.  You might have to sit down with 
a pencil, a piece of paper, and a calculator to figure that one out. It 
doesn't require loops, but it will require you to use methods from the 
Math class - so you might want to have the web page of the Java 8 Math 
API open.

Keep the questions coming...

-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc204/attachments/20140928/172fb008/attachment.html>


More information about the csc204 mailing list