Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Created by Julio Tentor <jtentor@fi.unju.edu.ar>
- //
- #ifndef TP1CEC_LIBRO_H
- #define TP1CEC_LIBRO_H
- #include <iostream>
- class Libro {
- private:
- std::string titulo;
- std::string autor;
- std::string editorial;
- int anio;
- float precio;
- public:
- Libro(std::string const& titulo, std::string const& autor,
- std::string const& editorial, int const& anio, float const& precio);
- // getters (por ahora en el header)
- std::string const& getTitulo() const { return this->titulo; };
- std::string const& getAutor() const { return this->autor; };
- std::string const& getEditorial() const { return this->editorial; };
- int const& getAnio() const { return this->anio; };
- float const& getPrecio() const { return this->precio; };
- // setters (por ahora en el header)
- std::string const& setTitulo(std::string const& titulo) {
- return this->titulo = titulo; };
- std::string const& setAutor(std::string const& autor) {
- return this->autor = autor; };
- std::string const& setEditorial(std::string const& editorial) {
- return this->editorial = editorial; };
- int const& setAnio(int const& anio) {
- return this->anio = anio; };
- float const& setPrecio(float const& precio) {
- return this->precio = precio; };
- // sobrecarga operador <<
- friend std::ostream& operator<< (std::ostream& out, const Libro& libro);
- };
- #endif //TP1CEC_LIBRO_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement