Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 06-11-2004, 10:05 AM   #1
Member (5 bit)
 
Join Date: Aug 2002
Posts: 24
Java Help please

Hi

Well I have another Java question

I have to write some code that will calculate the shipping cost. here is the problem


A binder weighs 1 pound 5 ounces, An empty shipping carton weighs 1 pound 9 ounces and can hold up to 12 binders. The shipping costs include $1.44 for each full or partial carton plus $0.96 per pound or fraction of a pound( so anything even .1 over a lb is another 96 cents) plus a $3.00 service charge. ( only charged once)

I have this

private double calculateCost(int binders)
{
double cartons, pound, shipping;

now I have to start calculating, kinda lost. Any thoughts thanks?
Thonger is offline   Reply With Quote
Old 06-11-2004, 10:20 AM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
That's not a Java problem, that's a math problem.

You need to find an algorithm to calculate the cost. What I would suggest is to sit down and think about the relevant questions: How would you calculate how many full cartons you need for X amount of binders? How would you calculate the weight of the binders? What do you do with the leftovers?

Once you figure these things out and have a good mathematical answer, putting it into Java will be very simple.
doctorgonzo is offline   Reply With Quote
Old 06-11-2004, 02:45 PM   #3
Member (9 bit)
 
ceh4702's Avatar
 
Join Date: Jul 2003
Posts: 288
What about packing material?

It might be best to develop some standards. You may want to have alternate shipping containers instead of one size fits all. For instance you could ship a single binder in a Fed Express Bag. A set fee for shipping one item may be a better way of handling this. If you ship enough items, you may get to a point where the cost to ship one item is so minimal that it could have a reduced price or be free. Also there are different ways to ship like 2nd day air, and shipping saver fares with a 5-10 day delivery.
ceh4702 is offline   Reply With Quote
Old 06-11-2004, 02:50 PM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Quote:
Originally posted by ceh4702
What about packing material?

It might be best to develop some standards. You may want to have alternate shipping containers instead of one size fits all. For instance you could ship a single binder in a Fed Express Bag. A set fee for shipping one item may be a better way of handling this. If you ship enough items, you may get to a point where the cost to ship one item is so minimal that it could have a reduced price or be free. Also there are different ways to ship like 2nd day air, and shipping saver fares with a 5-10 day delivery.
It sounds like Thonger is looking for help on a homework problem, not looking for real-life help.
doctorgonzo is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:47 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2