Q:

A more interesting example adds two Sales_item objects

0

A more interesting example adds two Sales_item objects.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item item1, item2;
std::cin >> item1 >> item2; // read a pair of transactions
std::cout << item1 + item2 << std::endl; // print their sum
return 0;
}

 

Output:

0-201-78345-X 3 20.00
0-201-78345-X 2 25.00
0-201-78345-X 5 110 22

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now