I have a Sale object that has a Vector in it.
That Vector contains Line objects.
Each line object has a line number, an Item object, a quantity, and a subtotal.
My problem is that I can't figure out how to calculate the Total Price for the Sale.
I have a method that walks through the Vector and prints out the toString of each Line object, and I think it would be something similar to that, but I'm not sure. (Attached is the code for this.)
I would think all you have to do is go to each Line object in the Vector and ask it what it's subtotal is, then do a += to totalPrice or something.
Do you know the syntax/code for this?
That Vector contains Line objects.
Each line object has a line number, an Item object, a quantity, and a subtotal.
My problem is that I can't figure out how to calculate the Total Price for the Sale.
I have a method that walks through the Vector and prints out the toString of each Line object, and I think it would be something similar to that, but I'm not sure. (Attached is the code for this.)
I would think all you have to do is go to each Line object in the Vector and ask it what it's subtotal is, then do a += to totalPrice or something.
Do you know the syntax/code for this?
