Advertisement
ItsMeLucifer

Zad12 Simin JPO19

Jun 23rd, 2019
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.75 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <string>
  4. #include <cctype>
  5.  
  6. using namespace std;
  7.  
  8. class ElementKonstrukcyjny {
  9. private:
  10.     unsigned int NumerSeryjny;
  11. public:
  12.     ElementKonstrukcyjny() : NumerSeryjny(0) {}
  13.     ElementKonstrukcyjny(unsigned int newNumerSeryjny) : NumerSeryjny(newNumerSeryjny) {}
  14.     void setNumerSeryjny(unsigned int newNumerSeryjny) {
  15.         this->NumerSeryjny = newNumerSeryjny;
  16.     }
  17.     unsigned int gerNumerSeryjny() {
  18.         return NumerSeryjny;
  19.     }
  20. };
  21. class srodkiTransportu{
  22. private:
  23.     unsigned int numerEwidencji;
  24. public:
  25.     srodkiTransportu() : numerEwidencji(0) {}
  26.     srodkiTransportu(unsigned int newNumerEwidencji) : numerEwidencji(newNumerEwidencji) {}
  27.     void setNumerEwidencji(unsigned int newNumerEwidencji) {
  28.         this->numerEwidencji = newNumerEwidencji;
  29.     }
  30.     unsigned int gerNumerEwidencji() {
  31.         return numerEwidencji;
  32.     }
  33. };
  34. class pojazdSilnikowy : public srodkiTransportu{
  35.  
  36. };
  37. class silnik : public ElementKonstrukcyjny {
  38. private:
  39.     double pojemnosc;
  40. public:
  41.     silnik() : pojemnosc(0), ElementKonstrukcyjny() {}
  42.     silnik(double newPojemnosc, unsigned int newNumerSeryjny) : pojemnosc(newPojemnosc), ElementKonstrukcyjny(newNumerSeryjny) {}
  43.     void setPojemnosc(double newPojemnosc) {
  44.         this->pojemnosc = newPojemnosc;
  45.     }
  46.     double getPojemnosc() {
  47.         return pojemnosc;
  48.     }
  49. };
  50. enum KOLOR {
  51.     CZARNY,
  52.     NIEBIESKI,
  53.     ZIELONY,
  54.     CZERWONY,
  55.     BIALY
  56. };
  57. class nadwozie : public ElementKonstrukcyjny {
  58. private:
  59.     KOLOR kolor;
  60. public:
  61.     nadwozie() : kolor(CZARNY), ElementKonstrukcyjny() {}
  62.     nadwozie(KOLOR color, unsigned int newNumerSeryjny) : kolor(color), ElementKonstrukcyjny(newNumerSeryjny) {}
  63.     void setKolor(KOLOR newKolor) {
  64.         this->kolor = newKolor;
  65.     }
  66.     KOLOR gerKolor() {
  67.         return kolor;
  68.     }
  69. };
  70.  
  71. int main()
  72. {
  73.     return 0;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement