This is very off topic but I was hoping some people here will know more than I do about this.
I need to hand in a c++ program by midnight and im just missing one thing....
The program has to be able to read a data from another file "books.dat" and output the number of orders and the total, subtotal, tax,discount and shipping for each order. I was able to output 4 of the order "templates" but it seems like it wont read the data.
Example of "books.dat":
5 S
2.9912.45 13.23 21.99 24.59
1 E
34.95
3 5
8.99 12.45 7.58
The first number in the first line is the number of books
the letter in the first line is the shipping method
the third set is the price for the number of books
ex:
(# of books) (shipping method)
(price of book)(price of book)
I need to read the first line as two different variables and the second line as a separate variable
What I have is
fp>> books >> shipping;
for(int i=1; i<= books; i++)
{
fp>>prices;
sum+=prices;
}
I was hoping someone can help me out. Really appreciate it.
Bookmarks