cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
program with sales_data class
program with sales_data class
Aug 8, 2014 at 3:49pm UTC
pieroborrelli
(62)
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.
Aug 8, 2014 at 10:04pm UTC
keskiverto
(10402)
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.