1---
2app_version: 0.1.0
3precision: 2
4form_title: Paint and flooring for one room
5form_description: How much paint and how much flooring to buy for one room — walls minus door and window, two coats, offcuts at the edges included.
6form_inputs: Room length|length{m}, Room width|width{m}, Wall height|height{m}, Door and windows|openings{m²}, Coats|coats, Coverage per litre|coverage{m²/L}, Paint price|paint_price{€/L}, Flooring price|floor_price{€/m²}
7form_outputs: Wall area|walls, Paint needed|paint, Tins of 2.5 L|tins, Flooring to buy|flooring, Paint cost|paint_cost, Flooring cost|floor_cost, Total|total_cost
8---
9# Paint and flooring for one room
10// The units do the checking: m² divided by m²/L comes out in litres, and a
11// slip like adding metres to square metres shows up as an error right away.
12// This notebook also has a FORM (Pro): Form → Form view for an input mask.
13
14# The room
15length = 4.6 m
16width = 3.8 m
17height = 2.5 m
18openings = 2 m² + 1.6 m² // door + window, not painted
19
20# Walls
21walls = 2 * (length + width) * height - openings
22coats = 2
23coverage = 8 m²/L // printed on the tin
24paint = walls * coats / coverage
25tins = ceil(paint / 2.5 L)
26paint_price = 6.50 €/L
27
28# Floor
29area = length * width
30waste = 10% // offcuts along the walls
31flooring = area * (1 + waste)
32floor_price = 24 €/m²
33
34# Shopping list
35paint_cost = tins * 2.5 L * paint_price
36floor_cost = flooring * floor_price
37total_cost = paint_cost + floor_cost
38"Paint needed": paint
39"Tins of 2.5 L": tins
40"Flooring to buy": flooring
41"Total": total_cost
42