Giter Club home page Giter Club logo

12.hafta-odev's Introduction

12.Hafta-Odev

Tasit isimli bir sinif tanimlayiniz. Bu sinif icerisinde sinif ozelligi (class method) olarak tasit_miktari isimli bir bos liste tanimlayiniz. Bu tasit sinifinin motor_gucu, koltuk_sayisi, km_durumu, modeli, satis_yili gibi obje ozellikleri(instance attributes) olsun. Ve her orneklenme durumunda bu ozellikler parametre olarak verilsin. Ayrica her ornekte degismeyecek sekilde; tekerlek sayisi isimli bir ornek niteligi tanimlayin ve degeri 4 olsun. Ayrica bu objenin su methodlari olmalidir:

1.koltuk sayisini goster(tasitin koltuk sayisini ekrana yazdirmali  
2.modelini goster (tasitin modelini ekrana yazdirmali)
3. km_durumunu al (tasitin kilometre durumunu return etmeli) 
4. tasit miktarini_guncelle. Sinif her orneklendiginde tasit miktarini 1 artirmali.

- bu sinifa ait ozellik olan tasit_miktari’ni sinif disarisindan ulasilamayacak sekilde gizleyiniz.
- class method olarak tasit_miktarini gosterecek bir method tanimlayiniz.

Sorunun devaminda, bir Araba sinifi tanimlayiniz ve bu sinifi, Tasit sinifindan miras aliniz. Tasit sinifindan miras aldiginiz init fonksiyonunu muhafaza ediniz ve max_hiz isimli bir ornek niteligi tanimlayiniz ve bu nitelik her orneklenme durumunda parametre olarak verilsin. Bu sinifta su methodlari tanimlayiniz;

1.arabayi_durdur (“araba durdu” seklinde ekrana yazsin)
2. gaza_bas(“araba hizlaniyor” seklinde ekrana yazsin)
3.  arabayi_yavaslat(“araba yavasliyor” seklinde ekrana yazsin)
4. arabanin_durumunu goster(bir kosul durumu yaziniz;eger Araba sinifi Tasit sinifinin alt sinifi ise 
“Bu sinif Tasit sinifindan miras alinmistir” seklinde cikti versin. Degilse ‘ Araba sinifi Tasit sinifindan 
miras alinmamistir.’ seklinde yazsin)

Ayrica bu Araba sinifinda; modelini goster isimli Tasit sinifina ait methodu override ediniz ve ‘Araba sinifinin methodu….’ seklinde ekrana cikti veriniz ve modeli yazdiriniz.

12.hafta-odev's People

Contributors

tars13 avatar dilekkoksal avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.