Are you looking to learn about how to program in ALGOL programming language for mainframe computers? If you do, then you have come to the right place.
ALGOL is undoubtedly one of the most influential languages out there. It became popular in the era of other influential programming languages such as COBOL, Fortran, and so on!
So, what made ALGOL so special? It is because it influenced other languages and is also used to describe algorithms in textbooks until modern programming languages were introduced.
ALGOL builds upon the FORTRAN failure by offering better design and implementation. It is also one of the first programming languages that defined code blocks.
The first ALGOL version was ALGOL 58 where it.
In this article, we will explore ALGOL and how you can use it for mainframe programming.
Let’s get started.
To make sure that we are on the same page, we are going to use ALGOL 68.
The first thing that you need to learn is the program structure. Each of the ALGOL 68 programs starts with “begin” and then finishes with “end”.
The syntax would read like below.
Insert code here
Apart from that, an ALGOL 68 program can do the following:
ALGOL 68 uses modes instead of “type” to detonate the data type. For example, there is Boolean, character, real, and integer. Just like modern programming languages, these variables need to be declared before they can be used.
Next, we come to statements. In ALGOL 68, every statement yields value. This is because ALGOL is an expressive language where the value is shown on the right-hand side of the assignment.
Apart from that, it supports if statements, for statements, case statements, while statements, and goto statements. If you ever programmed before, you will find all of these statements familiar to yourself.
if x> 5
then print (“impressive”) else print (“nope”)
We also have else-if which is represented as the elif keyword. It can be used as below.
if word = “abc”
then print(“new born”)
elif word = “pizza”
then print (“teen”)
elif word = “money”
then print (“adult”)
else print (“alien”)
You can run conditions based on the if statement. Moreover, you can also use loops to do an operation multiple times.
Let’s see a for loop example.
for k from 1 by 1 to j+2
do print (new line) od;
In contrast, the while- do loop works as below.
while x<y V a<0
do x:= x+ 1;
y = y+ 1;
There are multiple modes that are part of the ALGOL 68 programming languages. These modes are simply data types and can be divided into primitive modes, array modes, structured modes, united modes, reference-to, and procedure modes.
These data types enable you to handle the different data in your ALGOL 68. As a programmer, you need to decide beforehand what type of data type you want to use, depending on your approach.
This is just the beginning when it comes to programming in ALGOL programming language for mainframe computers. With the above knowledge, you can get started with the language itself.
So, what program are you going to build for mainframe using ALGOL 68? Comment below and let us know.