// Implementación del módulo de artículos. Ver item.h.
#include "item.h"

int item_total(const struct item *item) {
    return item->quantity * item->unit_cents;
}

int items_total(const struct item items[], int n) {
    int total = 0;
    for (int i = 0; i < n; i++) {
        total += item_total(&items[i]);
    }
    return total;
}
