Shopping Project
The programming language
Cobol
The project
Out of curiosity, I decided to learn COBOL, an old programming language. To do so, I used an IDE called “OpenCobolIDE” to program and realize my first project in this language. I decided to set up a wishlist and a purchasing system. When the program starts up, it can reset the wishlist. Next, the program fetches from a text document the list of available products that will be displayed in the console. The user then selects and adds one or more items to the wish list. Afterwards, the user can either exit the program with the saved wishlist or purchase all the products on it. If the user makes the purchase, the wishlist will be deleted and the program will close
The challenge : Cobol doesn’t work like most programming languages
The problem:
Since I started to learn programming languages, I always got use of the logic of how variables work, how we had MVC (Model-View-Controller), class and object but the Cobol doesn’t have that and the variables work differently.
The solution:
The solution to learn Cobol was to start small with a little project. I found an old book called Programmation en Cobol structuré – Théorie et applications (Structured COBOL Programming – Theory and Applications) written by Lawrence R. Newcomer. I also used internet as well to get more informations about things I misunderstood.
What I have learned:
I have learned that COBOL work with division. Each division has it’s own purpose. For example, data division is used to declare all variables and structures that will be used in the program. Also, procedure division is used to create the logic of the program. We have to manage the memory of each variable like in C and C++. For example, we start by writing what type of variable we have and inside of « () », we tell how much space we reserve for this. If we look at « PIC 9(4) », the variable will be a number and we reserve the space of 4 digits. After this project, I have learned enough to be able to make more small projects in COBOL.


