Strona główna > Definiowanie klas > Samochod obiektowo C++

Samochod obiektowo C++

#include<iostream>
#include<string>

using namespace std;

class Samochod
{

      string typ;
      string kolor;
      int waga;

      public:
             Samochod(string, string, int);
             Samochod();
             ~Samochod() {cout<<"Usuwam "<<kolor<<" "<<typ<<"! \n"<<endl;}

             void ZmienTyp(string);
             void ZmienKolor(string);
             void ZmienWage(int);

             void Wypisz();
};

Samochod::Samochod(string T, string K, int W)
{
   typ=T;
   kolor=K;
   waga=W;
}

Samochod::Samochod()
{}

void Samochod::ZmienTyp(string T)
{
     typ=T;
}

void Samochod::ZmienKolor(string K)
{
     kolor=K;
}

void Samochod::ZmienWage(int W)
{
     waga=W;
}

void Samochod::Wypisz()
{
     cout<<"Samochod jest marki: "<<typ<<endl<<
         "Ma kolor: "<<kolor<<endl<<
         "Wazy: "<<waga<<"KG\n"<<endl;
}

main()
{
    Samochod *wsk = new Samochod;
    Samochod MalyFiat("Fiat 126p", "Czerwony", 600);
    (*wsk)=MalyFiat;
    (*wsk).Wypisz();
    delete wsk;
    MalyFiat.ZmienKolor("szary");
    MalyFiat.Wypisz();
    system("pause");
}
  1. 8 Sierpień 2013 o 9:44 am

    The promise of financial freedom through debtor financing.
    To be honest, I always thought blogging was stupid and I had my reasons which I will explain these challenges and help when you get off the ground and bringing in
    an income. Students can use government and personal
    financial loans. Investing may be costly for a while longer.
    Traffic is the lifeline of any website designed for Debtor Financing
    is always to make the selection keeping in mind your preferences.

    Whether this is a ‚thumbs up’ to great content.

  2. 6 Wrzesień 2013 o 2:55 am

    Swipe it away And to follow this advice, you must wear a shirt and tie if you are given in CNN and other American News networks and channels.
    How Do the Email Clients Work?

  3. 11 Grudzień 2013 o 10:20 pm

    Heloo аll, heгe evеry one is sharing thеse kinds оf knowledge,
    thuѕ it’s fastidious tо read thіs website, anԁ I
    useԁ to visit this webpage daily.

  4. 2 Kwiecień 2014 o 9:33 pm

    Excellent blog you have here.. It’s hard to find good quality writing like yours these days. I really appreciate people like you! Take care!!

  5. 15 Lipiec 2014 o 4:00 pm

    Spot on with this write-up, I seriously feel this website needs a
    lot more attention. I’ll probably be returning to see more, thanks for the information!

  6. 19 Lipiec 2014 o 12:09 am

    Write more, thats all I have to say. Literally, it seems as though
    you relied on the video to make your point. You definitely know what
    youre talking about, why waste your intelligence on just posting
    videos to your site when you could be giving us something informative to read?

  7. 22 Lipiec 2014 o 5:19 am

    Thanks , I have just been searching for information approximately this subject for a
    while and yours is the best I have found out so far.

    But, what about the conclusion? Are you certain about the supply?

  8. 27 Sierpień 2014 o 3:03 pm

    It’s amazing in support of me to have a website, which is beneficial for my know-how. thanks admin

  9. 4 Wrzesień 2014 o 6:56 am

    Hey would you mind letting me know which hosting company you’re utilizing?
    I’ve loaded your blog in 3 completely different web browsers and I must say this
    blog loads a lot faster then most. Can you recommend a good internet
    hosting provider at a fair price? Many thanks, I
    appreciate it!

  10. 6 Wrzesień 2014 o 12:46 pm

    What’s up everybody, here every person is sharing such knowledge, so
    it’s good to read this webpage, and I used to pay a quick visit this website daily.

  11. 8 Wrzesień 2014 o 1:29 am

    Helpful information. Lucky me I found your site accidentally,
    and I’m shocked why this accident did not came about in advance!

    I bookmarked it.

  12. 9 Wrzesień 2014 o 10:46 am

    I’d like to find out more? I’d like to find out some additional information.

  13. 2 Październik 2014 o 5:50 pm

    Hey! I ust wanted to ask if you ever have any problems with hackers?
    My last blog (wordpress) was haked and I ended up losing several weeks of hard work due
    to no back up. Do you have any solutions to stop hackers?

  14. 22 Listopad 2014 o 7:57 am

    I was extremely pleased to find this site. I wanted to thank you for ones time for this fantastic read!!
    I definitely loved every little bit of it and I have you
    book-marked to check out new stuff on your web site.

  15. 21 Luty 2015 o 2:17 am

    Thanks for the marvelous posting! I actually enjoyed reading it, you will be a great author.I will make sure to bookmark your blog and will eventually come back at some
    point. I want to encourage yourself to continue your great
    posts, have a nice evening!

  16. 14 Marzec 2015 o 12:43 pm

    Everything is very open with a very clear description of the challenges.
    It was really informative. Your website
    is useful. Many thanks for sharing!

  17. 19 Październik 2015 o 1:30 am

    Part of the Ancient Wisdom or the gnosis of the Bodhisattvas, were recorded in ancient scriptures such as the Avesta, the
    Vedas, the Tao Teh Ching, the Book of Dzan, Psalms, Ecclesiastes, and many other books
    considered apocryphal. Did you know that each year several billions of dollars are used on internet transactions.
    A serious side affect for many users running affected versions of
    Windows was that the instability in one of this Windows
    service caused the machine to automatically shut itself down after a 60
    second countdown.

  18. 9 Marzec 2016 o 1:41 pm

    Just want to say your article is as surprising. The clearness
    in your post is just great and i can assume you’re an expert on this subject.

    Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming
    post. Thanks a million and please continue the enjoyable work.

  19. 2 Czerwiec 2016 o 7:14 am

    This design iis spectacular! You definitely know how to keep a reader entertained.
    Between your wit and your videos, I was almost
    moved to staret my own blog (well, almost…HaHa!) Wonderful job.
    I really enjoyed wbat you had to say, and more than that,
    how you presented it. Too cool!

  20. 11 Listopad 2016 o 11:37 pm

    Hello, everything is going sound here and ofcourse every one
    is sharing facts, that’s genuinely excellent, keep up writing.

  1. No trackbacks yet.

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s

%d bloggers like this: