Object Oriented Programming



Download 426,5 Kb.
bet1/2
Sana22.07.2022
Hajmi426,5 Kb.
#837025
  1   2
Bog'liq
chapt02

Object Oriented Programming

  • Chapter 2 introduces Object Oriented Programming.
  • OOP is a relatively new approach to programming which supports the creation of new data types and operations to manipulate those types.
  • This presentation introduces OOP.

What is this Object ?

  • There is no real answer to the question, but we’ll call it a “thinking cap”.
  • The plan is to describe a thinking cap by telling you what actions can be done to it.

Using the Object’s Slots

  • You may put a piece of paper in each of the two slots (green and red), with a sentence written on each.
  • You may push the green button and the thinking cap will speak the sentence from the green slot’s paper.
  • And same for the red button.

Example

Example

Example

  • I should
  • study harder !

Thinking Cap Implementation

  • class thinking_cap
  • {
  • . . .
  • };

Thinking Cap Implementation

  • The class will have two components called green_string and red_string. These compnents are strings which hold the information that is placed in the two slots.
  • Using a class permits two new features . . .
  • class thinking_cap
  • {
  • . . .
  • char green_string[50];
  • char red_string[50];
  • };

Thinking Cap Implementation

  • The two components will be private member variables. This ensures that nobody can directly access this information. The only access is through functions that we provide for the class.
  • class thinking_cap
  • {
  • . . .
  • private:
  • char green_string[50];
  • char red_string[50];
  • };

Download 426,5 Kb.

Do'stlaringiz bilan baham:
  1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish