Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
float area(const struct Room *room) {
return room->length * room->width;
}
float price(const struct Carpet *carpet, float area) {
if(carpet->roundUp){
area = ceil(area);
}
return area * carpet->pricePerSqrMetre;
}
float quote(struct Room *room, struct Carpet *carpet){
return price(carpet, area(room));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment