Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <math.h>
- #include <time.h>
- #include <stdio.h>
- #include <cstdlib>
- #include <vector>
- using namespace std;
- void fillVector(vector<orderItem>&towary)
- {
- int quantity;
- for (int i=0; i<10;i++)
- {
- cout<<"elko";
- }
- orderItem actualQuantity(quantity);
- towary.push_back(actualQuantity);
- cout<<endl;
- // for (int i=0; i<)
- }
- // class Order
- // {
- // vector<int> towary;
- // };
- class orderItem
- {
- protected:
- int quantity;
- public:
- void showq()
- {
- cout<<quantity;
- }
- orderItem(int q=0)
- {
- quantity = q;
- }
- };
- class Item
- {
- protected:
- string Title;
- int price;
- public:
- void show()
- {
- cout<<"Tytul: "<<Title<<" Cena: "<<price;
- }
- Item(string t="brak tytulu ", int p=0)
- {
- Title = t;
- price = p;
- }
- };
- class DVD:protected Item
- {
- int length;
- string format;
- public:
- void show()
- {
- cout<<endl<<"DVD"<<endl;
- Item::show();
- cout<<" Dlugosc: "<<length<<" Format: "<<format<<endl;
- }
- DVD(string nt="LoTR", string f="FullHD", int p=60, int l=218):Item(nt,p)
- {
- format = f;
- length = l;
- }
- };
- class CD:protected Item
- {
- int length;
- public:
- void show()
- {
- cout<<endl<<"CD"<<endl;
- Item::show();
- cout<<" Dlugosc: "<<length<<endl;
- }
- CD(string nt="Szwadron", int p=24, int l=59):Item(nt,p)
- {
- length = l;
- }
- };
- class Book:protected Item
- {
- int pages;
- public:
- void show()
- {
- cout<<endl<<"Ksiazka"<<endl;
- Item::show();
- cout<<" Ilosc stron: "<<pages<<endl;
- }
- Book(string nt="Black Mirror", int p=78, int pag=318):Item(nt,p)
- {
- pages = pag;
- }
- };
- int main()
- {
- // DVD d1;
- // d1.show();
- // CD c1;
- // c1.show();
- // Book b1;
- // b1.show();
- // // orderItem o1(14);
- // // o1.showq();
- // // vector<orderItem> towary;
- // // towary.push_back(0);
- // // for( int i = 0; i < 10; i++)
- // // {
- // // towary.push_back(i);
- // // printf("%d",i);
- // // }
- // // cout<<endl<<towary.size();
- // vector <double> v1; // Empty vector of doubles.
- // v1.push_back (32.1);
- // v1.push_back (40.5);
- // for (int i = 0; i < v1.size (); i++)
- // cout << v1[i] << " ";
- // cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement