•

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Blog Entries

• phi

I love this community !

• JackJames

hi i am jack i am seo expert jack james would love you to read new post

Php Special Calculator

Special Multiple Calculations calculator

#1 soundkilla

soundkilla

CC Lurker

• Just Joined
• 2 posts

Posted 05 April 2012 - 01:43 PM

Good Day,

I need a calculator in php. I know what I want but just can't seem to put everything together.

The purpose of the calculator is to enable visitors to calculate know how much lumber of a given dimension can be obtained from a 'log'.

The equations to obtain this is as follows:

1. ((Girth ft. x Girth ft.) x length ft.) x 0.5 = 'Log Square Feet'

2. (Lumber Height (inches) x Lumber Width (inches) x Lumber Length (Feet) = 'Lumber Square feet'

3. 'Log Square Feet' / 'Lumber Square feet' = Qty of Lumber from log

> I want users to input the 'Girth' once and length of the log in two seperate text boxes
> Then they must enter the dimension of the lumber in three seperate text boxes. 'Height' x 'Width' x 'Length'.
>The user will click a button and the answer will display. eg. ("25 Pieces")

How can I do that?

Any help rendered will be greatly appreciated.
• 0

#2 Orjan

Orjan

CC Mentor

• Moderator
• 2918 posts
• Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
• Learning:Java, C#

Posted 06 April 2012 - 08:57 AM

The tricky part of this is that you can't do a pure mathematical calculation, as you can't use the full log volume, as you will have waste etc.
First, do the mathematics on paper and try to calculate it. If the girth is smaller than the width, then you can't have any boards at all etc. All these conditions, you need to specify. Then you have to take in count that it's a circle etc, so you know how to optimize the area. Another thing is that you have a little waste from the sawblade that might be important. When you got the formula and all of its conditions, we can help you better!
• 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.

Also tagged with one or more of these keywords: Special, Multiple Calculations, calculator

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download