Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //define the variable inputs
- $profit= 1.20;
- $tonprice= 0.01;
- $mm1= 63;
- $mm2= 20;
- //start calculating the box price based on the algorythm
- $a= (2*$length)+(2*$width)+$mm1; $b= (1*$width)+(1*$debth)+$mm2;
- $m2= ($a * $b)/1000;
- $gramweight= ($m2*479)/1000;
- $price= ($gramweight*$tonprice);
- $customertotal= ($price*$profit);
- //calculate the output for the customertotal which is the price plus our profit
- {
- echo "Based on your box size each box will cost - ";
- //display the price to the customer in Rands rounded up to 2 decimal points
- echo "R" . number_format($customertotal, 2). "\n";
- }
Add Comment
Please, Sign In to add comment