Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4.  
  5. class imp
  6. {
  7. public:
  8. void fn()
  9. {
  10. cout<<" --------****************************------"<<endl;
  11. cout<<" SUPER MARKET BILLING SYSTEM"<<endl;
  12. cout<<" --------****************************------"<<endl;
  13. cout<<"1.BILLING A CUSTOMER.."<<endl;
  14. cout<<"2.DETAILS OF THE ITMES.."<<endl;
  15. cout<<"3.EXIT.."<<endl<<endl;
  16. }
  17. };
  18. class details
  19. {
  20. public:
  21. void fn2()
  22. {
  23. cout<<" ------------DETAILS OF THE ITEMS---------------"<<endl<<endl<<endl;
  24. cout<<"->NAME |->CODE |->PRICE"<<endl;
  25. cout<<"1.Air Wick |1000 |500/- "<<endl;
  26. cout<<"2.Appy Fizz |1001 |50/- "<<endl;
  27. cout<<"3.BB Cream |1002 |350/- "<<endl;
  28. cout<<"4.Bedsheet |1003 |800/- "<<endl;
  29. cout<<"5.Coffee beans |1004 |400/- "<<endl;
  30. cout<<"6.Dairy Milk Silk |1005 |150/- "<<endl;
  31. cout<<"7.Foxy Organic |1006 |400/- "<<endl;
  32. cout<<"8.Gelatin |1007 |20/- "<<endl;
  33. cout<<"9.Hershey's Syrup |1008 |200/- "<<endl;
  34. cout<<"10.Diet Coke |1009 |50/- "<<endl;
  35.  
  36. }
  37. };
  38. class bill
  39. {
  40. public:
  41. string a;
  42. int a1,b1,b,a2,b2;
  43. int grand;
  44. void fn3()
  45. {
  46. cout<<"Enter the name of the product or alphabet or code of the product to order: "<<endl;
  47. cin>>a;
  48. cout<<endl;
  49. if(a=="a" || a=="A")
  50. {
  51. cout<<"Choose your item: "<<endl;
  52. cout<<"1.Air wick"<<endl<<"2.Appy Fizz"<<endl;
  53. cin>>b;
  54. if(b==1)
  55. {
  56. cout<<"Enter Quantity:"<<endl;
  57. cin>>a1;
  58. grand=a1*500;
  59. }
  60. else if(b==2)
  61. {
  62. cout<<"Enter Quantity:"<<endl;
  63. cin>>b1;
  64. grand=b1*50;
  65. }
  66. }
  67. else if(a=="airwick" ||a=="air")
  68. {
  69. cout<<"Enter Quantity:"<<endl;
  70. cin>>a1;
  71. grand=a1*500;
  72. }
  73. else if(a=="appyfizz" || a=="appy")
  74. {
  75. cout<<"Enter Quantity:"<<endl;
  76. cin>>b1;
  77. grand=b1*50;
  78. }
  79. else if(a=="1000" || a=="1001")
  80. {
  81. if(a=="1000")
  82. {
  83. cout<<"Enter Quantity:"<<endl;
  84. cin>>a1;
  85. grand=a1*500;
  86. }
  87. else if(a=="1001")
  88. {
  89. cout<<"Enter Quantity:"<<endl;
  90. cin>>b1;
  91. grand=b1*50;
  92. }
  93. else if(b!=1 ||b!=2)
  94. {
  95. cout<<"Invalid Choice..Please Try again!"<<endl;
  96. }
  97. }
  98. else if(a=="b" || a=="B")
  99. {
  100. cout<<"Choose your item: "<<endl;
  101. cout<<"1.BB Cream"<<endl<<"2.Bedsheet"<<endl<<"3.Brown Bread"<<endl<<"4.Bournvita"<<endl;
  102. cin>>b;
  103. if(b==1)
  104. {
  105. cout<<"Enter Quantity:"<<endl;
  106. cin>>a1;
  107. grand=a1*350;
  108. }
  109. else if(b==2)
  110. {
  111. cout<<"Enter Quantity:"<<endl;
  112. cin>>b1;
  113. grand=b1*800;
  114. }
  115. else if(b==3)
  116. {
  117. cout<<"Enter Quantity:"<<endl;
  118. cin>>b1;
  119. grand=b1*60;
  120. }
  121. else if(b==4)
  122. {
  123. cout<<"Enter Quantity:"<<endl;
  124. cin>>b1;
  125. grand=b1*500;
  126. }
  127. else if(b!=1 ||b!=2 ||b!=3 ||b!=4)
  128. {
  129. cout<<"Invalid Choice..Please Try again!"<<endl;
  130. }
  131. }
  132. else if(a=="bbcream" ||a=="bb")
  133. {
  134. cout<<"Enter Quantity:"<<endl;
  135. cin>>a1;
  136. grand=a1*350;
  137. }
  138. else if(a=="bedsheet" ||a=="bedsheets")
  139. {
  140. cout<<"Enter Quantity:"<<endl;
  141. cin>>b1;
  142. grand=b1*800;
  143. }
  144. else if(a=="brownbread" ||a=="bread")
  145. {
  146. cout<<"Enter Quantity:"<<endl;
  147. cin>>b1;
  148. grand=b1*60;
  149. }
  150. else if(a=="bournvita" ||a=="bourn")
  151. {
  152. cout<<"Enter Quantity:"<<endl;
  153. cin>>b1;
  154. grand=b1*500;
  155. }
  156. else if(a=="1002" || a=="1003" || a=="1012" || a=="1025")
  157. {
  158. if(a=="1002")
  159. {
  160. cout<<"Enter Quantity:"<<endl;
  161. cin>>a1;
  162. grand=a1*350;
  163. }
  164. else if(a=="1003")
  165. {
  166. cout<<"Enter Quantity:"<<endl;
  167. cin>>b1;
  168. grand=b1*800;
  169. }
  170. else if(a=="1012")
  171. {
  172. cout<<"Enter Quantity:"<<endl;
  173. cin>>b1;
  174. grand=b1*60;
  175. }
  176. else if(a=="1025")
  177. {
  178. cout<<"Enter Quantity:"<<endl;
  179. cin>>b1;
  180. grand=b1*500;
  181. }
  182. }
  183. else if(a=="c" || a=="C")
  184. {
  185. cout<<"Choose your item: "<<endl;
  186. cout<<"1.Coffee Beans"<<endl<<"2.Chocolate Cookies"<<endl<<"3.Classmate Notebook"<<endl;
  187. cin>>b;
  188. if(b==1)
  189. {
  190. cout<<"Enter Quantity:"<<endl;
  191. cin>>a1;
  192. grand=a1*400;
  193. }
  194. else if(b==2)
  195. {
  196. cout<<"Enter Quantity:"<<endl;
  197. cin>>b1;
  198. grand=b1*150;
  199. }
  200. else if(b==3)
  201. {
  202. cout<<"Enter Quantity:"<<endl;
  203. cin>>b1;
  204. grand=b1*65;
  205. }
  206. else if(b!=1 ||b!=2 ||b!=3)
  207. {
  208. cout<<"Invalid Choice..Please Try again!"<<endl;
  209. }
  210. }
  211. else if(a=="coffeebeans" ||a=="coffee")
  212. {
  213. cout<<"Enter Quantity:"<<endl;
  214. cin>>a1;
  215. grand=a1*400;
  216. }
  217. else if(a=="chocolatecookies" || a=="cookies")
  218. {
  219. cout<<"Enter Quantity:"<<endl;
  220. cin>>b1;
  221. grand=b1*150;
  222. }
  223. else if(a=="classmatenotebook" || a=="classmate" ||a=="notebook")
  224. {
  225. cout<<"Enter Quantity:"<<endl;
  226. cin>>b1;
  227. grand=b1*65;
  228. }
  229. else if(a=="1004" || a=="1013" ||a=="1026")
  230. {
  231. if(a=="1004")
  232. {
  233. cout<<"Enter Quantity:"<<endl;
  234. cin>>a1;
  235. grand=a1*400;
  236. }
  237. else if(a=="1013")
  238. {
  239. cout<<"Enter Quantity:"<<endl;
  240. cin>>b1;
  241. grand=b1*150;
  242. }
  243. else if(a=="1026")
  244. {
  245. cout<<"Enter Quantity:"<<endl;
  246. cin>>b1;
  247. grand=b1*65;
  248. }}
  249. else if(a=="d" || a=="D")
  250. {
  251. cout<<"Choose your item: "<<endl;
  252. cout<<"1.Dairy Milk Silk"<<endl<<"2.Diet Coke"<<endl<<"3.Dove Shampoo"<<endl;
  253. cin>>b;
  254. if(b==1)
  255. {
  256. cout<<"Enter Quantity:"<<endl;
  257. cin>>a1;
  258. grand=a1*150;
  259. }
  260. else if(b==2)
  261. {
  262. cout<<"Enter Quantity:"<<endl;
  263. cin>>b1;
  264. grand=b1*50;
  265. }
  266. else if(b==3)
  267. {
  268. cout<<"Enter Quantity:"<<endl;
  269. cin>>b1;
  270. grand=b1*190;
  271. }
  272. else if(b!=1 ||b!=2 ||b!=3)
  273. {
  274. cout<<"Invalid Choice..Please Try again!"<<endl;
  275. }
  276. }
  277. else if(a=="dairymilksilk" ||a=="dairymilk" ||a=="silk" ||a=="chocolate")
  278. {
  279. cout<<"Enter Quantity:"<<endl;
  280. cin>>a1;
  281. grand=a1*150;
  282. }
  283. else if(a=="dietcoke" || a=="coke")
  284. {
  285. cout<<"Enter Quantity:"<<endl;
  286. cin>>b1;
  287. grand=b1*50;
  288. }
  289. else if(a=="doveshampoo" || a=="dove" ||a=="shampoo")
  290. {
  291. cout<<"Enter Quantity:"<<endl;
  292. cin>>b1;
  293. grand=b1*190;
  294. }
  295. else if(a=="1005" || a=="1009" ||a=="1022")
  296. {
  297. if(a=="1005")
  298. {
  299. cout<<"Enter Quantity:"<<endl;
  300. cin>>a1;
  301. grand=a1*150;
  302. }
  303. else if(a=="1009")
  304. {
  305. cout<<"Enter Quantity:"<<endl;
  306. cin>>b1;
  307. grand=b1*50;
  308. }
  309. else if(a=="1022")
  310. {
  311. cout<<"Enter Quantity:"<<endl;
  312. cin>>b1;
  313. grand=b1*190;
  314. }
  315. }
  316. else if(a=="e" || a=="E")
  317. {
  318. cout<<"Choose your item: "<<endl;
  319. cout<<"1.Eggs"<<endl<<"2.Eggplant"<<endl<<"3.Eraser"<<endl;
  320. cin>>b;
  321. if(b==1)
  322. {
  323. cout<<"Enter Quantity:"<<endl;
  324. cin>>a1;
  325. grand=a1*10;
  326. }
  327. else if(b==2)
  328. {
  329. cout<<"Enter Quantity:"<<endl;
  330. cin>>b1;
  331. grand=b1*15;
  332. }
  333. else if(b==3)
  334. {
  335. cout<<"Enter Quantity:"<<endl;
  336. cin>>b1;
  337. grand=b1*5;
  338. }
  339. else if(b!=1 ||b!=2 ||b!=3)
  340. {
  341. cout<<"Invalid Choice..Please Try again!"<<endl;
  342. }
  343. }
  344. else if(a=="eggs" ||a=="egg")
  345. {
  346. cout<<"Enter Quantity:"<<endl;
  347. cin>>a1;
  348. grand=a1*10;
  349. }
  350. else if(a=="eggplant" || a=="brinjal")
  351. {
  352. cout<<"Enter Quantity:"<<endl;
  353. cin>>b1;
  354. grand=b1*15;
  355. }
  356. else if(a=="eraser")
  357. {
  358. cout<<"Enter Quantity:"<<endl;
  359. cin>>b1;
  360. grand=b1*5;
  361. }
  362. else if(a=="f" || a=="F")
  363. {
  364. cout<<"Choose your item: "<<endl;
  365. cout<<"1.Foxy Organic"<<endl<<"2.Frooti"<<endl;
  366. cin>>b;
  367. if(b==1)
  368. {
  369. cout<<"Enter Quantity:"<<endl;
  370. cin>>a1;
  371. grand=a1*400;
  372. }
  373. else if(b==2)
  374. {
  375. cout<<"Enter Quantity:"<<endl;
  376. cin>>b1;
  377. grand=b1*70;
  378. }
  379. else if(b!=1 ||b!=2)
  380. {
  381. cout<<"Invalid Choice..Please Try again!"<<endl;
  382. }
  383. }
  384. else if(a=="foxyorganic" ||a=="organic" ||a=="foxy")
  385. {
  386. cout<<"Enter Quantity:"<<endl;
  387. cin>>a1;
  388. grand=a1*400;
  389. }
  390. else if(a=="frooti")
  391. {
  392. cout<<"Enter Quantity:"<<endl;
  393. cin>>b1;
  394. grand=b1*70;
  395. }
  396. else if(a=="1006")
  397. {
  398.  
  399. cout<<"Enter Quantity:"<<endl;
  400. cin>>a1;
  401. grand=a1*400;
  402. }
  403. cout<<"Grand total is:"<<grand<<endl;
  404. }
  405.  
  406. };
  407.  
  408. int main()
  409. {
  410. int n;
  411. string h;
  412. imp a;
  413. a.fn();
  414. cout<<"Enter your choice: "<<endl;
  415. cin>>n;
  416. if(n==1)
  417. {
  418. bill b;
  419. b.fn3();
  420. cout<<"order more? Y/N";
  421. cin>>h;
  422. if(h=="y" || h=="Y")
  423. {
  424. b.fn3();
  425. }
  426. else if(h=="n" || h=="N")
  427. {
  428. cout<<"Thanx for shopping";
  429. }
  430. }
  431. else if(n==2)
  432. {
  433. add a1;
  434. add a1;
  435. a1.fn4();
  436. }
  437. else if(n==3)
  438. {
  439. details d1;
  440. d1.fn2();
  441. }
  442. else if(n==4)
  443. {
  444. cout<<"Successfully exited";
  445. }
  446. return 0;
  447.  
  448. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement