diff options
| author | Mitsuo Tokumori <[email protected]> | 2022-11-27 13:57:46 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2022-11-27 13:57:46 -0500 |
| commit | 337c2e523dc1a849804e0749fc85e2fb8bfa53a3 (patch) | |
| tree | 50d9c41d7eec8695079f8d0b26661c79e0de2bef /2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp | |
| parent | 2202706efaf7a067af0495d531998b8ad8b86a92 (diff) | |
| download | LP1-337c2e523dc1a849804e0749fc85e2fb8bfa53a3.tar.gz LP1-337c2e523dc1a849804e0749fc85e2fb8bfa53a3.tar.bz2 LP1-337c2e523dc1a849804e0749fc85e2fb8bfa53a3.zip | |
Add enunciados, add sol to L8
Diffstat (limited to '2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp')
| -rw-r--r-- | 2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp b/2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp new file mode 100644 index 0000000..4e03ba8 --- /dev/null +++ b/2022-2/L8/mitsuo/LAB08_PREG01/ConReceta.cpp @@ -0,0 +1,49 @@ +/* + * File: ConReceta.cpp + * Author: mitsuo + * + * Created on 27 November 2022, 11:51 + */ + +#include <cstring> +#include <iomanip> +#include "ConReceta.h" +#include "aux.h" + +using namespace std; + +ConReceta::ConReceta() { + this->especialidad = new char [MAXLEN]; +} + +ConReceta::ConReceta(const ConReceta& orig) { +} + +ConReceta::~ConReceta() { + delete [] this->especialidad; +} + +void ConReceta::SetEspecialidad(const char* especialidad) { + strcpy(this->especialidad, especialidad); +} + +char* ConReceta::GetEspecialidad() const { + return especialidad; +} + +void ConReceta::SetCodmed(int codmed) { + this->codmed = codmed; +} + +int ConReceta::GetCodmed() const { + return codmed; +} + +void ConReceta::write(std::ostream & output) { + output << WL(12) << this->GetCodigo(); + output << WL(40) << this->GetNombre(); + output << WR(8) << this->GetCantidad(); + output << WL(12) << this->codmed; + output << WL(20) << this->especialidad; + output << '\n'; +} |
