fferum

computer_info.h

Nov 22nd, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #pragma once
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5. class Computer
  6. {
  7. protected:
  8.     string firm;
  9.     string mark;
  10.     int yearB;
  11. public:
  12.     Computer() = default;
  13.     Computer(string firm, string mark, int yearB);
  14.     string  print();
  15.     void changeF(string firm);
  16.     void changeM(string mark);
  17.     void changeY(int yearB);
  18. };
  19. class Desktop : public Computer
  20. {
  21. private:
  22.     int power;
  23. public:
  24.     Desktop() = default;
  25.     Desktop(string firm, string mark, int yearB, int power);
  26.     void changeP(int power);
  27.     string print(int current_year);
  28.  
  29. };
  30. class Laptop : public Computer
  31. {
  32. private:
  33.     int core;
  34. public:
  35.     Laptop() = default;
  36.     Laptop(string firm, string mark, int yearB, int core);
  37.     void changeC(int core);
  38.     string print(int current_year);
  39. };
Add Comment
Please, Sign In to add comment