The scenario:
A bricklayer wants an app on his phone that calculates quotes for brick retaining walls. Plan (pseudo code), research and code (including //comments where appropriate), test and evaluate).
50 bricks per square metre
Bricks cost $435 per 1000
Brickie charges $1050 per $1000 to lay.


I was wondering if their was a quicker better way to code this using (for loops, arrays) idk what you could use but this code I wrote looks ugly basic and primitive
Thanks!


PHP Code:
(y being number of sq metres to lay)

50 number of bricks needed (a)

435 1000 cost per brick (b)

cost of bricks (c)

(
1000) * 1050 labor cost (d)

total cost

of course what you want to 
do with remaindersetcis something you should think about 


2. 
(y being height in metres of subject





PHP Code:
<!DOCTYPE html>
<
html>
<
head>
<
titleScenario 2 </title>
</
head>
<
body>
<
script>
var 
userLength  prompt("What is the length (m) of the area");
var 
userWidth prompt("What is the width (m) of the area")
var 
userLength  userWidth
document
.write("the total square metres of bricks are " y);
var 
bricksNeeded 50
document
.write("The total amount of brick needed is " bricksNeeded);
var 
costEachBrick 435/1000
document
.write("The cost of one brick is $" costEachBrick);
var 
totalCostBricks bricksNeeded*costEachBrick
document
.write("The total cost of all the bricks are $" totalCostBricks);
var 
laborCost = (totalCostBricks 1000 ) * 1050
document
.write("The cost to hire labor workers is $" laborCost);
var 
totalCost totalCostBricks laborCost
document
.write("Your total cost (including labor and bricks expense) is $" totalCost);
var 
charge 1050/1000
document
.write("The cost per brick for customer is $" +charge );
var 
totalCharge bricksNeeded charge
document
.write("The total to charge the customer is $" totalCharge );
var 
profit totalCharge totalCost
document
.write("the profit/loss you make from this sale is $" profit);
</script>
</body>
</html>