Hello, I'm trying to create a program that makes the user enter a start value, an end value, the amount the value should increase after each loop and some calculations should be printed out to the user.
Example:
User Input:
First price: 10.00
Last Price: 15.00
Amount to add every time: 0.5
Vatpercentage: 10
I think you meant to put i < last ? If first is less than last, the condition you have now will always be true - creating an infinite loop.
cout << setprecision(2) << fixed << i << " " << vat << " " << total << endl;
total isn't getting recalculated in the loop so it will have whatever value it was assigned on line 22. edit: also vat looks like it should be recalculated.
Yes it should me i < last and i should be asigned as a float not an int that was what was causing me the most trouble. I solved it after some deep analyse of the code, thanks for the help though!