blob: 25907feaf7c8d7f20453ca7437b9febf96f4d33f (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 | /* 
 * File:   Marca.cpp
 * Author: mitsuo
 * 
 * Created on 02 December 2022, 12:36
 */
#include <iostream>
#include <iomanip>
#include "Marca.h"
#include "aux.h"
using namespace std;
Marca::Marca() {
    this->laboratorio = new char [MAXLEN];
}
Marca::Marca(const Marca& orig) {
}
Marca::~Marca() {
    delete [] this->laboratorio;
}
int Marca::lee(std::istream &input) {
    this->Medicamento::lee(input);
    input.getline(this->laboratorio, MAXLEN, ',');
    input >> this->lote;
    
    return !input.eof();
}
void Marca::imprime(std::ostream &output) {
    this->Medicamento::imprime(output);
    output << WL(40) << this->laboratorio;
    output << WL(8) << this->lote;
    output << '\n';
}
void Marca::actualiza(std::istream &input) {
    input.clear();
    input.seekg(0);  // rewind
   
    int codigo;
    while (input >> codigo) {
        if (codigo == this->getCodigo()) {
            this->setPrecio(this->getPrecio() * 1.2);
        }
    }
}
 |