Guest User

Untitled

a guest
Apr 24th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. //define the variable inputs
  2.  
  3. $profit= 1.20;
  4. $tonprice= 0.01;
  5. $mm1= 63;
  6. $mm2= 20;
  7.  
  8.  
  9. //start calculating the box price based on the algorythm
  10.  
  11. $a= (2*$length)+(2*$width)+$mm1; $b= (1*$width)+(1*$debth)+$mm2;
  12. $m2= ($a * $b)/1000;
  13. $gramweight= ($m2*479)/1000;
  14. $price= ($gramweight*$tonprice);
  15. $customertotal= ($price*$profit);
  16.  
  17. //calculate the output for the customertotal which is the price plus our profit
  18.  
  19. {
  20. echo "Based on your box size each box will cost - ";
  21.  
  22. //display the price to the customer in Rands rounded up to 2 decimal points
  23.  
  24. echo "R" . number_format($customertotal, 2). "\n";
  25. }
Add Comment
Please, Sign In to add comment