# Thread: Need help with a basic while loop program

1. ## Need help with a basic while loop program

So here is the problem.

Provide a C++ solution for problem 1 from the end of chapter 7 using a while loop. When you include the output at the end of your program, be sure to demonstrate having tested all paths in your code.

The Last Stop Boutique is having a five-day sale. Each day, starting on Monday, the price will drop 10% of the previous day’s price. For example, if the original price of a product is \$20.00, the sale price on Monday would be \$18.00 (10% less than the original price). On Tuesday the sale price would be \$16.20 (10% less than Monday) and so on. Develop a solution that will calculate the price of an item for each of the five days, given the original price. Test the solution for an item costing \$10.00

Also,

Turn in a Flow Chart or Algorithm, an IPO and a Data Dictionary for this program.

here is what I have so far.

Code:
```#include <iostream>
using namespace::std;
int main() {
int counter = 1;
int n = 5;
int Price = 0;
int Sum;
int Discount = 0.1;
{
cout << "Enter The Original Price: "; cin >> Price;
}

while (counter <= n)
{
Price = Price - (Price * Discount);
}
return 0;
}```
What am I doing wrong. The text book that we are using is not helping at all. Are there any suggestions for a good text to help with this basic c++ programming.

2. I thought I understood this but am having no luck with this code. I am missing something and I'm playing with the code and reading the code and trying different things with no luck. Any help would be much appreciated.

3. Look at line 13.
Where in the loop do you change counter or n?

If neither change, the loop runs forever (or not at all).