im trying to help a friend with some coursework, but i dont know where to begin, im familiar with principles of programming did 1 yr of c++ but never got *into* it. he has to "Write a program that will read a single number as a command line argument, and display this as a graphical thermometer" where do we begin, how much effort would we need to exert, alot a little, is it piss easy any similar source code out there? any helpful super skilld individuals out there with a spare 5 mins thnx alot for any replies.
I'm not doing it for you, but here's a couple of hints. your main method has the arguments (public static void main(String args[])) so the first value in the args array will be the number passed to you. To turn that into an int use Integer.parseInt (don't forget to catch the exceptions). As for the graphical bit, create a new Frame (if using AWT, JFrame if using Swing), and add your thermometer to that.
not going to give you any code because I dont have THAT much time. but sure I can lay it out. Set up two arrays of 10 Strings to be your "mercury", and a label set up your command input run your recieved string through a var conversion method (just to an int probobly) and make sure you put it in try blocks (to catch invalid string content) round out the number to the nearest 10 youl have to invert your results as your writing from the top of the display. but then just print your scale marker followed by a "mercury" if necesary.
hes asking for basic java help and array manipulation. its not like this is something special. "java tutorial" would probobly get you all you need to know
i always found that www.mindprod.com had some great java resources. that and the SUN javadoc and you're golden.