Skip to content

Instantly share code, notes, and snippets.

@MosheBerman
Created December 3, 2012 04:28
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 MosheBerman/4192698 to your computer and use it in GitHub Desktop.
Save MosheBerman/4192698 to your computer and use it in GitHub Desktop.
Output
Stocking 150 at $1 each.
Stocking 130 at $2 each.
0 items sold.
Total Sales: $0
remainder 145 Widgets unavailable.
Stocking 50 at $2.5 each.
0 items sold.
Total Sales: $0
remainder 75 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 180 Widgets unavailable.
Stocking 50 at $4 each.
Stocking 30 at $5 each.
Stocking 40 at $5.5 each.
The next two customers will receive a 30% discount.
0 items sold.
Total Sales: $0
remainder 50 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 30 Widgets unavailable.
Stocking 50 at $6 each.
Stocking 265 at $10 each.
0 items sold.
Total Sales: $0
remainder 60 Widgets unavailable.
The next two customers will receive a 50% discount.
0 items sold.
Total Sales: $0
remainder 100 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 70 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 175 Widgets unavailable.
Stocking 40 at $14 each.
Stocking 75 at $15 each.
0 items sold.
Total Sales: $0
remainder 110 Widgets unavailable.
Stocking 30 at $16 each.
Stocking 40 at $18 each.
Overstock:
2 remain at 50
Stocking 150 at $1 each.
Stocking 130 at $2 each.
(lldb) c
Process 6212 resuming
(lldb) p sales
(std::__1::vector<Sale, std::__1::allocator<Sale> > &) $0 = size=2: {
(Sale) [0] = {
(int) quantity = 0
(double) pricePerUnit = 0
}
(Sale) [1] = {
(int) quantity = 0
(double) pricePerUnit = 0
}
}
(lldb) c
Process 6212 resuming
(lldb) c
Process 6212 resuming
0 items sold.
Sold 0 at $0 each.
Sold 0 at $0 each.
Total Sales: $0
remainder 145 Widgets unavailable.
Stocking 50 at $2.5 each.
0 items sold.
Total Sales: $0
remainder 75 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 180 Widgets unavailable.
Stocking 50 at $4 each.
Stocking 30 at $5 each.
Stocking 40 at $5.5 each.
The next two customers will receive a 30% discount.
0 items sold.
Total Sales: $0
remainder 50 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 30 Widgets unavailable.
Stocking 50 at $6 each.
Stocking 265 at $10 each.
0 items sold.
Total Sales: $0
remainder 60 Widgets unavailable.
The next two customers will receive a 50% discount.
0 items sold.
Total Sales: $0
remainder 100 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 70 Widgets unavailable.
0 items sold.
Total Sales: $0
remainder 175 Widgets unavailable.
Stocking 40 at $14 each.
Stocking 75 at $15 each.
0 items sold.
Total Sales: $0
remainder 110 Widgets unavailable.
Stocking 30 at $16 each.
Stocking 40 at $18 each.
Overstock:
2 remain at 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment