using namespace std;
class Avtomobil{
public:
string nomi;
int max_tezlik;
public:
virtual int narx1(){
return max_tezlik*100;
}
virtual int metodni_yangilash1(){
return max_tezlik+10;
}
void kirit(){
cout << " Nomi : "; cin>>nomi;
cout << " Max Tezligi : "; cin >> max_tezlik;
cout<< " --------------------------------------------------------- \n";
}
void chiqar(){
cout << " Nomi : " << nomi << endl;
cout << " Max Tezligi : " << max_tezlik << endl;
cout << " Narxi : " << narx1() << endl;
cout << " Metodni Yangilash : " << metodni_yangilash1() << endl;
cout << " ----------------------------------------------------- \n";
}
};
class Zamonaviy_Avtomabil :public Avtomobil{
public:
string nom;
int max_tezlik2;
public :
virtual int narx2(){
return max_tezlik2*250;
}
virtual int metodni_yangilash2(){
return max_tezlik2+25;
}
void chiqar(){
cout << " Nomi : " << nom << endl;
cout << " Max Tezligi : " << max_tezlik2 << endl;
cout << " Narxi : " << narx2() << endl;
cout << " Metodni Yangilash : " << metodni_yangilash2() << endl;
cout << " ----------------------------------------------------- \n";
}
};
int main(){
Avtomobil a[100];
Zamonaviy_Avtomabil b[100];
int n;
cout << " Avtomobillar soni : "; cin >> n;
for(int i=0; i
a[i].kirit();
a[i].narx1();
a[i].metodni_yangilash1();
b[i].nom = a[i].nomi;
b[i].max_tezlik2 = a[i].max_tezlik;
b[i].narx2();
b[i].metodni_yangilash2();
}
for(int i=0; i
for(int i=0; i
}