#include "cart.h"
#include <iostream>
#include <list>
#include <fstream>

Cart::Cart (int id){
    id_=id;
}

void Cart::addComputer(Computer c){
    CartList_.push_back(c);
}

void Cart::print(){
    int i=1;
    for (auto c : CartList_)
    {
        std::cout << std::to_string(i) << c.getNombreYModelo() << std::endl;
        i++;
    }
}

void Cart::write(){
    std::ofstream out("salida.txt");
    int i=1;
    for (auto a : CartList_)
    {
        out << std::to_string(i) << a.getNombreYModelo() << std::endl;
        i++;
    } 
}
