i would like it so that the first time the person goes thru the loops, it enters the input number to item1, the second time to item2, the third time to item3... and so on. any ideas how to do this?
Here is the code
Code:#include <iostream> #include <iomanip> using namespace std; main() { const float SALESTAX = .0825; float totalprice; float totalpricewithouttax; float item1; float item2; float item3; float item4; float item5; string morethingstosell; cout<<"Do you have an item you would like to sell? "; cin>> morethingstosell; for (int i = 0;i < morethingstosell.length(); i++) { morethingstosell[i] = toupper (morethingstosell[i]); } while (morethingstosell == "YES") { cout<<"Enter the price of an item: "; cin>>item1; cin>>item2; cin>>item3; cin>>item4; cin>>item5; cout<<"Do you have more items being sold? "; for (int i = 0;i < morethingstosell.length(); i++) { morethingstosell[i] = toupper (morethingstosell[i]); cout<<"Do you have more items being sold? "; } } }