Pretending a produce stand would have a COBOL program to track their transactions.
COBOLMIT
Produce-Stand
Pretending a produce stand would have a COBOL program to track their transactions. I always wanted to learn and make something dumb with COBOL, so here it is.
Summary
Build item array from reading each record in produce item table
Read each transaction record from daily transactions table
Calculate per-item and overall totals
Write per-item and overall totals to output file
Daily Report
PRODUCE STAND DAILY REPORT
2020-09-19 12:55:34
----------------------------------------------------
ITEM ID ITEM NAME QUANTITY TOTAL
--------- --------------------- ---------- ---------
001 PEAR 0052 $65.00
002 ORANGE 0041 $101.65
003 APPLE 1288 $558.95
004 WATERMELON 0019 $38.00
005 TOMATO 0003 $18.75
007 DRAGONFRUIT 0002 $246.90
----------------------------------------------------
OVERALL TOTAL: $1029.25
*00001002001750015****************FIRST TRANSACTION 2020091718371500
*00002001001250005****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091718373000
*00003003001250011****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091718380000
*00004005006250003****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091718383000
*00005003001200005****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091718390000
*00006003000401234****************GIANT BULK ORDER 2020091719393000
*00007004002000019****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091719400000
*00008001001250047****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091719403000
*00009002002900026****************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC2020091720450000
*00010007123450002****************WOAH SOMEONE BOUGHT THIS 2020091720451500
*00011003001200038****************LAST ONE FOR THE DAY 2020091720453000