Created
March 25, 2019 08:11
-
-
Save jasongorman/976a54a666e6bcec68553c13967794e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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