Public: void varaqi(double len) {


Download 186.04 Kb.
Sana27.07.2023
Hajmi186.04 Kb.
#1662973
Bog'liq
1-topshiriq

#include


using namespace std;
class kitob {
public:
void varaqi(double len) {
length_ = len;
}
void muallif(string brnd) {
brand_ = brnd;
}
void nomi(string text) {
cout << brand_ << " " << length_ << " varoqdan iborat " << text << " kitob " << endl;
}
private:
double length_;
string brand_;
};

class kitob;


class daftar {


public:
void color(string clr) {
color_ = clr;
}
void brand(string brnd) {
brand_ = brnd;
}
void write(string text, kitob& qalam) {
cout << brand_ << " " << color_ << " rangdagi daftar " << text << " ..." << endl;
qalam.nomi(text);
}
private:
string color_;
string brand_;
};

int main() {


daftar r;
r.color("qora");
r.brand("parker");

kitob q;
q.varaqi(14.5);


q.muallif("abdulla qodiriy");

r.write(" edi", q);


}



Download 186.04 Kb.

Do'stlaringiz bilan baham:




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