An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

- change between pennies to notes and notes to pennies

But to change from one form to another, you need to know how to convert it. At this point, programming is not needed yet. Consider how you will convert money in pennies to notes in real life. As you had already known, to convert money in pennies to notes:

1500 pennies = 1 £10 pound note and one £5 pound note

From this, we get the following information:

£10 pound note = 1000 pennies

£5 pound note = 500 pennies

Since this is the information we have, we will assume that only 2 types of notes are available, the £10 pound note and £5 pound note.

Basically we want to have as little notes as possible, so that we don't have to handle so many notes. Hence, we want to use the £10 pound note when we can represent the same amount of pennies with £10 pound note and £5 pound notes. So we will find out the maximum number of £10 pound notes we can use to represent as much of the pennies as possible. Then we will represent rest of the pennies with £5 pound notes. However, the £5 notes may not represent all of the rest of the pennies. So we will leave the rest of the pennies as it is.

Here is what we have to do:

- Use as much £10 notes as possible to represent as much of the pennies

- Use as much £5 notes as possible to represent as much of the remainder of pennies

- Keep the rest of the pennies as it is

By simple arithmetic, we know that to maximize the number of £10 notes used, we divide the number of pennies by 1000 and round down. In Pascal, we use / and div for division purposes. The / is the same as what we usually do in arithmetic, that is it will give the decimals. The div however, does the division only until the ones' place. Hence you can say that div, is the normal division followed by rounding down the result. We use it as how we normally use a division in arithmetic:

c:= a div b

with the exception that we have to assign the result to a variable.

Hence to find the number of £10 notes needed:

tenpound_num := numofpennies div 1000;

The modulo function complements the div function, it gives the remainder when you divide by a number, like what you do in normal arithmetic.

Hence to find the number of pennies left:

numofpennies := numofpennies mod 1000;

Do not be confuse by this statement, the 2nd numofpennies is the original value, we take the remainder of this value divided by 1000 and store it in numofpennies. Numofpennies is updated at the last step.

Next we will convert the remainder of the pennies into £5 notes using the same method:

fivepound_num := numofpennies div 500;

numofpennies := numofpennies mod 500;

Hence we have tenpound_num of £10 notes, fivepound_num of £5 notes and numofpennies of pennies.