Hi! I hope my post fits in Tech Board. If not, I'd be happy to move to to another location at cboard.

Could anyone please comment on my solution to the below mentioned problem? I feel so confused about using loop structures.(

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.

Here's what I've got (in pseudocode).

Loop: Day = 1 TO 5
Price = Price*0,9
Counter = Counter + 1
LoopEnd: Day

Second part of the same problem goes like this: Make changes in the solution to problem 1 to set the price at wholesale when the sale price drops below the wholesale price.

Loop: Day = 1 TO 5
Price = Price * 0,9
If Price < WholesalePrice
Price = WholesalePrice
Endif
LoopEnd: Day

Thank you very much in advance! And please, do post a line or two, even if this seems like child play to you. I can't move on with my studies if I don't understand loops properly and I've failed to do so on my own.

2. What weird language is this? You seem to be missing that crucial information.

3. Yes, sorry for not mentioning that beforehand. It's just a pseudocode.

4. So do you expect replies in pseudo code too? Your code looks correct.
If you have trouble with loops, I really recommend you check out flow charts. It's a graphical way of structuring up the logic of a program.

5. Exactly, pseudo code answers is what I'm looking for.

That's good to know, thank you, Elysia. About the flowcharts, I've already covered them, although with no improvement in actually understanding the essence and design of loops. Right now I can merely adjust existing solutions to problems of a similar kind, while writing something even remotely different is still a bugger for me.

6. There are different kinds of loops.
while loops while the loop condition is true. In flow charts, this would be a task such If Condition is true, do B, loop. If condition is false, break the loop.
for loops are the same except they have initialization and post-instruction, so they would be Initialize, if condition is true, do B, do post condition, loop. Otherwise break the loop.
Do while loops are while loops, but the condition pushed to the bottom, so do b, if condition is true, loop. Otherwise break the loop.
You should easily be able to design such logic in flowcharts. Give it a shot.