Advertisement
Guest User

final

a guest
Jan 23rd, 2019
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.19 KB | None | 0 0
  1. #include<iostream>
  2. #include<math.h>
  3. #include<cstdlib>
  4. #include<string>
  5.  
  6. using namespace std;
  7. class person
  8. {
  9. protected:
  10. int id;
  11.  
  12. string name;
  13. int age;
  14. string gender;
  15. int cell;
  16. double salary;
  17. public:
  18. void set_fieldname();
  19. void get_fieldname();
  20.  
  21.  
  22.  
  23. void in_id();
  24. int get_id()
  25. {
  26. return (id);
  27. }
  28. void in_name();
  29. string get_name()
  30. {
  31. return (name);
  32. }
  33.  
  34. void in_age();
  35. int get_age()
  36. {
  37. return (age);
  38. }
  39. void in_gender();
  40. string get_gender()
  41. {
  42. return (gender);
  43. }
  44. void in_cell();
  45. int get_cell()
  46. {
  47. return (cell);
  48. }
  49. void in_firstname();
  50.  
  51. int out_id();
  52.  
  53.  
  54.  
  55. };
  56. class owners: public person
  57. {
  58. private:
  59.  
  60. double share;
  61. int moneyinacc;
  62. int bankacc;
  63. public:
  64. void addowner();
  65. void set_ownerfield()
  66. {
  67. set_fieldname();
  68. cout<<"SHARE: ";
  69. while(!(cin>>share))
  70. {
  71. cout << "Please enter a number! Try again: ";
  72. cin.clear ();
  73. cin.ignore (1000, '\n');
  74. }
  75. }
  76. void get_ownerfield()
  77. {
  78. cout<<name<<"\t\t "<<id<<"\t\t"<<gender<<"\t\t"<<age<<"\t "<<share<<endl;
  79.  
  80. }
  81.  
  82. void in_share();
  83. int get_share();
  84. double in_moneyinaccount();
  85. double get_moneyinaccount();
  86. double in_bankaccount();
  87. double get_bankaccount();
  88.  
  89.  
  90. };
  91. class manager: public person
  92. {
  93. private:
  94.  
  95. int salary;
  96. int bankacc;
  97. public:
  98. void addmanager();
  99. void set_managerfield()
  100. {
  101. set_fieldname();
  102. cout<<"salary=";
  103. while(!(cin>>salary))
  104. {
  105. cout << "Please enter a number! Try again: ";
  106. cin.clear ();
  107. cin.ignore (1000, '\n');
  108. }
  109. }
  110. void get_managerfield()
  111. {
  112. cout<<name<<"\t\t "<<id<<"\t\t"<<gender<<"\t\t"<<age<<"\t "<<salary<<endl;
  113. }
  114.  
  115. void in_salary();
  116. double get_salary();
  117. double in_bankacc();
  118. double get_bankacc();
  119. };
  120. class salesman: public person
  121. {
  122. private:
  123.  
  124. int salary;
  125. int bankacc;
  126. int joiningdate;
  127.  
  128. string sellingtype;
  129. public:
  130. void addsalesman();
  131. void set_salesmanfield()
  132. {
  133. set_fieldname();
  134. cout<<"SALARY: ";
  135. while(!(cin>>salary))
  136. {
  137. cout << "Please enter a number! Try again: ";
  138. cin.clear ();
  139. cin.ignore (1000, '\n');
  140. }
  141. cout<<"JOININGDATE: ";
  142. while(!(cin>>joiningdate))
  143. {
  144. cout << "Please enter a number! Try again: ";
  145. cin.clear ();
  146. cin.ignore (1000, '\n');
  147. }
  148. }
  149. void get_salesmanfield()
  150. {
  151. cout<<name<<"\t\t "<<id<<"\t\t"<<gender<<"\t\t"<<age<<"\t "<<salary<<"\t "<<joiningdate<<endl;
  152. }
  153. void in_salaryy();
  154. void in_bankac();
  155. void in_sellingtype();
  156. void get_sellingtype();
  157. void get_salaryy();
  158. void get_bankac();
  159. };
  160. class client: public person
  161. {
  162. private:
  163. string purchase;
  164. public:
  165. void addclient();
  166. void set_clientfield()
  167. {
  168. cout<<"Name=";
  169.  
  170. while(!(cin>>name))
  171. {
  172. cout << "Please enter a string! Try again: ";
  173. cin.clear ();
  174. cin.ignore (1000, '\n');
  175. }
  176. cout<<"Gender=";
  177.  
  178. while(!(cin>>gender))
  179. {
  180. cout << "Please enter a string! Try again: ";
  181. cin.clear ();
  182. cin.ignore (1000, '\n');
  183. }
  184.  
  185. cout<<"Age=";
  186. while(!(cin>>age))
  187. {
  188. cout << "Please enter a number! Try again: ";
  189. cin.clear ();
  190. cin.ignore (1000, '\n');
  191. }
  192. cout<<"ID=";
  193.  
  194. while(!(cin>>id))
  195. {
  196. cout << "Please enter a number! Try again: ";
  197. cin.clear ();
  198. cin.ignore (1000, '\n');
  199. }
  200. cout<<"product bought=";
  201. while(!(cin>>purchase))
  202. {
  203. cout << "Please enter a string! Try again: ";
  204. cin.clear ();
  205. cin.ignore (1000, '\n');
  206. }
  207.  
  208.  
  209.  
  210. }
  211.  
  212.  
  213. void get_clientfield()
  214. {
  215. cout<<name<<"\t\t "<<id<<"\t\t"<<gender<<"\t\t"<<age<<"\t "<<purchase<<endl;
  216. }
  217. void in_purchase();
  218. void get_purchase();
  219. };
  220. class product
  221. {
  222. protected:
  223. int id;
  224. string name;
  225. double price;
  226. string brand;
  227. string origin;
  228. double vat;
  229. double discount;
  230. public:
  231. void addproduct();
  232. void in_id();
  233. void get_id();
  234. void in_name();
  235. void get_name();
  236. void in_brand();
  237. void get_brand();
  238. };
  239. class food: public product
  240. {
  241. private:
  242. double expdate;
  243. double quantity;
  244. public:
  245. void addfood();
  246. void set_foodfield()
  247. {
  248. cout<<"Name=";
  249.  
  250. while(!(cin>>name))
  251. {
  252. cout << "Please enter a string! Try again: ";
  253. cin.clear ();
  254. cin.ignore (1000, '\n');
  255. }
  256. cout<<"Brand=";
  257.  
  258. while(!(cin>>brand))
  259. {
  260. cout << "Please enter a string! Try again: ";
  261. cin.clear ();
  262. cin.ignore (1000, '\n');
  263. }
  264.  
  265. cout<<"Origin=";
  266. while(!(cin>>origin))
  267. {
  268. cout << "Please enter a string! Try again: ";
  269. cin.clear ();
  270. cin.ignore (1000, '\n');
  271. }
  272. cout<<"ID=";
  273.  
  274. while(!(cin>>id))
  275. {
  276. cout << "Please enter a number! Try again: ";
  277. cin.clear ();
  278. cin.ignore (1000, '\n');
  279. }
  280. cout<<"Price=";
  281. while(!(cin>>price))
  282. {
  283. cout << "Please enter a number! Try again: ";
  284. cin.clear ();
  285. cin.ignore (1000, '\n');
  286. }
  287.  
  288.  
  289. }
  290.  
  291.  
  292.  
  293. void get_foodfield()
  294. {
  295. cout<<id<<"\t\t"<<name<<"\t\t"<<brand<<"\t\t"<<origin<<"\t\t"<<price<<endl;
  296. }
  297. void in_expdate();
  298. void get_expdate();
  299. void in_quantity();
  300. void get_quantity();
  301.  
  302. };
  303. class electronics: public product
  304. {
  305. private:
  306. int warrenty;
  307. int quantity;
  308. public:
  309. void set_electronicfield() {
  310. cout<<"Name=";
  311.  
  312. while(!(cin>>name))
  313. {
  314. cout << "Please enter a string! Try again: ";
  315. cin.clear ();
  316. cin.ignore (1000, '\n');
  317. }
  318. cout<<"Brand=";
  319.  
  320. while(!(cin>>brand))
  321. {
  322. cout << "Please enter a string! Try again: ";
  323. cin.clear ();
  324. cin.ignore (1000, '\n');
  325. }
  326.  
  327. cout<<"Origin=";
  328. while(!(cin>>origin))
  329. {
  330. cout << "Please enter a string! Try again: ";
  331. cin.clear ();
  332. cin.ignore (1000, '\n');
  333. }
  334. cout<<"ID=";
  335.  
  336. while(!(cin>>id))
  337. {
  338. cout << "Please enter a number! Try again: ";
  339. cin.clear ();
  340. cin.ignore (1000, '\n');
  341. }
  342. cout<<"Price=";
  343. while(!(cin>>price))
  344. {
  345. cout << "Please enter a number! Try again: ";
  346. cin.clear ();
  347. cin.ignore (1000, '\n');
  348. }
  349. cout<<"Warranty=";
  350. while(!(cin>>warrenty))
  351. {
  352. cout << "Please enter a number! Try again: ";
  353. cin.clear ();
  354. cin.ignore (1000, '\n');
  355. }
  356.  
  357.  
  358. }
  359.  
  360.  
  361. void get_electronicfield()
  362. {
  363. cout<< id<<" "<<name<<" "<<brand<<"\t "<<origin<<"\t"<<price<<"\t\t"<<warrenty<<endl;
  364. }
  365. void addelectronic();
  366. void get_warrenty();
  367. void in_warrenty();
  368. void get_quantity();
  369. void in_quantity();
  370. };
  371. class cosmetics: public product
  372. {
  373. private:
  374. double expdate;
  375. int quantity;
  376. public:
  377. void addcosmetic();
  378. void set_cosmeticfield()
  379. {
  380. cout<<"Name=";
  381.  
  382. while(!(cin>>name))
  383. {
  384. cout << "Please enter a string! Try again: ";
  385. cin.clear ();
  386. cin.ignore (1000, '\n');
  387. }
  388. cout<<"Brand=";
  389.  
  390. while(!(cin>>brand))
  391. {
  392. cout << "Please enter a string! Try again: ";
  393. cin.clear ();
  394. cin.ignore (1000, '\n');
  395. }
  396.  
  397. cout<<"Origin=";
  398. while(!(cin>>origin))
  399. {
  400. cout << "Please enter a string! Try again: ";
  401. cin.clear ();
  402. cin.ignore (1000, '\n');
  403. }
  404. cout<<"ID=";
  405.  
  406. while(!(cin>>id))
  407. {
  408. cout << "Please enter a number! Try again: ";
  409. cin.clear ();
  410. cin.ignore (1000, '\n');
  411. }
  412. cout<<"Price=";
  413. while(!(cin>>price))
  414. {
  415. cout << "Please enter a number! Try again: ";
  416. cin.clear ();
  417. cin.ignore (1000, '\n');
  418. }
  419. cout<<"Quantity=";
  420. while(!(cin>>quantity))
  421. {
  422. cout << "Please enter a number! Try again: ";
  423. cin.clear ();
  424. cin.ignore (1000, '\n');
  425. }
  426.  
  427.  
  428. }
  429.  
  430. void get_cosmeticfield()
  431. {
  432. cout<<" "<< id<<" "<<name<<" "<<brand<<"\t"<<origin<<"\t "<<price<<"\t\t"<<quantity<<endl;
  433. }
  434. void get_expdate();
  435. void in_expdate();
  436. void get_quantity();
  437. void in_quantity();
  438. };
  439. void:: owners::addowner()
  440. {
  441. int b;
  442. char redo;
  443. do{
  444.  
  445.  
  446. int n=0;
  447. n++;
  448.  
  449.  
  450.  
  451. set_ownerfield();
  452.  
  453. cout<<"\nOwner information has been added:"<<endl;
  454. cout<<"\n id Name gender age Share(%) \n";
  455. cout<<"\n---------- --------- -------- ------- --------\n"<<endl;
  456.  
  457. for(int i=0;i<n;i++){
  458.  
  459. get_ownerfield();
  460. }
  461. cout<<endl;
  462. cout<<"do you want to add another:"<<endl;
  463. cin>>redo;
  464. }
  465. while(redo=='y'||redo=='Y');
  466.  
  467.  
  468.  
  469. }
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476. void::manager::addmanager()
  477. {
  478. char redo;
  479. do{
  480.  
  481. int i=0;
  482. set_managerfield();
  483.  
  484.  
  485. cout<<"\nManager information has been added:"<<endl;
  486. cout<<"\n id Name gender age salary\n"<<endl;
  487. cout<<"\n---------- --------- -------- ------- ---------\n"<<endl;
  488.  
  489.  
  490.  
  491. // cout<<e[i].get_fieldname()<<endl;
  492. get_managerfield();
  493. cout<<"do you want to add another"<<endl;
  494. cin>>redo;
  495. }
  496. while(redo=='y'||redo=='Y');
  497.  
  498.  
  499. }
  500. void::salesman::addsalesman()
  501. {
  502. char redo;
  503. do{
  504. int i=0;
  505. set_salesmanfield();
  506.  
  507.  
  508. cout<<"\nSalesman information has been added:"<<endl;
  509. cout<<"\n id Name gender age salary joining\n"<<endl;
  510. cout<<"\n---------- --------- -------- ------- --------- -----------\n"<<endl;
  511.  
  512.  
  513.  
  514.  
  515. get_salesmanfield();
  516. cout<<"do you want to add another"<<endl;
  517. cin>>redo;
  518. }
  519. while(redo=='y'||redo=='Y');
  520. }
  521. void::client::addclient()
  522. {
  523. char redo;
  524. do{
  525. int i=0;
  526. set_clientfield();
  527.  
  528.  
  529. cout<<"\nInformation has been added:"<<endl;
  530. cout<<"\n id Name gender age purchase \n"<<endl;
  531. cout<<" ---------- --------- -------- ------- -----------\n"<<endl;
  532.  
  533.  
  534.  
  535.  
  536. get_clientfield();
  537. cout<<"do you want to add another"<<endl;
  538. cin>>redo;
  539. }
  540. while(redo=='y'||redo=='Y');
  541. }
  542. void::food::addfood()
  543. {
  544. char redo;
  545. do{
  546. int i=0;
  547. set_foodfield();
  548.  
  549.  
  550. cout<<"\nInformation has been added:"<<endl;
  551. cout<<"\n id Name Brand Made in price \n"<<endl;
  552. cout<<" ---------- --------- --------- --------- -----------\n"<<endl;
  553.  
  554.  
  555.  
  556.  
  557. get_foodfield();
  558. cout<<"do you want to add another"<<endl;
  559. cin>>redo;
  560. }
  561. while(redo=='y'||redo=='Y');
  562. }
  563. void::electronics::addelectronic()
  564. {
  565. char redo;
  566. do{
  567. int i=0;
  568. set_electronicfield();
  569.  
  570.  
  571. cout<<"\nInformation has been added:"<<endl;
  572. cout<<"\nid Name Brand Made in price warranty\n"<<endl;
  573. cout<<"\n--- -------- ------- -------- ------- ---------\n"<<endl;
  574.  
  575.  
  576.  
  577.  
  578. get_electronicfield();
  579. cout<<"do you want to add another"<<endl;
  580. cin>>redo;
  581. }
  582. while(redo=='y'||redo=='Y');
  583.  
  584. }
  585. void::cosmetics::addcosmetic()
  586. {
  587. char redo;
  588. do{
  589. int i=0;
  590. set_cosmeticfield();
  591.  
  592.  
  593. cout<<"\nInformation has been added:"<<endl;
  594. cout<<"\n id Name Brand Made in price quantity\n"<<endl;
  595. cout<<" ------- -------- ------- -------- -------- -----------\n"<<endl;
  596.  
  597.  
  598.  
  599.  
  600. get_cosmeticfield();
  601. cout<<"do you want to add another"<<endl;
  602. cin>>redo;
  603. }
  604. while(redo=='y'||redo=='Y');
  605.  
  606. }
  607. void::person ::get_fieldname()
  608. {
  609. cout<<id<<"\t\t"<<name<<"\t\t"<<gender<<"\t\t"<<age<<"\t"<<endl;
  610. }
  611.  
  612.  
  613. int::person::out_id()
  614. {
  615. return(id);
  616. }
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624. void::owners::in_share()
  625. {
  626. cin>>share;
  627. }
  628. double::owners::in_moneyinaccount()
  629. {
  630. cin>>moneyinacc;
  631. }
  632. double::owners::in_bankaccount()
  633. {
  634. cin>>bankacc;
  635.  
  636. }
  637. int::owners::get_share()
  638. {
  639. cout<<share<<endl;
  640. }
  641. double::owners::get_moneyinaccount()
  642. {
  643. cout<<moneyinacc<<endl;
  644. }
  645. double::owners::get_bankaccount()
  646. {
  647. cout<<bankacc<<endl;
  648. }
  649. void::manager::in_salary()
  650. {
  651. cin>>salary;
  652. }
  653. double::manager::in_bankacc()
  654. {
  655. cin>>bankacc;
  656. }
  657. double::manager::get_salary()
  658. {
  659. cout<<salary<<endl;
  660. }
  661. double::manager::get_bankacc()
  662. {
  663. cout<<bankacc<<endl;
  664. }
  665. void::salesman::in_salaryy()
  666. {
  667. cin>>salary;
  668. }
  669. void::salesman::in_bankac()
  670. {
  671. cin>>bankacc;
  672. }
  673. void::salesman::in_sellingtype()
  674. {
  675. cin>>sellingtype;
  676. }
  677. void::salesman::get_salaryy()
  678. {
  679. cout<<salary<<endl;
  680. }
  681. void::salesman::get_bankac()
  682. {
  683. cout<<bankacc<<endl;
  684. }
  685. void::salesman::get_sellingtype()
  686. {
  687. cout<<sellingtype<<endl;
  688. }
  689. void::client::in_purchase()
  690. {
  691. cin>>purchase;
  692. }
  693. void::client::get_purchase()
  694. {
  695. cout<<purchase<<endl;
  696. }
  697. void::product::in_id()
  698. {
  699. cin>>id;
  700. }
  701. void::product::in_name()
  702. {
  703. cin>>name;
  704. }
  705.  
  706. void::product::in_brand()
  707. {
  708. cin>>brand;
  709. }
  710. void::product::get_id()
  711. {
  712. cout<<id<<endl;
  713. }
  714. void::product::get_name()
  715. {
  716. cout<<name<<endl;
  717. }
  718. void::product::get_brand()
  719. {
  720. cout<<brand<<endl;
  721. }
  722.  
  723. void::food::in_expdate()
  724. {
  725. cin>>expdate;
  726. }
  727. void::food::get_expdate()
  728. {
  729. cout<<expdate;
  730. }
  731. void::food::in_quantity()
  732. {
  733. cin>>quantity;
  734. }
  735.  
  736. void::food::get_quantity()
  737. {
  738. cout<<quantity<<endl;
  739. }
  740. void::electronics::in_warrenty()
  741. {
  742. cin>>warrenty;
  743. }
  744. void::electronics::get_warrenty()
  745. {
  746. cout<<warrenty;
  747. }
  748. void::electronics::in_quantity()
  749. {
  750. cin>>quantity;
  751. }
  752. void::electronics::get_quantity()
  753. {
  754. cout<<quantity;
  755. }
  756. void::cosmetics::in_expdate()
  757. {
  758. cin>>expdate;
  759. }
  760. void::cosmetics::get_expdate()
  761. {
  762. cout<<expdate<<endl;
  763. }
  764. void::cosmetics::in_quantity()
  765. {
  766. cin>>quantity;
  767. }
  768. void::cosmetics::get_quantity()
  769. {
  770. cout<<quantity<<endl;
  771. }
  772. void::person::set_fieldname()
  773. {
  774. cout<<"Name=";
  775.  
  776. while(!(cin>>name))
  777. {
  778. cout << "Please enter a string! Try again: ";
  779. cin.clear ();
  780. cin.ignore (1000, '\n');
  781. }
  782. cout<<"Gender=";
  783.  
  784. while(!(cin>>gender))
  785. {
  786. cout << "Please enter a string! Try again: ";
  787. cin.clear ();
  788. cin.ignore (1000, '\n');
  789. }
  790.  
  791. cout<<"Age=";
  792. while(!(cin>>age))
  793. {
  794. cout << "Please enter a number! Try again: ";
  795. cin.clear ();
  796. cin.ignore (1000, '\n');
  797. }
  798. cout<<"ID=";
  799.  
  800. while(!(cin>>id))
  801. {
  802. cout << "Please enter a number! Try again: ";
  803. cin.clear ();
  804. cin.ignore (1000, '\n');
  805. }
  806.  
  807.  
  808. }
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817. int main()
  818. {
  819. owners objowner[5];
  820. manager objmanager;
  821. salesman objsalesman;
  822. client objclient;
  823. food objfood;
  824. electronics objelectronic;
  825. cosmetics objcosmetic;
  826. int add_owner_count=0;
  827.  
  828. int c;
  829. char operation,ch;
  830.  
  831. do
  832. {
  833. cout<<"who do you want to know about?\n"<<endl;
  834. cout<<endl;
  835. cout<<endl;
  836.  
  837. cout<<" 1. About Owner"<<endl;
  838. cout<<" 2. About Manager"<<endl;
  839. cout<<" 3. About Salesman"<<endl;
  840. cout<<" 4. About Client"<<endl;
  841. cout<<" 5. About product"<<endl;
  842. cout<<endl;
  843. cout<<"Enter the Serial number you desire: ";
  844. cin>>c;
  845. if(c==1)
  846. {
  847. int x;
  848. char redo;
  849. do{
  850.  
  851.  
  852.  
  853.  
  854. int o;
  855. cout<<"\nOwner information"<<endl;
  856. cout<<endl;
  857. cout<<"1.Add owner"<<endl;
  858. cout<<"2.Delete owner"<<endl;
  859.  
  860. cout<<"3.Search Owner"<<endl;
  861. cout<<endl;
  862. cout<<"enter choice: ";
  863. cin>>o;
  864.  
  865.  
  866.  
  867. if(o==1)
  868. {
  869. cout<<"Enter the information of the owner:"<<endl;
  870. for(int i=add_owner_count;i<5;i++)
  871. {
  872.  
  873.  
  874. objowner[i].addowner();
  875. break;
  876. }
  877.  
  878. }
  879. else if(o==2)
  880. {
  881. cout<<"enter info you want to search"<<endl;
  882.  
  883. }
  884. else if(o==3)
  885. {
  886. cout<<"enter info you want to delete"<<endl;
  887.  
  888. }
  889. cout<<"do you want to continue"<<endl;
  890. cin>>redo;
  891. }
  892. while(redo=='y'||redo=='Y');
  893.  
  894. }
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902. else if(c==2)
  903.  
  904. {
  905. char redo;
  906. do{
  907. int m;
  908. cout<<"\nManager information"<<endl;
  909. cout<<endl;
  910. cout<<"1.Add manager"<<endl;
  911. cout<<"2.Delete manager"<<endl;
  912. cout<<"3.Search Owner"<<endl;
  913. cout<<endl;
  914. cout<<"enter choice: "<<endl;
  915. cin>>m;
  916. if(m==1)
  917. {
  918. cout<<"enter manager information"<<endl;
  919. objmanager.addmanager();
  920.  
  921. }
  922. else if(m==2)
  923. {
  924. cout<<"enter info you want to delete"<<endl;
  925. }
  926. else if(m==3)
  927. {
  928. cout<<"enter info you want to search"<<endl;
  929. }
  930. cout<<"do you want to continue"<<endl;
  931. cin>>redo;
  932. }
  933. while(redo=='y'||redo=='Y');
  934.  
  935. }
  936. else if(c==3)
  937. {
  938. char redo;
  939. do{
  940. cout<<"\nSalesman Information"<<endl;
  941. int s;
  942.  
  943. cout<<endl;
  944. cout<<"1.ADD Salesman"<<endl;
  945. cout<<"2.Delete Salesman"<<endl;
  946. cout<<"3.Search Salesman"<<endl;
  947. cout<<endl;
  948. cout<<"enter choice: "<<endl;
  949. cin>>s;
  950. if(s==1)
  951. {
  952. cout<<"add salesman information"<<endl;
  953. objsalesman.addsalesman();
  954.  
  955. }
  956. else if(s==2)
  957. {
  958. cout<<"delete salesman information"<<endl;
  959. }
  960. else if(s==3)
  961. {
  962. cout<<"search salesman information"<<endl;
  963. }
  964. cout<<"do you want to continue"<<endl;
  965. cin>>redo;
  966. }
  967. while(redo=='y'||redo=='Y');
  968.  
  969. }
  970. else if(c==4)
  971. {
  972. char redo;
  973. do{
  974.  
  975. int x;
  976. cout<<"\nClient information"<<endl;
  977. cout<<endl;
  978. cout<<"1.Add client"<<endl;
  979. cout<<"2.Delete client"<<endl;
  980. cout<<"3.Search client "<<endl;
  981. cout<<endl;
  982. cout<<"enter choice: "<<endl;
  983. cin>>x;
  984. if(x==1)
  985. {
  986. cout<<"Add client information"<<endl;
  987. objclient.addclient();
  988. }
  989. else if(x==2)
  990. {
  991. cout<<"Delete information of client"<<endl;
  992. }
  993. else if(x==3)
  994. {
  995. cout<<"Search information of client"<<endl;
  996. }
  997. cout<<"do you want to continue"<<endl;
  998. cin>>redo;
  999. }
  1000. while(redo=='y'||redo=='Y');
  1001.  
  1002. }
  1003. else if(c==5)
  1004. {
  1005. char redo;
  1006. do{
  1007. int p;
  1008. cout<<"\nProduct information"<<endl;
  1009. cout<<endl;
  1010. cout<<"1.about food"<<endl;
  1011. cout<<"2.about electronics"<<endl;
  1012. cout<<"3.about cosmetics"<<endl;
  1013. cout<<endl;
  1014. cout<<"enter choice: "<<endl;
  1015. cin>>p;
  1016. if(p==1)
  1017. {
  1018. char redo;
  1019.  
  1020. int x;
  1021.  
  1022. cout<<"\nFood information"<<endl;
  1023. cout<<"1.Add food"<<endl;
  1024. cout<<"Enter choice:"<<endl;
  1025. cin>>x;
  1026. if(x==1)
  1027. {
  1028. cout<<"Add food information"<<endl;
  1029. objfood.addfood();
  1030. }
  1031.  
  1032.  
  1033. }
  1034. else if(p==2)
  1035. {
  1036. int x;
  1037. cout<<"\nElectronic information"<<endl;
  1038. cout<<"1.Add electronics"<<endl;
  1039. cout<<"Enter your choice"<<endl;
  1040. cin>>x;
  1041. if(x==1)
  1042. {
  1043. cout<<"Electronics information"<<endl;
  1044. objelectronic.addelectronic();
  1045. }
  1046.  
  1047. }
  1048. else if(p==3)
  1049. {
  1050. int x;
  1051. cout<<"\nCosmetics information"<<endl;
  1052. cout<<"1.Add cosmetics"<<endl;
  1053. cout<<"Enter choice"<<endl;
  1054. cin>>x;
  1055. if(x==1)
  1056. {
  1057. cout<<"cosmetic information"<<endl;
  1058. objcosmetic.addcosmetic();
  1059. }
  1060. }
  1061.  
  1062. cout<<"do you want to go to product menu"<<endl;
  1063. cin>>redo;
  1064. }
  1065.  
  1066. while(redo=='y'||redo=='Y');
  1067.  
  1068. }
  1069.  
  1070.  
  1071.  
  1072. cout<<"do you want to go to main menu"<<endl;
  1073. cin>>ch;
  1074. }
  1075.  
  1076. while(ch=='y'||ch=='Y');
  1077.  
  1078.  
  1079.  
  1080.  
  1081. ;return 0;
  1082.  
  1083.  
  1084.  
  1085.  
  1086. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement