Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 26, 2019 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/1f72094c4003513a67d3cc7cfcb7df7a to your computer and use it in GitHub Desktop.
Save jasongorman/1f72094c4003513a67d3cc7cfcb7df7a to your computer and use it in GitHub Desktop.
int main() {
Carpet* carpet = new_carpet(10.0, false);
Room* rectangular_room = new_rectangular_room(2.5, 2.5);
float total = quote(rectangular_room, &rectangular_area , carpet);
printf("Price of rectangular carpet 2.5m x 2.5m at 10.0 p/sqm with no rounding up is %g\n", total);
Room* circular_room = new_circular_room(2.5);
total = quote(circular_room, &circular_area, carpet);
printf("Price of circular carpet of radius 2.5m at 10.0 p/sqm with no rounding up is %g\n", total);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment