From 337c2e523dc1a849804e0749fc85e2fb8bfa53a3 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Sun, 27 Nov 2022 13:57:46 -0500 Subject: Add enunciados, add sol to L8 --- 2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp (limited to '2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp') diff --git a/2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp b/2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp new file mode 100644 index 0000000..b2ef540 --- /dev/null +++ b/2022-2/L8/mitsuo/LAB08_PREG01/Medicamento.cpp @@ -0,0 +1,46 @@ +/* + * File: Medicamento.cpp + * Author: mitsuo + * + * Created on 27 November 2022, 11:49 + */ + +#include +#include "Medicamento.h" +#include "aux.h" + +Medicamento::Medicamento() { + this->codigo = -1; + this->nombre = new char [MAXLEN]; +} + +Medicamento::Medicamento(const Medicamento& orig) { +} + +Medicamento::~Medicamento() { + delete [] this->nombre; +} + +void Medicamento::SetCantidad(int cantidad) { + this->cantidad = cantidad; +} + +int Medicamento::GetCantidad() const { + return cantidad; +} + +void Medicamento::SetNombre(const char* nombre) { + strcpy(this->nombre, nombre); +} + +char* Medicamento::GetNombre() const { + return nombre; +} + +void Medicamento::SetCodigo(int codigo) { + this->codigo = codigo; +} + +int Medicamento::GetCodigo() const { + return codigo; +} -- cgit v1.2.3