diff --git a/ClassClient b/ClassClient new file mode 100755 index 0000000..193876a Binary files /dev/null and b/ClassClient differ diff --git a/ClassClient.cpp b/ClassClient.cpp new file mode 100644 index 0000000..e0f9900 --- /dev/null +++ b/ClassClient.cpp @@ -0,0 +1,31 @@ +#include +#include +#include "Clientinfo.h" +#include +using namespace std; + +int main () +{ + vector Cinfo; + Clientinfo client; + string name; + int i, age; + + for (int i = 0; i < 4; i++) + { + cout << "Enter name of client" << i+1 << ": "; + cin >> name; + client.setname(name); + cout << "Enter age of client " << i+1 << ": "; + cin >> age; + client.setage(age); + Cinfo.push_back(client); + } + + for (int i = 0; i < 4; i++) + { + cout << "Client's " << i+1 << " name is " << Cinfo[i].getname(); + cout << " and he/she is " << Cinfo[i].getage() << " years old." << endl; + } + return 0; +} diff --git a/Clientinfo.cpp b/Clientinfo.cpp new file mode 100644 index 0000000..6246180 --- /dev/null +++ b/Clientinfo.cpp @@ -0,0 +1,21 @@ +#include "Clientinfo.h" + +void Clientinfo::setname (std::string clientname) +{ + name = clientname; +} + +std::string Clientinfo::getname () +{ + return name; +} + +void Clientinfo::setage (int clientage) +{ + age = clientage; +} + +int Clientinfo::getage () +{ + return age; +} diff --git a/Clientinfo.h b/Clientinfo.h new file mode 100644 index 0000000..1953522 --- /dev/null +++ b/Clientinfo.h @@ -0,0 +1,21 @@ +#ifndef Client_H +#define Client_H +#include +#include + +class Clientinfo +{ + public: + void setname (std::string clientname); + + std::string getname (); + + void setage (int clientage); + + int getage (); + + private: + int age = 0; + std::string name; +}; +#endif