1. Home
  2. /
  3. Pli
  4. /
  5. PL/I Shopping Cart

PL/I Shopping Cart - Pli Typing CST Test

Loading…

PL/I Shopping Cart — Pli Code

Adds and removes items in a shopping cart with total cost.

DECLARE cart CHAR(20) DIM(10);
DECLARE prices FIXED BINARY(31) DIM(10);
DECLARE count FIXED BINARY(31) INITIAL(0);

ADDITEM: PROCEDURE(item, price);
	cart(count) = item;
	prices(count) = price;
	count = count + 1;
END ADDITEM;

REMOVEITEM: PROCEDURE(idx);
	DO i = idx TO count-2;
		cart(i) = cart(i+1);
		prices(i) = prices(i+1);
	END;
	count = count -1;
END REMOVEITEM;

CALL ADDITEM('Apple',2);
CALL ADDITEM('Banana',3);
CALL REMOVEITEM(0);

Pli Language Guide

PLI (Programming Language One) is a procedural, compiled language designed for business and systems programming, particularly for large-scale data processing and legacy IBM mainframe environments.

Primary Use Cases

  • ▸Large-scale batch processing
  • ▸Business and financial systems
  • ▸Mainframe application maintenance
  • ▸Data processing for enterprises
  • ▸Legacy system integration and updates

Notable Features

  • ▸Structured programming constructs
  • ▸Strong support for record and array data types
  • ▸Compiled for IBM mainframes
  • ▸Integrated input/output for batch processing
  • ▸Efficient memory and file handling

Origin & Creator

Developed by IBM in the 1960s, primarily as a high-level language for business and systems applications on mainframe computers.

Industrial Note

PLI remains in use in legacy IBM mainframe environments for maintaining mission-critical financial and administrative systems.

More Pli Typing Exercises

PL/I Counter and Theme TogglePL/I Random Number GeneratorPL/I Todo ListPL/I Dice RollerPL/I Countdown TimerPL/I Prime CheckerPL/I Temperature ConverterPL/I Name GreetingPL/I Stopwatch

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher