Click to See Complete Forum and Search --> : Can Anyone help Me, PLS!


Arj
January 24th, 2003, 12:16 AM
The program requires to build several classes which will put several items with different weights into the MINIMUM number of boxes. Each item will have 2 data - an identifier and a weight, W (0<W<=1£©.

You are required to implement TWO (2) related strategies, and to compare the number of boxes used by each strategy for given set of items.

Strategy 1:
Arrange items into boxes.
E.g. weights 0.4, 0.4, 0.6, 0.6 --> 2 boxes

Strategy 2:
Sort the items into decreasing order by weight first, then use Strategy 1.

CLASSES GIVEN:
--------------
BinaryHeap.java
PriorityQueue.java
UnderFlowException.java

CLASSES NEED TO BUILD:
--------------------------
1. Item class
- a constructor of Item containing an integer identifier and a double weight
- this constructor only allows weight W (0<W<=1)
- throw an exception if constructor passes a bad weight (e.g. W>1 or W<0)
- methods to return items identifier and weight
- a toString method to return a left bracket, identifier, a comma, a space, a weight and
a right bracket (e.g. "(2, 0.359)")
2. Box class
- start counting at 1.0
- list of item object in the box
- a method to return the weight can be added, already added, number of items in the box,
the i-th item in the box (throw exception if i is invalid), list of all items in the box
- toString method contains weight available, weight of items in box, number of items in the
box, list of items in the box
- implement this class with Comparable interface - compare two boxes, compare the weight of
items to pack into boxes, and should return the list of packed boxes
3. Strategy class
- contains Strategy 1 method and Strategy 2 method
- first implement Strategy 1, then implement Strategy 2
- each method accept only a parameter of list of items to pack into boxes and return the
list of packed boxes
4. Test class
- contains the main method
- opens a text file containing a single line with a list of items weights
(i.e. 0.3, 0.249, 0.95, 0.34, 0.21, 0.13, 0.79, 0.2, 0.86)
- creates a list of items
- calls each methods for Strategy 1 and 2
- prints out the resulting list of boxes of each call

SOS~Can anyone help me to finish this program? Thanks a lot!

Timo Hahn
January 24th, 2003, 12:59 AM
Come on!
We are glad to help, but we don't do your homework!
What do you think you'll learn if we are doing your work?
So. you should at least try to do it yourself. If you are running into problems, you are welcome to ask questions here.


Timo

Arj
January 24th, 2003, 01:22 AM
I'm the beginner of the Java , actuality it's quite hard for me. The due day it's tomorrow, so i'm very worried about it.

I also want to improve my programme skill,thanks.

Arj
January 24th, 2003, 01:25 AM
Can U help me this time?

abramia
January 24th, 2003, 03:05 AM
Arj,
Have you tried these web-sites:

http://www.hotdispatch.com

http://www.helpshare.com

http://www.experts-exchange.com

Good Luck,
Avi.

Arj
January 24th, 2003, 05:32 AM
Thanks,abramia
I've tried, but still no get any reply yet

Goodz13
January 24th, 2003, 10:47 AM
I'm the beginner of the Java , actuality it's quite hard for me. The due day it's tomorrow, so i'm very worried about it.

I also want to improve my programme skill,thanks.

How are you going to improve your skills if someone else does it for you?

If you have a specific question, we'd be glad to help. I suggest doing a search on google for some good tutorials.

Arj
January 25th, 2003, 02:39 AM
I'm taking two subjects in the summer semester, and it must be finished within one and half month. Our lecturers gives us quite a lot of assignments to do, i don't have enough time to finish all, so I come to ask for help.

dlorde
January 25th, 2003, 10:28 AM
Arj: If you want to get your project done, you'd better start doing it. Ask as many sensible questions as you like, but bear in mind we aren't a free coding service and we're not a substitute for reading the Java docs.

There's no cure for birth and death save to enjoy the interval