Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- class Data {
- private:
- char nume[20], Pren[20], adresa[20], tele[20];
- int age;
- public:
- void Citire();
- void Print();
- };
- void Data::Citire() {
- cout << "nume = "; cin >> nume;
- cout << "Prename = "; cin >> Pren;
- cout << "Adresa = "; cin >> adresa;
- cout << "Numar de telefon = "; cin >> tele;
- cout << "age = "; cin >> age;
- cout << endl;
- }
- void Data::Print() {
- cout << "nume: " << nume << "\n";
- cout << "Prename: " << Pren << "\n";
- cout << "Adresa: " << adresa << "\n";
- cout << "Numar telefon: " << tele << "\n";
- cout << "age: " << age << "\n\n";
- }
- class Sofer {
- private:
- char nume[20], cnp[20], adresa[20];
- int age;
- public:
- void Citire();
- void Print();
- };
- void Sofer::Citire() {
- cout << "nume= "; cin >> nume;
- cout << "CNP = "; cin >> cnp;
- cout << "Adresa = "; cin >> adresa;
- cout << "age = "; cin >> age;
- cout << endl;
- }
- void Sofer::Print() {
- cout << "Nume Sofer: " << nume << "\n";
- cout << "CNP: " << cnp << "\n";
- cout << "Adresa: " << adresa << "\n";
- cout << "age: " << age << "\n\n";
- }
- class Masina {
- private:
- char model[20], producator[20];
- int an_Fab;
- Sofer Driver;
- public:
- void Print();
- void Citire();
- };
- void Masina::Print() {
- cout << "Producator: " << producator << "\n";
- cout << "Model: " << model << "\n";
- cout << "Adresa: " << an_Fab << "\n\n";
- Driver.Print();
- }
- void Masina::Citire() {
- cout << "Producator = "; cin >> producator;
- cout << "Model = "; cin >> model;
- cout << "An fabricate = "; cin >> an_Fab;
- cout << endl;
- Driver.Citire();
- }
- int main() {
- Data student;
- student.Citire();
- student.Print();
- Masina Au;
- Au.Citire();
- Au.Print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement