{"id":24676260,"url":"https://github.com/hrosicka/cobolbasics","last_synced_at":"2026-01-04T17:04:30.467Z","repository":{"id":236120689,"uuid":"791959471","full_name":"hrosicka/CobolBasics","owner":"hrosicka","description":"Cobol - Nostalgia for the old-school. Very easy examples. Simple Cobol programs.","archived":false,"fork":false,"pushed_at":"2024-04-25T18:43:33.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T12:14:24.992Z","etag":null,"topics":["calculator","calculator-application","cobol","cobol-example","cobol-language","cobol-programming","cobol-programs","getting-started"],"latest_commit_sha":null,"homepage":"","language":"COBOL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrosicka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-25T17:46:53.000Z","updated_at":"2024-11-18T03:57:48.000Z","dependencies_parsed_at":"2024-04-25T18:46:52.754Z","dependency_job_id":"f141cfd0-2254-4b74-8b24-4d76e0b814a8","html_url":"https://github.com/hrosicka/CobolBasics","commit_stats":null,"previous_names":["hrosicka/cobolbasics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FCobolBasics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FCobolBasics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FCobolBasics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FCobolBasics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrosicka","download_url":"https://codeload.github.com/hrosicka/CobolBasics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244831297,"owners_count":20517666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator","calculator-application","cobol","cobol-example","cobol-language","cobol-programming","cobol-programs","getting-started"],"created_at":"2025-01-26T12:14:26.896Z","updated_at":"2026-01-04T17:04:30.462Z","avatar_url":"https://github.com/hrosicka.png","language":"COBOL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cobol Basics\n\n[![Beginner Friendly](https://img.shields.io/badge/for-beginners-brightgreen?style=for-the-badge\u0026logo=cobol)](https://github.com/hrosicka/CobolBasics)\n[![COBOL Nostalgia](https://img.shields.io/badge/COBOL-Nostalgia-ff69b4?style=for-the-badge\u0026logo=cobol)](https://github.com/hrosicka/CobolBasics)\n[![Grandma Approved](https://img.shields.io/badge/So%20easy-Your%20grandma%20could%20do%20it-blueviolet?style=for-the-badge\u0026logo=cobol)](https://github.com/hrosicka/CobolBasics)\n[![Console Only](https://img.shields.io/badge/UI-Text%20Only-lightgrey?style=for-the-badge\u0026logo=terminal)](https://github.com/hrosicka/CobolBasics)\n[![Humor Inside](https://img.shields.io/badge/Humor-Inside-yellow?style=for-the-badge\u0026logo=smile)](https://github.com/hrosicka/CobolBasics)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)](LICENSE)\n[![Snack Friendly](https://img.shields.io/badge/Snack%20Breaks-Recommended-orange?style=for-the-badge\u0026logo=coffee)](https://github.com/hrosicka/CobolBasics)\n\n**Calling all retro lovers, modern hipsters, and old-school programmers!**\n\nTired of Python? Looking for something that will get your blood pumping and your binary neurons firing? Then this repository is for you!\n\nOur code is written in Cobol, a language so old that only dinosaurs and bearded hipsters remember it. But don't let that scare you away! Cobol isn't just for the old-timers, it's for anyone who wants to experience real programming.\n\n## Simple Calculator\n- [**Simple Calculator**](https://github.com/hrosicka/CobolBasics/blob/master/first-calculator.cbl)\n- This code shows the basic structure of a simple calculator program written in COBOL.\n\n### Here's a breakdown of each section:\n\n#### IDENTIFICATION DIVISION\nThis section identifies the program.  Here, it's named FIRST-CALCULATOR.\n\n#### DATA DIVISION\nThis section defines the program's data storage areas. We're focusing on the WORKING-STORAGE SECTION:\n\n- **01 X PIC S999.** - Declares a numeric variable named X that can hold signed values with a maximum of 3 digits (including the sign).\n- **01 Y PIC S999.** - Similar to X, but stores the second number entered by the user.\n- **01 TOTAL PIC S9999.** - Holds the sum of X and Y. It can accommodate signed values up to 4 digits.\n- **01 DIFFERENCE PIC S9999.** - Stores the difference between X and Y. Similar size capacity to TOTAL.\n- **01 PRODUCT PIC S999999.** - Holds the product of multiplying X by Y. It can handle signed values up to 6 digits.\n- **01 QUATIENT PIC S9999V99.** - Stores the result of dividing X by Y. It can hold signed values with 4 digits before the decimal point and 2 digits after.\n- **01 ANSWER PIC A(1) VALUE \"N\".** - Declares a single-character variable named ANSWER initialized to \"N\". This will be used to decide if the user wants to repeat calculations.\n\n#### PROCEDURE DIVISION\n\nThis part contains the program's instructions, which are grouped within a paragraph named RepeteCalculation.\n\n- **DISPLAY prompts and ACCEPT user input:**\n  - The program displays messages asking the user to enter the first and second numbers in the specified format (S999).\n  - It then uses the ACCEPT statement to read the user's input and store it in X and Y.\n- **Calculations:**\n  - ADD X Y GIVING TOTAL - Adds X and Y and stores the result in TOTAL.\n  - SUBTRACT Y FROM X GIVING DIFFERENCE - Subtracts Y from X and stores the result in DIFFERENCE.\n  - MULTIPLY X BY Y GIVING PRODUCT - Multiplies X by Y and stores the result in PRODUCT.\n  - DIVIDE X BY Y GIVING QUATIENT - Divides X by Y and stores the result in QUATIENT.\n- **DISPLAY results:**\n  - The program displays the values of X, Y, and the calculated results (TOTAL, DIFFERENCE, PRODUCT, and QUATIENT) using the DISPLAY statement.\n- **Loop control:**\n  - It asks the user if they want to repeat the calculation with a yes or no question.\n  - Based on the user's input (ANSWER), it decides whether to repeat the process by using an IF statement.\n  - If the answer is \"Y\", it jumps back to the RepeteCalculation paragraph using the GO TO statement.\n- **STOP RUN:** This statement gracefully terminates the program's execution.\n\n## Author\nLovingly crafted by [Hanka Robovska](https://github.com/hrosicka) 👩‍🔬\n\n## License\nMIT – Free to use, modify, and distribute as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrosicka%2Fcobolbasics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrosicka%2Fcobolbasics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrosicka%2Fcobolbasics/lists"}