Conditional+loops

Introduction
We have already seen how to use fixed loops to repeat instructions a certain number of times. But what if we want to repeat instructions until a certain event happens?

In cases like these, we can use a conditional loop. A conditional loop continues to loop until a certain condition is met.

Specification: Wholesale T-Shirts
Consider this example. Groovy-Shirts Ltd sell designer T-Shirts in bulk to shops. The standard price which the company sells the T-Shirts for is £20, but they provide a discount on larger orders as follows:

Shops ordering 10 T-Shirts pay full price (£20). Shops ordering 20 T Shirts receive a discount of £1 (£19) Shops ordering 30 T Shirts receive a discount £2 (£18) and so on, up to orders of 100 T Shirts

Groovy-Shirts Ltd want to be able to display a table showing the quantity of T-Shirts and the total price.

**Input Process Output**

 * Inputs:** None


 * Process:** Calculate total price for each quantity


 * Outputs:** Quantity, total price

Algorithm
1. initialise variables 1.1. set price to 20 1.2. set quantity to 10

2. display quantity and price 2.1. repeat while quantity <= 100 2.2. display quantity in quantity field 2.3. Display quantity x price in total price field 2.4. End loop

Can you see that line 2.1 contains the condition? This section of code will continue to execute while the condition is true, i.e. for as long as quantity remains less than or equal to 100

Task
1. Enter the code shown above and test the program to check that it works.