program with sales_data class

an exercise in my book (c++ primer) say :

rewrite the program at pag 22 using your Sales_data class :
1
2
3
4
5
6
7
  
struct Sales_data {

std::string bookNo; 
unsigned units_sold = 0; 
double revenue = 0.0; 
}


the exercise at page 22 say :
write a program that reads several transaction for the same isbn and
print their sum.....

how would you write this program ?

the input should be something like this
0-201-78345-x 2 10.00 (the book isbn, units_sold, and price per book)
0-201-78345-x 3 15.00

if same isbn print
0-201-78345-x 5 65.00

the problem is that i don't know how to read several transaction ....
help me please.
In other words your problem is not in the exercise that should use the Sales_data, but with an earlier exercise. Even that, I presume, was not the first in the book. Was there anything in the book before page 22 about loops, arrays, containers?
Topic archived. No new replies allowed.