Computer Science Canada Function program |
Author: | stef_ios [ Sat Mar 08, 2008 2:45 pm ] | ||
Post subject: | Function program | ||
Hey! So i'm writing a program that does the following: Consider the building of an airport with the runway being built on landfill. The contractor has two dump trucks, one with a capacity of 8 tons and the other with a capacity of 12 tons. The contractor uses the trucks to haul fill from a remote site to the airport location. The operating cost per trip for the 8 and 12 ton trucks is $14.57 and $16.26, respectively. One truck cannot make more than 60 percent of the total trips. Prompt the user to enter the total number of tons. Display the number of trips required for each truck and the total cost. Use a modular design for this program. So I've done just a basic program for starters, but the calculations I don't think are working properly, can someone tell me why?
|
Author: | A.J [ Sat Mar 08, 2008 3:05 pm ] |
Post subject: | Re: Function program |
remember that the trucks go up and down so you have to multiply the cost by 2 (since I think you forgot to add that to your program). Make sure that u also minimize the cost by making truck 1 take x% and truck 2 take y%. When truck 1 always takes 60%, it doesn't necessarily minimize the total cost. Try writing equations, and if u need more help, I'll be glad to help u. But overall, it looks nice |
Author: | stef_ios [ Sat Mar 08, 2008 6:17 pm ] |
Post subject: | Re: Function program |
Thanks! I'll work on it some more! |
Author: | A.J [ Sat Mar 08, 2008 9:00 pm ] |
Post subject: | Re: Function program |
your welcome |
Author: | md [ Sat Mar 08, 2008 10:22 pm ] |
Post subject: | RE:Function program |
Unless of course the cost per round trip is $14 and $16 (or whatever numbers were given). Also, though your problem statement says that is must be modular your code is pretty hard coded. |
Author: | A.J [ Mon Mar 10, 2008 5:55 pm ] |
Post subject: | Re: Function program |
so, how are you finding it stef_ios! do you need help with this optimization, or are you done with this question? A.J |