diff options
Diffstat (limited to '1p5p2-example.cpp')
-rw-r--r-- | 1p5p2-example.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/1p5p2-example.cpp b/1p5p2-example.cpp new file mode 100644 index 0000000..53ed4bc --- /dev/null +++ b/1p5p2-example.cpp @@ -0,0 +1,25 @@ +#include <iostream> +#include "sales_item.hpp" + +/* + * + * 1.5.2 example + * + * + */ + +int main() { + + Sales_item item1, item2; + std::cin >> item1 >> item2; + if (item1.isbn() == item2.isbn()) { + std::cout << item1 + item2 << std::endl; + return 0; + } else { + std::cerr << "Data must refer to same ISBN" + << std::endl; + return -1; + } + + return 0; +} |