I have this in main:
Product newProduct;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
newProduct.display();
in Product.cpp I have:
cout << "$" << basePrice << " - "
<< name << " - " << cout.precision(1) << weight << " lbs\n";
but changing the precision to (1) in the .cpp changes the basePrice to (1) as well. How do I change the precision on different variables in the same cout? is there a way? or do I just place them in different cout's? Would that even work? why or why not?
Update when I try the second cout it is adding the number 2 to the end of my name variable. In other words I ended the first cout after the name variable. It is working but adds the number 2 to the end.