as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write an algorithm that will calculate the average of two numbers.
user
algorithm to calculate the average of two numbers:

1. start
2. declare two variables 'x' and 'y' and assign them the numbers to be averaged.
3. calculate the sum of the two variables by adding them together: 'sum = x + y' 
4. calculate the average by dividing the sum by two: 'average = sum / 2' 
5. print the average.
6. end
assistant