Skip to content

Tutorial — ejercicio-inventario

Learn by programming: follow each step, write your own code, then apply it to the course assignment.

What you will build

Manage products in memory with struct and a console menu.

  1. 1

    Define Producto

    Minimum fields: id, name, price (adjust per PDF).
    
    								struct Producto {
        int id;
        std::string nombre;
        double precio;
    };
    							
  2. 2

    Console menu

    Loop with options: add, list, search, exit. Use `vector`.
  3. 3

    Validate input

    Reject negative prices and duplicate ids as required.
  4. 4

    Submit

    Package code + README per /en/trabajos/plantilla/.

Back to tutorial page