I'm a new java programmer. I have an assignement due next week, but i really don't know how to do it! Can anyone give me some clue?
The question is here: http://www.csd.uwo.ca/courses/CS027b...nts/index.html
Printable View
I'm a new java programmer. I have an assignement due next week, but i really don't know how to do it! Can anyone give me some clue?
The question is here: http://www.csd.uwo.ca/courses/CS027b...nts/index.html
hm... so Western have CS programs???
------------------
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA1season GP:9 G:12 A:8 Pts:20 GWG:3 +/-:-3
uwcdc.com or namgor.com
YES!! So can you help me out?
Quote:
Originally posted by namgor:
hm... so Western have CS programs???
------------------
CPU: Intel PIII-800 @ 930,
Motherboard: Asus CUSL2-C,
RAM: Mushkin 2 x 128MB Cas2 v3.0,
Hard Drive: 2 x 30GB ATA/100 7200rpm,
DVD: Pioneer 16x Slot IDE,
CDRW: Yamaha 8x8x24 CD-Rewriter IDE,
Video Card: Asus Geforce2 GTS 32MB DDR Pure,
TV Card: ATI TV Wonder,
Sound Card: SoundBlaster Live! Platinum 5.1,
Networking: 2 x Linksys 10/100Mbps Ethernet Adapters,
Fan: Thermaltake Golden Orb FC-PGA,
Case: ATX Mid Tower 9301K 300W,
Keyboard: Microsoft Internet Keyboard Pro,
Mouse: Microsoft Intellieye Optical,
Monitor: Sony 19" E400 Trinitron,
Speaker: SoundWorks DeskTop Theater 5.1 DTT3500 Digital,
OS: Microsoft Windows ME and 2000 Pro.,
Others: Promise ATA-100 Controller Card and 2 Extra Fans,
Plus, an Asus M8300 Laptop with PIII-600, 192MB RAM, 12GB HD...
-----------------------
This is just as fast as bullet! Haha...
alright, better stay away from Western! https://www.sharkyforums.com/images/.../2005/06/5.gif
Hints: ask your friends , not us !
------------------
DHAHL3seasons GP:73 G:121 A:55 Pts:176 GWG:12 +/-:184
UWSWA1season GP:9 G:12 A:8 Pts:20 GWG:3 +/-:-3
uwcdc.com or namgor.com
Here's a hint: read your textbook. I don't know Java, but here's basically what I'd do in C++:
I guess this would be my main class. It's constructor would initialize how many of each piece it is supposed to have. Oh yeah, each piece might be a structure or another class.Quote:
(1) Make a BagOfScrabbleTiles
Not sure what method you were supposed to have written, but I'm guessing that the letter and its value are two members of each tile object, and toString changes it to a string like the ones they have (eg, "[A_1]").Quote:
(2) Print the bag (use the toString method that you have written.)
Ok, I guess I should read the instructions to find out what is inheritting what...no! That's YOUR job https://www.sharkyforums.com/images/.../2005/06/5.gif I'll let you handle that one.Quote:
(3) Take a tile from this bag (using an inherited method.)
I'm guessing print just prints the string that I mentioned above. Print just creates a string using toString, and then displays it with whatever IO Java has.Quote:
(4) 'Print' this tile (using the toString method of the ScrabbleTile class)
Just take one tile 74 times in a loop, I'm guessing.Quote:
(5) Take another 74 tiles from the bag (don't do anything with them.)
Just another loop, except you print tiles instead of taking them off of the pile.Quote:
(6) Print the bag again (use the toString method that you have written.)
Now that wasn't that hard, was it? https://www.sharkyforums.com/images/.../2005/06/5.gif
Here's a hint: read your textbook. I don't know Java, but here's basically what I'd do in C++:
I guess this would be my main class. It's constructor would initialize how many of each piece it is supposed to have. Oh yeah, each piece might be a structure or another class.Quote:
(1) Make a BagOfScrabbleTiles
Not sure what method you were supposed to have written, but I'm guessing that the letter and its value are two members of each tile object, and toString changes it to a string like the ones they have (eg, "[A_1]").Quote:
(2) Print the bag (use the toString method that you have written.)
Ok, I guess I should read the instructions to find out what is inheritting what...no! That's YOUR job https://www.sharkyforums.com/images/.../2005/06/5.gif I'll let you handle that one.Quote:
(3) Take a tile from this bag (using an inherited method.)
I'm guessing print just prints the string that I mentioned above. Print just creates a string using toString, and then displays it with whatever IO Java has.Quote:
(4) 'Print' this tile (using the toString method of the ScrabbleTile class)
Just take one tile 74 times in a loop, I'm guessing.Quote:
(5) Take another 74 tiles from the bag (don't do anything with them.)
Just another loop, except you print tiles instead of taking them off of the pile.Quote:
(6) Print the bag again (use the toString method that you have written.)
Now that wasn't that hard, was it? https://www.sharkyforums.com/images/.../2005/06/5.gif
Originaly due today, now wednesday. Been parting too much have we now!
------------------
Blueskies Blackdeath
Wow, how'd that get printed twice, with over half-an-hour in between? And considering that I went to bed at 10:30 https://www.sharkyforums.com/images/.../2005/06/5.gif
Gremlin!
Quote:
Originally posted by Zoma:
Wow, how'd that get printed twice, with over half-an-hour in between? And considering that I went to bed at 10:30 https://www.sharkyforums.com/images/.../2005/06/5.gif
------------------
Blueskies Blackdeath