Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.28 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <vector>
  4. #include <string>#include <cstdlib>
  5. #include <iostream>
  6. #include <vector>
  7. #include <string>
  8. #include <cstring>
  9. using namespace std;
  10.  
  11. //Current Date//
  12. int cDay = 18; //[1-31]
  13. int cMonth = 11; //[1-12]
  14. int cYear = 2014;
  15. string digits = "01234567890";
  16.  
  17.  
  18. //Class Address//
  19. class TAddress
  20. {private:
  21. string fStreet;
  22. string fCity;
  23. int fHouse;
  24. string fHouse_Letter;
  25. int fFlat;
  26. int fCode_begin;
  27. int fCode_end;
  28. char fCode[6];
  29.  
  30. public:
  31. //Initializing constructor//
  32. TAddress() {}
  33.  
  34. //Parametric constructor//
  35. TAddress(string street, string city, int house, string hletter, int flat, int cbegin, int cend)
  36. { fStreet = street;
  37. fCity = city;
  38. fHouse = house;
  39. fHouse_Letter=hletter;
  40. fFlat = flat;
  41. fCode_begin = cbegin;
  42. fCode_end = cend; }
  43.  
  44. //Copy constructor //
  45. TAddress(const TAddress&m)
  46. { fStreet=m.fStreet;
  47. fCity=m.fCity;
  48. fHouse=m.fHouse;
  49. fHouse_Letter=m.fHouse_Letter;
  50. fFlat=m.fFlat;
  51. fCode_begin=m.fCode_begin;
  52. fCode_end=m.fCode_end; }
  53.  
  54. //Operator =//
  55. TAddress operator=(const TAddress&m)
  56. { if (this!=&m)
  57. { fStreet=m.fStreet;
  58. fCity=m.fCity;
  59. fHouse=m.fHouse;
  60. fHouse_Letter=m.fHouse_Letter;
  61. fFlat=m.fFlat;
  62. fCode_begin=m.fCode_begin;
  63. fCode_end=m.fCode_end; }
  64. return (*this); }
  65.  
  66. //Methods Get//
  67. string getStreet()
  68. { return(fStreet); }
  69.  
  70. int getHouse()
  71. { return(fHouse);}
  72.  
  73. string getHouseLetter()
  74. { return(fHouse_Letter);}
  75.  
  76. int getFlat()
  77. { return(fFlat);}
  78.  
  79. int getCode_begin()
  80. {return(fCode_begin);}
  81.  
  82. int getCode_end()
  83. {return(fCode_end);}
  84.  
  85. string getCity()
  86. { return(fCity); }
  87.  
  88. string getCode()
  89. { return(fCode); }
  90.  
  91.  
  92. //Methods Set//
  93. void setStreet(string street)
  94. { fStreet = street; }
  95.  
  96. void setCity(string city)
  97. { fCity = city; }
  98.  
  99. void setHouse( int h)
  100. { fHouse = h;}
  101.  
  102. void setHouse_Letter ( string hl)
  103. { fHouse_Letter = hl; }
  104.  
  105. void setFlat( int f)
  106. {fFlat = f;}
  107.  
  108. void setCode(string code)
  109. { char begin_code[2];
  110. begin_code[0]=code[0];
  111. begin_code[1]=code[1];
  112. fCode_begin=atoi(begin_code);
  113. char end_code[3];
  114. end_code[0]=code[3];
  115. end_code[1]=code[4];
  116. end_code[2]=code[5];
  117. fCode_end=atoi(end_code);
  118. for(int i=0;i++;i<6)
  119. fCode[i]=code[i]; }
  120.  
  121. };
  122.  
  123. //Class Pesel//
  124. class TPESEL
  125. { private:
  126. int fYear;
  127. int fMonth;
  128. int fDay;
  129. int fAge;
  130. string fSex;
  131. string fPesel;
  132.  
  133. public:
  134. //Initializing constructor//
  135. TPESEL(){}
  136.  
  137. //Parametric constructor//
  138. TPESEL(string pesel)
  139. {
  140. //Control-Check
  141. string checker;
  142. int intpesel[11];
  143. for (int i=0;i<11;i++)
  144. {checker[0]=pesel[i];
  145. intpesel[i]=atoi(checker.c_str()); }
  146. int fSum = intpesel[0] + 3*intpesel[1] + 7*intpesel[2] + 9*intpesel[3] + intpesel[4] + 3*intpesel[5] + 7*intpesel[6] + 9*intpesel[7] + intpesel[8] + 3*intpesel[9];
  147. int fRest = fSum%10;
  148.  
  149. //Month//
  150. string m;
  151. for (int i = 2; i < 4; i++)
  152. m[i-2] = pesel[i];
  153. int mMonth = atoi(m.c_str());
  154. if (mMonth>12)
  155. fMonth=mMonth-20;
  156. else
  157. fMonth=mMonth;
  158.  
  159. //Year//
  160. string k;
  161. if (mMonth>12)
  162. k="20";
  163. else
  164. k="19";
  165. for (int i = 0; i < 2; i++)
  166. k[i+2] = pesel[i];
  167. fYear = atoi(k.c_str());
  168.  
  169. //Day//
  170. string d;
  171. for (int i = 4; i < 6; i++)
  172. d[i-4] = pesel[i];
  173. fDay = atoi(d.c_str());
  174.  
  175. //Age//
  176. if (cMonth>fMonth)
  177. fAge = cYear - fYear;
  178. else
  179. { if (cMonth<fMonth)
  180. fAge = cYear - fYear - 1;
  181. else
  182. {if (cDay<fDay)
  183. fAge = cYear - fYear - 1;
  184. else
  185. fAge = cYear - fYear; } }
  186.  
  187. //Sex//
  188. if (intpesel[9]%2==1)
  189. fSex="Male";
  190. else
  191. fSex="Female";
  192.  
  193.  
  194. //Pesel//
  195. for (int i=0;i<11;i++)
  196. fPesel[i]=pesel[i];
  197.  
  198. if (fRest!=(10-intpesel[10])) //invalid PESEL
  199. fPesel="INVALID PESEL";
  200.  
  201. }
  202.  
  203. //COPY CONTRUSCTOR//
  204. TPESEL(const TPESEL&m)
  205. { fYear = m.fYear;
  206. fMonth = m.fMonth;
  207. fDay = m.fDay;
  208. fAge = m.fAge;
  209. fSex = m.fSex;
  210. fPesel = m.fPesel; }
  211.  
  212. //OPERATOR =//
  213. TPESEL operator=(const TPESEL&m)
  214. {
  215. if (this != &m)
  216. {
  217. fYear = m.fYear;
  218. fMonth = m.fMonth;
  219. fDay = m.fDay;
  220. fAge = m.fAge;
  221. fSex = m.fSex;
  222. fPesel = m.fPesel; }
  223. return (*this);
  224. }
  225. //methods get//
  226. int getAge()
  227. { return (fAge);}
  228.  
  229. int getDay()
  230. { return (fDay);}
  231.  
  232. int getMonth()
  233. { return (fMonth);}
  234.  
  235. int getYear()
  236. { return (fYear);}
  237.  
  238. string getSex()
  239. { return (fSex);}
  240.  
  241. string getPesel()
  242. { return (fPesel);}
  243.  
  244.  
  245. };
  246.  
  247. //Class Person//
  248. class TPerson
  249. { public:
  250.  
  251. string fName;
  252. string fSurname;
  253. TAddress fAddress;
  254. TPESEL fPESEL_P;
  255.  
  256. //Initializing constructor//
  257. TPerson(){}
  258.  
  259. //Parametric constructor//
  260. TPerson(string pname, string sname, string ppesel)
  261. { fName=pname;
  262. fSurname=sname;
  263. TPESEL newpesel(ppesel);
  264. fPESEL_P=newpesel; }
  265.  
  266. //Copy constructor//
  267. TPerson (const TPerson&m)
  268. { fName=m.fName;
  269. fSurname = m.fSurname;
  270. fAddress = m.fAddress;
  271. fPESEL_P=m.fPESEL_P;}
  272.  
  273. //operator=//
  274. TPerson operator=(const TPerson&m)
  275. { if (this!=&m)
  276. {fName=m.fName;
  277. fSurname = m.fSurname;
  278. fAddress = m.fAddress;
  279. fPESEL_P=m.fPESEL_P; }
  280. return (*this); }
  281.  
  282. //Methods GET [Pesel]//
  283. int getAge()
  284. { return (fPESEL_P.getAge());}
  285.  
  286. int getDay()
  287. { return (fPESEL_P.getDay());}
  288.  
  289. int getMonth()
  290. { return (fPESEL_P.getMonth());}
  291.  
  292. int getYear()
  293. { return (fPESEL_P.getYear());}
  294.  
  295. string getSex()
  296. { return (fPESEL_P.getSex());}
  297.  
  298. string getPesel()
  299. { return (fPESEL_P.getPesel());}
  300.  
  301. //Methods SET [Pesel]//
  302. void setPesel(string pesel)
  303. { TPESEL newpesel(pesel);
  304. fPESEL_P=newpesel; }
  305.  
  306. //Methods SET [Address]//
  307. void setStreet(string street)
  308. { fAddress.setStreet(street); }
  309.  
  310. void setCity(string city)
  311. { fAddress.setCity(city); }
  312.  
  313. void setHouse( int h)
  314. { fAddress.setHouse(h);}
  315.  
  316. void setHouse_Letter ( string hl)
  317. { fAddress.setHouse_Letter(hl); }
  318.  
  319. void setFlat( int f)
  320. { fAddress.setFlat(f);}
  321.  
  322. void setCode(string code)
  323. { fAddress.setCode(code);}
  324.  
  325. //Methods Get [Address]//
  326.  
  327. string getStreet()
  328. { return(fAddress.getStreet()); }
  329.  
  330. int getHouse()
  331. { return(fAddress.getHouse());}
  332.  
  333. string getHouseLetter()
  334. { return(fAddress.getHouseLetter());}
  335.  
  336. int getFlat()
  337. { return(fAddress.getFlat());}
  338.  
  339. int getCode_begin()
  340. {return(fAddress.getCode_begin());}
  341.  
  342. int getCode_end()
  343. {return(fAddress.getCode_end());}
  344.  
  345. string getCity()
  346. { return(fAddress.getCity()); }
  347.  
  348. string getCode()
  349. { return(fAddress.getCode()); }
  350.  
  351. //Get Name, Surname//
  352. string getName()
  353. { return (fName);}
  354.  
  355. string getSurname()
  356. { return (fSurname);}
  357.  
  358. };
  359.  
  360. class DB
  361. {
  362. public:
  363. vector <TPerson> dataBase;
  364.  
  365.  
  366.  
  367.  
  368. //Initializing constructor//
  369. DB(){}
  370. //Copy constructor
  371. DB(const DB&m)
  372. {}
  373.  
  374. //Add and Remove people from DataBase//
  375. void addPerson(TPerson newPerson)
  376. { dataBase.push_back(newPerson); }
  377.  
  378. void removePerson(string pesel)
  379. { for (int i=0;dataBase.size();i++)
  380. { if (dataBase[i].getPesel()==pesel)
  381. { dataBase.erase(dataBase.begin()+i);
  382. i--; } } }
  383.  
  384. //Find Person//
  385. /*nie dziala
  386. string findNameByPesel(string pesel)
  387. { string answer="Not Found";
  388. for (int i=0;dataBase.size();i++)
  389. { if (dataBase[i].getPesel()==pesel)
  390. { answer= dataBase[i].getName() + " " + dataBase[i].getSurname();
  391. break; }
  392. return(answer); } }
  393.  
  394. string findPeselByName (string name, string surname)
  395. {}
  396. */
  397.  
  398. };
  399.  
  400.  
  401.  
  402.  
  403. int main()
  404. {
  405. TPerson nowy("Jacek","Ziembla","93071308496");
  406.  
  407. nowy.setStreet("Orlich Gniazd");
  408. nowy.setHouse(31);
  409. nowy.setCity("Krakow");
  410. nowy.setCode("31-335");
  411.  
  412. cout << "Name: " << nowy.fName << endl;
  413. cout << "Surname: " << nowy.fSurname << endl;
  414. cout << "Born: " << nowy.getDay() << '-' << nowy.getMonth() << '-'<< nowy.getYear() << endl;
  415. cout << "Age: " << nowy.getAge() << endl;
  416. cout << "Sex: " << nowy.getSex() << endl;
  417. cout << "PESEL: " << nowy.getPesel().c_str() << endl;
  418. cout << "Address: " << nowy.getStreet().c_str() << " " << nowy.getHouse() << "," << endl;
  419. cout << " " << nowy.getCode_begin() << '-' << nowy.getCode_end() << ", " << nowy.getCity().c_str() << endl;
  420.  
  421. TPerson a1("Dariusz","Staszczyk","07321909230");
  422. TPerson a2("Muniek","Staszczyk","98021311195");
  423. TPerson a3("Mariusz","Stachu","60012015858");
  424. TPerson a4("Omar","Juras","71080306791");
  425. TPerson a5("Witalij","Kliczko","71082102432");
  426.  
  427.  
  428. DB mybase;
  429. mybase.addPerson(nowy);
  430. mybase.addPerson(a1);
  431. mybase.addPerson(a2);
  432. mybase.addPerson(a3);
  433. mybase.addPerson(a4);
  434. mybase.addPerson(a5);
  435.  
  436.  
  437. //cout << mybase.findNameByPesel("60012015858").c_str;
  438.  
  439. system("PAUSE");
  440. return EXIT_SUCCESS;
  441. }
  442.  
  443. #include <cstring>
  444. using namespace std;
  445.  
  446. //Current Date//
  447. int cDay = 18; //[1-31]
  448. int cMonth = 11; //[1-12]
  449. int cYear = 2014;
  450. string digits = "01234567890";
  451.  
  452.  
  453. //Class Address//
  454. class TAddress
  455. {private:
  456. string fStreet;
  457. string fCity;
  458. int fHouse;
  459. string fHouse_Letter;
  460. int fFlat;
  461. int fCode_begin;
  462. int fCode_end;
  463. char fCode[6];
  464.  
  465. public:
  466. //Initializing constructor//
  467. TAddress() {}
  468.  
  469. //Parametric constructor//
  470. TAddress(string street, string city, int house, string hletter, int flat, int cbegin, int cend)
  471. { fStreet = street;
  472. fCity = city;
  473. fHouse = house;
  474. fHouse_Letter=hletter;
  475. fFlat = flat;
  476. fCode_begin = cbegin;
  477. fCode_end = cend; }
  478.  
  479. //Copy constructor //
  480. TAddress(const TAddress&m)
  481. { fStreet=m.fStreet;
  482. fCity=m.fCity;
  483. fHouse=m.fHouse;
  484. fHouse_Letter=m.fHouse_Letter;
  485. fFlat=m.fFlat;
  486. fCode_begin=m.fCode_begin;
  487. fCode_end=m.fCode_end; }
  488.  
  489. //Operator =//
  490. TAddress operator=(const TAddress&m)
  491. { if (this!=&m)
  492. { fStreet=m.fStreet;
  493. fCity=m.fCity;
  494. fHouse=m.fHouse;
  495. fHouse_Letter=m.fHouse_Letter;
  496. fFlat=m.fFlat;
  497. fCode_begin=m.fCode_begin;
  498. fCode_end=m.fCode_end; }
  499. return (*this); }
  500.  
  501. //Methods Get//
  502. string getStreet()
  503. { return(fStreet); }
  504.  
  505. int getHouse()
  506. { return(fHouse);}
  507.  
  508. string getHouseLetter()
  509. { return(fHouse_Letter);}
  510.  
  511. int getFlat()
  512. { return(fFlat);}
  513.  
  514. int getCode_begin()
  515. {return(fCode_begin);}
  516.  
  517. int getCode_end()
  518. {return(fCode_end);}
  519.  
  520. string getCity()
  521. { return(fCity); }
  522.  
  523. string getCode()
  524. { return(fCode); }
  525.  
  526.  
  527. //Methods Set//
  528. void setStreet(string street)
  529. { fStreet = street; }
  530.  
  531. void setCity(string city)
  532. { fCity = city; }
  533.  
  534. void setHouse( int h)
  535. { fHouse = h;}
  536.  
  537. void setHouse_Letter ( string hl)
  538. { fHouse_Letter = hl; }
  539.  
  540. void setFlat( int f)
  541. {fFlat = f;}
  542.  
  543. void setCode(string code)
  544. { char begin_code[2];
  545. begin_code[0]=code[0];
  546. begin_code[1]=code[1];
  547. fCode_begin=atoi(begin_code);
  548. char end_code[3];
  549. end_code[0]=code[3];
  550. end_code[1]=code[4];
  551. end_code[2]=code[5];
  552. fCode_end=atoi(end_code);
  553. for(int i=0;i++;i<6)
  554. fCode[i]=code[i]; }
  555.  
  556. };
  557.  
  558. //Class Pesel//
  559. class TPESEL
  560. { private:
  561. int fYear;
  562. int fMonth;
  563. int fDay;
  564. int fAge;
  565. string fSex;
  566. string fPesel;
  567.  
  568. public:
  569. //Initializing constructor//
  570. TPESEL(){}
  571.  
  572. //Parametric constructor//
  573. TPESEL(string pesel)
  574. {
  575. //Control-Check
  576. string checker;
  577. int intpesel[11];
  578. for (int i=0;i<11;i++)
  579. {checker[0]=pesel[i];
  580. intpesel[i]=atoi(checker.c_str()); }
  581. int fSum = intpesel[0] + 3*intpesel[1] + 7*intpesel[2] + 9*intpesel[3] + intpesel[4] + 3*intpesel[5] + 7*intpesel[6] + 9*intpesel[7] + intpesel[8] + 3*intpesel[9];
  582. int fRest = fSum%10;
  583.  
  584. //Month//
  585. string m;
  586. for (int i = 2; i < 4; i++)
  587. m[i-2] = pesel[i];
  588. int mMonth = atoi(m.c_str());
  589. if (mMonth>12)
  590. fMonth=mMonth-20;
  591. else
  592. fMonth=mMonth;
  593.  
  594. //Year//
  595. string k;
  596. if (mMonth>12)
  597. k="20";
  598. else
  599. k="19";
  600. for (int i = 0; i < 2; i++)
  601. k[i+2] = pesel[i];
  602. fYear = atoi(k.c_str());
  603.  
  604. //Day//
  605. string d;
  606. for (int i = 4; i < 6; i++)
  607. d[i-4] = pesel[i];
  608. fDay = atoi(d.c_str());
  609.  
  610. //Age//
  611. if (cMonth>fMonth)
  612. fAge = cYear - fYear;
  613. else
  614. { if (cMonth<fMonth)
  615. fAge = cYear - fYear - 1;
  616. else
  617. {if (cDay<fDay)
  618. fAge = cYear - fYear - 1;
  619. else
  620. fAge = cYear - fYear; } }
  621.  
  622. //Sex//
  623. if (intpesel[9]%2==1)
  624. fSex="Male";
  625. else
  626. fSex="Female";
  627.  
  628.  
  629. //Pesel//
  630. for (int i=0;i<11;i++)
  631. fPesel[i]=pesel[i];
  632.  
  633. if (fRest!=(10-intpesel[10])) //invalid PESEL
  634. fPesel="INVALID PESEL";
  635.  
  636. }
  637.  
  638. //COPY CONTRUSCTOR//
  639. TPESEL(const TPESEL&m)
  640. { fYear = m.fYear;
  641. fMonth = m.fMonth;
  642. fDay = m.fDay;
  643. fAge = m.fAge;
  644. fSex = m.fSex;
  645. fPesel = m.fPesel; }
  646.  
  647. //OPERATOR =//
  648. TPESEL operator=(const TPESEL&m)
  649. {
  650. if (this != &m)
  651. {
  652. fYear = m.fYear;
  653. fMonth = m.fMonth;
  654. fDay = m.fDay;
  655. fAge = m.fAge;
  656. fSex = m.fSex;
  657. fPesel = m.fPesel; }
  658. return (*this);
  659. }
  660. //methods get//
  661. int getAge()
  662. { return (fAge);}
  663.  
  664. int getDay()
  665. { return (fDay);}
  666.  
  667. int getMonth()
  668. { return (fMonth);}
  669.  
  670. int getYear()
  671. { return (fYear);}
  672.  
  673. string getSex()
  674. { return (fSex);}
  675.  
  676. string getPesel()
  677. { return (fPesel);}
  678.  
  679.  
  680. };
  681.  
  682. //Class Person//
  683. class TPerson
  684. { public:
  685.  
  686. string fName;
  687. string fSurname;
  688. TAddress fAddress;
  689. TPESEL fPESEL_P;
  690.  
  691. //Initializing constructor//
  692. TPerson(){}
  693.  
  694. //Parametric constructor//
  695. TPerson(string pname, string sname, string ppesel)
  696. { fName=pname;
  697. fSurname=sname;
  698. TPESEL newpesel(ppesel);
  699. fPESEL_P=newpesel; }
  700.  
  701. //Copy constructor//
  702. TPerson (const TPerson&m)
  703. { fName=m.fName;
  704. fSurname = m.fSurname;
  705. fAddress = m.fAddress;
  706. fPESEL_P=m.fPESEL_P;}
  707.  
  708. //operator=//
  709. TPerson operator=(const TPerson&m)
  710. { if (this!=&m)
  711. {fName=m.fName;
  712. fSurname = m.fSurname;
  713. fAddress = m.fAddress;
  714. fPESEL_P=m.fPESEL_P; }
  715. return (*this); }
  716.  
  717. //Methods GET [Pesel]//
  718. int getAge()
  719. { return (fPESEL_P.getAge());}
  720.  
  721. int getDay()
  722. { return (fPESEL_P.getDay());}
  723.  
  724. int getMonth()
  725. { return (fPESEL_P.getMonth());}
  726.  
  727. int getYear()
  728. { return (fPESEL_P.getYear());}
  729.  
  730. string getSex()
  731. { return (fPESEL_P.getSex());}
  732.  
  733. string getPesel()
  734. { return (fPESEL_P.getPesel());}
  735.  
  736. //Methods SET [Pesel]//
  737. void setPesel(string pesel)
  738. { TPESEL newpesel(pesel);
  739. fPESEL_P=newpesel; }
  740.  
  741. //Methods SET [Address]//
  742. void setStreet(string street)
  743. { fAddress.setStreet(street); }
  744.  
  745. void setCity(string city)
  746. { fAddress.setCity(city); }
  747.  
  748. void setHouse( int h)
  749. { fAddress.setHouse(h);}
  750.  
  751. void setHouse_Letter ( string hl)
  752. { fAddress.setHouse_Letter(hl); }
  753.  
  754. void setFlat( int f)
  755. { fAddress.setFlat(f);}
  756.  
  757. void setCode(string code)
  758. { fAddress.setCode(code);}
  759.  
  760. //Methods Get [Address]//
  761.  
  762. string getStreet()
  763. { return(fAddress.getStreet()); }
  764.  
  765. int getHouse()
  766. { return(fAddress.getHouse());}
  767.  
  768. string getHouseLetter()
  769. { return(fAddress.getHouseLetter());}
  770.  
  771. int getFlat()
  772. { return(fAddress.getFlat());}
  773.  
  774. int getCode_begin()
  775. {return(fAddress.getCode_begin());}
  776.  
  777. int getCode_end()
  778. {return(fAddress.getCode_end());}
  779.  
  780. string getCity()
  781. { return(fAddress.getCity()); }
  782.  
  783. string getCode()
  784. { return(fAddress.getCode()); }
  785.  
  786. //Get Name, Surname//
  787. string getName()
  788. { return (fName);}
  789.  
  790. string getSurname()
  791. { return (fSurname);}
  792.  
  793. };
  794.  
  795. class DB
  796. {
  797. public:
  798. vector <TPerson> dataBase;
  799.  
  800.  
  801.  
  802.  
  803. //Initializing constructor//
  804. DB(){}
  805. //Copy constructor
  806. DB(const DB&m)
  807. {}
  808.  
  809. //Add and Remove people from DataBase//
  810. void addPerson(TPerson newPerson)
  811. { dataBase.push_back(newPerson); }
  812.  
  813. void removePerson(string pesel)
  814. { for (int i=0;dataBase.size();i++)
  815. { if (dataBase[i].getPesel()==pesel)
  816. { dataBase.erase(dataBase.begin()+i);
  817. i--; } } }
  818.  
  819. //Find Person//
  820. /*nie dziala
  821. string findNameByPesel(string pesel)
  822. { string answer="Not Found";
  823. for (int i=0;dataBase.size();i++)
  824. { if (dataBase[i].getPesel()==pesel)
  825. { answer= dataBase[i].getName() + " " + dataBase[i].getSurname();
  826. break; }
  827. return(answer); } }
  828.  
  829. string findPeselByName (string name, string surname)
  830. {}
  831. */
  832.  
  833. };
  834.  
  835.  
  836.  
  837.  
  838. int main()
  839. {
  840. TPerson nowy("Jacek","Ziembla","93071308496");
  841.  
  842. nowy.setStreet("Orlich Gniazd");
  843. nowy.setHouse(31);
  844. nowy.setCity("Krakow");
  845. nowy.setCode("31-335");
  846.  
  847. cout << "Name: " << nowy.fName << endl;
  848. cout << "Surname: " << nowy.fSurname << endl;
  849. cout << "Born: " << nowy.getDay() << '-' << nowy.getMonth() << '-'<< nowy.getYear() << endl;
  850. cout << "Age: " << nowy.getAge() << endl;
  851. cout << "Sex: " << nowy.getSex() << endl;
  852. cout << "PESEL: " << nowy.getPesel().c_str() << endl;
  853. cout << "Address: " << nowy.getStreet().c_str() << " " << nowy.getHouse() << "," << endl;
  854. cout << " " << nowy.getCode_begin() << '-' << nowy.getCode_end() << ", " << nowy.getCity().c_str() << endl;
  855.  
  856. TPerson a1("Dariusz","Staszczyk","07321909230");
  857. TPerson a2("Muniek","Staszczyk","98021311195");
  858. TPerson a3("Mariusz","Stachu","60012015858");
  859. TPerson a4("Omar","Juras","71080306791");
  860. TPerson a5("Witalij","Kliczko","71082102432");
  861.  
  862.  
  863. DB mybase;
  864. mybase.addPerson(nowy);
  865. mybase.addPerson(a1);
  866. mybase.addPerson(a2);
  867. mybase.addPerson(a3);
  868. mybase.addPerson(a4);
  869. mybase.addPerson(a5);
  870.  
  871.  
  872. //cout << mybase.findNameByPesel("60012015858").c_str;
  873.  
  874. system("PAUSE");
  875. return EXIT_SUCCESS;
  876. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement