Results 1 to 20 of 20
Thread: Dirt Track Volume
 09272012, 06:16 PM #1Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Dirt Track Volume
Below is what I have completed until now but I am doing a test case and not getting the correct volume. If someone could help me out as to what I am doing wrong here it would be great.
Java Code:import java.util.Scanner; public class A1Q4 { /** * Calculate the volume required to cover the track */ public static void main( String[] args ) { // SET UP KEYBOARD INPUT Scanner keyboard = new Scanner( System.in ); // DECLARE VARIABLES/DATA DICTIONARY double rLength = 0; double rWidth = 0; double tWidth = 0; double depth = 0; double clayVolume = 0; // Read in the given values System.out.print ("Please enter the width of the rectangle part of the inner field in meters: "); rWidth = keyboard.nextDouble(); System.out.print ("Please enter the length of the rectangle part of the inner field in meters: "); rLength = keyboard.nextDouble(); System.out.print ("Please enter the width of the track in meters: "); tWidth = keyboard.nextDouble(); System.out.print ("Please enter the desired depth of clay in centimeters: "); depth = keyboard.nextDouble(); // Call method to compute the volume of clay needed. clayVolume = findClayVolume (rLength, rWidth, tWidth, depth); // Diplay the result System.out.println ("\nThe volume of clay needed to cover the track is " + clayVolume + " cubic metres"); } /** * Description: include a description of the problem * solving method (algorithm). * Parameters (GIVENS): */ private static double findClayVolume(double rLength, double rWidth, double tWidth, double depth) { // Declaration of the result variable double clayVolume = 0; // Declaration of the intermediate variables double innerTrackVolume = 0; double wholeTrackVolume = 0; double depthInM = 0; // Add code for the method // Convert the depth in m depthInM = depth/100; // Calculate the inner track volume innerTrackVolume = (rLength*rWidth*depthInM) + (4/3)*(Math.PI*Math.pow((rWidth/2),3)); //*(rWidth/2)*(rWidth/2)); // Calculate the whole track volume wholeTrackVolume = (rLength*(rWidth + 2*tWidth)*depthInM) + (4/3)*(Math.PI*Math.pow(((rWidth + 2 * tWidth)/2),3)); //*((rWidth + 2 * tWidth)/2)*((rWidth + 2 * tWidth)/2)); // Calculate the track volume by subtracting whole track from inner track clayVolume = wholeTrackVolume  innerTrackVolume; // Return the result return clayVolume; } }
 09272012, 07:37 PM #2
Re: Dirt Track Volume
not getting the correct volumeIf you don't understand my response, don't ignore it, ask a question.
 09272012, 07:57 PM #3Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
The console output:
Please enter the width of the rectangle part of the inner field in meters: 300
Please enter the length of the rectangle part of the inner field in meters: 400
Please enter the width of the track in meters: 20
Please enter the desired depth of clay in centimeters: 70
The volume of clay needed to cover the track is 4842969.501221102 cubic metres
What the answer should be:
The volume of clay needed to cover the track is 25274.335088082244 cubic meters
Thanks for helping me out :)
 09272012, 08:05 PM #4
Re: Dirt Track Volume
Where did you get the correct answer?
Can you write formulas for computing the surface area for each section of the track?
If the straight sections were removed and the ends slide together, would the shape be a circle?If you don't understand my response, don't ignore it, ask a question.
 09272012, 08:21 PM #5Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
Yes, if you remove the two straight lines you will get two semicircles which you can combine to form a circle. The formulas were not given, I calculated the area by myself. This is what I did. First, I thought that if I get the volume of the inner track and find the volume of the whole track and do wholeTrackVolume  innerTrackVolume I would get the volume of the track that I want. Below is what I did to find the volume of inner track and whole track.
Inner Track:
To find the volume of the inner track I got the volume of the inner rectangle and added it to the volume of the two inner semicircles. So I know the volume of the rectangle is rLength * rWidth * depthInM (I converted depth from cm to m so all units match). To get the volume of the circle, I did (4/3)(PI*r^3). I added the volume of the rectangle and the volume of the circle to get the volume of the inner track.
Outer track:
I basically did the same thing except the width of the rectangle was rWidth + 2*tWidth. Also, to get the radius of the circle, instead of dividing rWidth by 2, I had to add tWidth*2 + rWidth then divide by two. When I added the two volumes I got the volume of the outer rectangle.
Then, as I said before, I did wholeTrackVolume  innerTrackVolume to get the volume that I need.
Please let me know if something does not make sense, I will try to explain it better.
Thanks
Edit: correct answer was given, I did not calculate it.
 09272012, 08:35 PM #6
Re: Dirt Track Volume
Are you covering the inner area? Or just the track part that is tWidth wide?
Can you write the formulas for each section you are computing the area of? Just the formulas.If you don't understand my response, don't ignore it, ask a question.
 09272012, 08:44 PM #7Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
I want to cover just the track part so yes, the part that is tWidth wide. I am not computing area, I am computer volume.
innerTrackVolume = (rLength*rWidth*depthInM) + (4/3)(PI*((rWidth/2)^3)
wholeTrackVolume = (rLength*(rWidth+2*tWidth)*depthInM) + (4/3)(PI*((rWidth+(2*tWidth))/2)^3)
Let me know if you need me to explain anything.
 09272012, 08:46 PM #8
Re: Dirt Track Volume
Not sure what you are computing.
I see the area as the sum of 2 rectangles and the difference between an outer circle and an inner circle.If you don't understand my response, don't ignore it, ask a question.
 09272012, 08:53 PM #9Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
Oh, I just understood what you said. Let me try it out and ill see what happens. Thanks for your help :)
 09272012, 09:06 PM #10Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
Java Code:rectangleTrack = (rLength*tWidth*depthInM)*2; circleTrack = (4/3)*(Math.PI*Math.pow(((rWidth + (2 * tWidth))/2),3))  (Math.PI*Math.pow((rWidth/2),3)); clayVolume = circleTrack + rectangleTrack;
 09272012, 09:29 PM #11
Re: Dirt Track Volume
What is the equation for the area of a circle?
If you don't understand my response, don't ignore it, ask a question.
 09272012, 09:57 PM #12Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
 09272012, 10:05 PM #13
Re: Dirt Track Volume
What shape are you calculating the volume of?
volume of a circleIf you don't understand my response, don't ignore it, ask a question.
 09272012, 10:56 PM #14Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
 09272012, 11:07 PM #15
Re: Dirt Track Volume
I am calculating the volume of the sphere
Have you ever seen or been to a race track? They are basically two dimensional. I've never seen one that looks like a sphere. Maybe for some kind of motorcycle sport.If you don't understand my response, don't ignore it, ask a question.
 09272012, 11:10 PM #16Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
 09272012, 11:15 PM #17Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Re: Dirt Track Volume
So this is what I did:
Java Code:circleTrack = (Math.PI*Math.pow(((rWidth + (2 * tWidth))/2),2))  (Math.PI*Math.pow((rWidth/2),2));
That is sort of closer to the expected result but still there is something wrong. Let me know if you find anything else. Thanks for your help.
 09302012, 03:05 AM #18Member
 Join Date
 Sep 2012
 Posts
 1
 Rep Power
 0
Re: Dirt Track Volume
you are meant to calculate the area of a cylinder..... like you use Pi * (r)^2 * h to find the volume of the semicircle... if you have any more problems i'll check back.
 09302012, 03:15 AM #19
Re: Dirt Track Volume
@v1ru5
Break the large expression up into a list of small simple steps that do one thing at a time. Putting it all into ONE expression is both hard to read and understand and makes it harder to debug.
With that technique ( 7 steps) I got: vol=25274.335088082265If you don't understand my response, don't ignore it, ask a question.
 09302012, 03:21 AM #20Member
 Join Date
 Sep 2012
 Posts
 20
 Rep Power
 0
Similar Threads

Area and Volume help
By gioeco in forum New To JavaReplies: 10Last Post: 05132012, 05:02 AM 
Control volume
By calippus in forum New To JavaReplies: 0Last Post: 10312011, 03:17 PM 
Volume of Intersection
By afifi in forum Advanced JavaReplies: 0Last Post: 01072011, 11:42 AM 
Volume of AudioClip
By Fedor in forum New To JavaReplies: 0Last Post: 04252009, 05:16 PM 
Track download
By nilesh.malode in forum Advanced JavaReplies: 1Last Post: 07132007, 10:44 PM
Bookmarks