need help with CSC programing

Jinru

Senior member
Feb 6, 2006
671
0
76
I'm desperate at the moment, i've googled and look through my math book but it's not helping. if i'm given the dimensions of a box

L-8
W-7
H-6
wall thickness-1.5

and answer comes out to 290.08 in meters squared, does anyone have an idea what the equation would look like? i tried the 2lw + 2lh + 2wh formula and get 292, so i'm sure the thickness has to be applied, though not sure how. sorry for posting my assignment here, but i'm in a jam and can't continue with the assignment until i get this part down!
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
First think about how you're getting a two-dimensional answer for a three-dimensional box.

Then if that doesn't solve your problem tell us what problem you *are* trying to solve. Saying "the answer comes out to..." Without telling us what the problem is, is pretty useless.
 

Dissipate

Diamond Member
Jan 17, 2004
6,815
0
0
Originally posted by: notfred
First think about how you're getting a two-dimensional answer for a three-dimensional box.

Then if that doesn't solve your problem tell us what problem you *are* trying to solve. Saying "the answer comes out to..." Without telling us what the problem is, is pretty useless.

QFT.

What the heck is the problem?
 

Jinru

Senior member
Feb 6, 2006
671
0
76
oh, sorry about that. heres the given information, the dimensions i provided are based on the Testing part so i could compare those answers with my coding.

Objectives:

* Create a complete program that follows the Input-Processing-Output pattern.
* Practice working with numerical data and performing calculations.
* Develop test cases for a program and confirm that it produces the correct results.

Instructions:

Task: The 'Safety in Bunkers' Construction Company's motto is in the company name. Although there has been little business since the end of the cold war, the owner has never given up! Now, with recent world events, the company is beginning a marketing campaign, and they want to equip each sales agent with a program to help them close a deal. You are going to write a program for this company that computes the cost of a building a concrete bunker designed according to customer specifications!

Specification:

The bunkers under consideration are rectangular in shape and all walls have the same thickness. A bunker has solid walls on all 6 sides (including the top and bottom), with the exception of a single opening that measures 1.2 meter by 1.6 meters (don't forget to consider this in your calculations!). A bunker is completely specified by four pieces of information:

* Overall length in meters (m)
* Overall width (m)
* Overall height (m)
* Wall thickness (m)

Here is the information the quotation needs to provide to the construction manager:

* External volume of the bunker (m3).
* Internal volume of the bunker (does not include the volume inside the opening -- just the volume of rectangular space within the walls of the bunker) (m3).
* Overall external surface area of the bunker (m2).
* Overall internal surface area of the bunker (you can neglect the area of the 'door frame') (m2).
* Total volume of concrete in the bunker (m3).
* Number of truck loads of concrete needed to build the bunker. You can calculate this based on the total volume of concrete in the bunker and the volume of one load. You need to round this number up the the nearest whole truck load! Which method of the Math object always rounds positive numbers up?
* For 1 point EXTRA CREDIT, show the volume of concrete that the last truck will contain, assuming all other trucks are full. Hint: this is a good place to use the % (modulus) operator.
* Total mass of the bunker (kg).
* Labor cost for the bunker (see below), rounded to 2 places after the decimal point.

Here is what you know about this business:

* A single truck load of concrete is 8.5 m3.
* The density of the concrete used is 2500 kg/m3.
* The labor cost is calculated as $90.64 per square meter of surface area, external and internal combined.
* (The dimensions of the opening given above also qualify as 'information you already know'.)

Testing: Test your program to make sure everything works.

* Develop at least 2 test cases, calculate the correct results by hand, then confirm that your program gives the same results. Note that the test data must make sense; for example, the dimensions of the walls must be larger than the fixed size of the opening.
* Document your testing: Add comments at the end of your code describing the test cases you used and the results you obtained. Refer to the 'Boxes' program for a sample.
* To help you confirm that you correctly understand how each of the results is calculated, here is a set of sample data and the correct answers:
o Input data: bunker length 8 m.; bunker width 7 m.; bunker height 6 m.; wall thickness: 1.5 m.
o Results:
+ External volume (cubic m.): 336
+ Internal volume (cubic m.): 60
+ External surface area (square m.): 290.08
+ Internal surface area (square m.): 92.08
+ Volume of concrete (cubic m.): 273.12
+ Truck loads of concrete: 33
+ Volume in last truck (cubic m.): 1.12 [optional, extra credit result]
+ Total mass of concrete (kg): 682800
+ Labor cost: $34638.98
 

MSCoder610

Senior member
Aug 17, 2004
831
0
71
Lol. Scratch what I said then, looks like that has nothing to do with Calculus.
Hint: Find the surface area of the box as you did, =292.

>> with the exception of a single opening that measures 1.2 meter by 1.6 meters
So that needs to be accounted for appropriately.
When reading that, I assume that one side of the bunker has a hole thats 1.2x1.6m, also with a thickness of 1.5m.
1.2mx1.6m = 1.92m^2 = surface area of one side of that space.
That's all that needs to be excluded from the "external surface area". 292-1.92 = 290.08 = given answer.

For the rest of it it should be similar, just account for the hole throughout (which is what you forgot to do before).
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
What's with these CS questions that are really basic algebra questions today?

Don't they have math requirements for CS courses at your school?
 

MrCodeDude

Lifer
Jun 23, 2001
13,674
1
76
Originally posted by: MSCoder610
Lol. Scratch what I said then, looks like that has nothing to do with Calculus.
It's okay, when I first read the question, I was thinking partial derivatives.

 

Dissipate

Diamond Member
Jan 17, 2004
6,815
0
0
This is easy.

It is (2*6*8 + 2*6*7)(the total area of the four walls) + (2*7*8)(the total area of the floor and ceiling) - (1.2*1.6)(the area of the doorway) = 290.08
 

Jinru

Senior member
Feb 6, 2006
671
0
76
thanks for the help, i didnt take into the account the door open could be a problem, clumsy me.
 

Dissipate

Diamond Member
Jan 17, 2004
6,815
0
0
Originally posted by: notfred
What's with these CS questions that are really basic algebra questions today?

Don't they have math requirements for CS courses at your school?

I was wondering the same thing. I wish my programming assignments were this easy.