Lesson 24 of 24

Mini Project: Inventory Management

15 min 50 XP

A shop's inventory system: add stock, sell items and report what's left, with a class, a map and exceptions working together. A good project for your resume.

Example: edit me and press Run

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.

Challenge

+50 XP

The first line is n. Commands: ADD item qty → prints nothing SELL item qty → "Sold qty item", or "Only k item left", or "No item item" for an unknown item REPORT → each item with qty > 0 in alphabetical order as "item qty", or "Empty" if there are none

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.