forked from Mooophy/Cpp-Primer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a logic error in ex15.7
- Loading branch information
Hao Zhixiang
committed
Jun 1, 2015
1 parent
885b319
commit d40ae9f
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#include "limit_quote.h" | ||
|
||
|
||
double Limit_quote::net_price(std::size_t n) const | ||
{ | ||
if (n > max_qty) | ||
return max_qty * price * discount + (n - max_qty) * price; | ||
else | ||
return n * discount *price; | ||
} |
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