You are on page 1of 2

INTRODUCTION:

Automation is the key to progress. Only by automating the tedious tasks humans see
as redundant are we able to focus more on our more abstract thoughts and work to make
them a reality. Humans have used automation in the ways of taking advantage of animals’
strength in the primitive past (e.g. using oxen to plough fields, donkeys to carry heavy
burdens etc.), and later moved on to creating simple machinery (such as toasters, blenders,
etc.). In the modern day humans now use sophisticated computers and specialised
languages.

However, no matter how sophisticated the tools are, the core of automation remains
the same: Algorithms. From the most basic task of breathing to the more difficult task of
sending astronauts to space, each and every action we take can be expressed as an
algorithm. We have four ways of expressing algorithms: Natural language, step-form,
pseudocode and flowcharts. Each of these ways of expression are closer to the language of
computers than the last. In this assignment, we will be focusing on expressing the two
problems we were given through the expression ways of step-form and pseudocode.

STEP-BY-STEP ALGORITHMS:

In the first problem, we were assigned to make an algorithm that would automate the
process of filling a car with petrol and express this algorithm step by step. The algorithm that
we have come up with is as follows:

Step 1: Declare the variables: LicencePlate, PetrolType, PetrolAmount, Price.


Step 2: Prompt the customer to insert their licence plate into the system.
Step 3: Store the input in the LicencePlate variable.
Step 4: Display the types of petrol the station has available alongside how much they cost
by the litre.
Step 5: Prompt the customer to choose which type of petrol they wish to buy.
Step 6: Store the choice that the customer has made in the PetrolType variable.
Step 7: Ask the customer if they wish to fill their tank up to full capacity.
Step 8: If the answer is yes, move to step 10. If the answer is no, move to step 9.
Step 9: Prompt the customer to write down the amount of petrol they want.
Step 10: Store the value in the PetrolAmount variable.
Step 11: Calculate Price as PetrolType*PetrolAmount.
Step 12: Display Price.
Step 13: Prompt the customer to swipe/scan their credit card in order to charge them for
their purchase.
Step 14: Prompt the customer to enter the nozzle into the filler of their car.
Step 15: Display the option to start pouring the petrol.
Step 16: Display the amount of petrol the nozzle pours into the tank in real time.
Step 17: Slow the pouring down by half its speed when the amount already poured reaches
75% of the total amount of the bought amount of petrol.
Step 18: Stop the pouring when the amount that was poured becomes 100% of the amount
of bought petrol or stop the pouring when the sensors at the end of the nozzle detect petrol
touching them.
Step 19: Prompt the customer to put the nozzle back into the pump.
Step 20: When the nozzle is put back to the pump, end the transaction and go back to step
2.

With this algorithm, we have managed to automate the process so that there doesn’t
need to be any workers stationed at the pumps to help customers nor does the customer
need to do the pouring themselves. A lot of countries have systems in which the customer
does the pouring of the petrol, in order to save money by having less workers, and it is
obvious that an algorithm such as this will be the next step to ensure the customers’
satisfaction and comfort.

You might also like