KENDRIYA VIDYALAYA SANGATHAN
BENGALURU REGION BENGALURU
“ ”
Submitted in partial fulfillment of the requirements for the AISSCE CBSE Board examination
In
COMPUTER SCIENCE
For the Academic year
2015-2016
To be carried out by
NAME: NISHANT JHA
REG No:
Under the guidance of
Department of Computer science
KENDRIYA VIDYALAYA DRDO C V RAMAN NAGAR
BENGALURU-560093
2
KV DRDO
CV RAMAN NAGAR, BANGALORE-560093
Certified that the project work entitled Computer Shop Database
Management carried out by Kumar. Nishant Jha, Roll No , of
class XII ‘C’ is a bonafide work in partial fulfilment of AISSCE in the
subject computer science prescribed by the Central Board of
Secondary Education, during the year 2015-2016. It is certified that all
corrections/suggestions indicated for Internal Assessment have been
incorporated in the Report deposited in the departmental library. The
project report has been approved as it satisfies the academic
requirements in respect of the Project work prescribed for the said
examination.
Name & Signature of the Guide Signature of the Principal
3
Through this acknowledgement we express our sincere
gratitude to all those people who have been associated with the
project and have helped us with it and made it a worthwhile
experience.
We extend our thanks to Smt. Nutan Punj, the principal of this
fine establishment KV DRDO for being pillar of support
throughout the process.
We would like to express our gratitude towards our parents our
parents for their co-operations and encouragement which
helped us in the completion of this project.
We would also like to express our thanks to Smt. Aruna D
Eknath, the head of computer department of KV DRDO who
gave us this opportunity to learn the subject with a practical
approach, guided us and gave us valuable suggestions regarding
the project.
4
5
The computer shop management system has been
developed for stocking and sale of computer
hardware items from a computer shop. The program
offers a complete lists of the items available in the
shop and their respective rates.
In this C++ program we can modify, add, delete, recall
and list the records.
The products and their details are stored in the binary
file main.dat.
Being OOP concept available, we can add or remove
function anytime we need and even add classes and
derived classes for further improvement of the program
without recording.
6
For Windows 7, 8, 8.1, 10 –
Code::Blocks with MinGW compiler
Dev C++
Turbo C++
For Linux –
Visual Studio
Eclipse CDT
Code::Blocks
For Mac OS –
Code::Blocks
Eclipse IDE
Objective-C++
For Hardware you need to have space to install the
applications and space for saving your coding (100 MB
approx.) and need to have more than 520 MB RAM for
faster compilation.
7
#include<iostream>
#include<fstream>
#include<conio.h>
#include<stdio.h>
#include<iomanip>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include <windows.h>
8
1. To add details of new customer.
2. To display details of a customer.
3. To search the details of a customer.
4. To delete the details of a customer.
5. To modify the details of a customer.
6. To display the details of all customer.
7. To display the quantity of goods available.
9
1. #include<iostream> 2. #include<fstream> 3. #include<conio.h> 4. #include<stdio.h> 5. #include<iomanip> 6. #include<string.h> 7. #include<process.h> 8. #include<stdlib.h> 9. #include <windows.h> 10. using namespace std; 11. 12. void gotoxy(int i,int j) 13. { 14. int o=0,p=0; 15. for(;p<=j;p++) 16. { 17. cout<<"\n"; 18. } 19. for(;o<=i;o++) 20. { 21. cout<<" "; 22. } 23. } 24. 25. class consumer 26. { 27. int cno; 28. char address[20]; 29. int a,b; 30. long int c; 31. float i; 32. 33. public: 34. 35. char cname[20]; 36. 37. //FUNCTION TO READ THE VALUES 38. 39. void entry() 40. { 41. cout<<"\n\n\n\n\nCustomer ID : "; 42. cin>>cno; 43. cout<<"\n\n\nCustomer Name : "; 44. gets(cname); 45. cout<<"\n\n\nCustomer Address : "; 46. gets(address); 47. cout<<"\n\n\nCustomer Service Number : ";
10
48. cin>>a; 49. cout<<"\n\n\nCustomer Smart Card Number : "; 50. cin>>b; 51. cout<<"\n\n\nCustomer Phone Number : "; 52. cin>>c; 53. cout<<"\n\n\nCustomer Bill Number : "; 54. cin>>i; 55. } 56. 57. //FUNCTION TO DISPLAY THE VALUES 58. 59. void display() 60. { 61. cout<<"\n\n"; 62. gotoxy(5,8); 63. cout<<("customer ID :"); 64. cout<<cno; 65. gotoxy(5,2); 66. cout<<("Customer Name :"); 67. cout<<(cname); 68. gotoxy(5,2); 69. cout<<"Customer address :"<<address; 70. gotoxy(5,2); 71. cout<<"Customer Service Number :"<<a; 72. gotoxy(5,2); 73. cout<<"Customer Smart Card Number :"<<b; 74. gotoxy(5,2); 75. cout<<"Customer Phone Number :"<<c; 76. gotoxy(5,2); 77. cout<<"Customer Bill Number :"<<i<<"\n"; 78. } 79. 80. int rcno() 81. { 82. return cno; 83. } 84. }c; 85. 86. //FUNCTION TO WRITE THE VALUES 87. 88. void write() 89. { 90. char ch; 91. consumer c; 92. fstream f1; 93. c.entry(); 94. f1.open("main.dat",ios::app|ios::binary); 95. cout<<"\n\n\tDo you want to save the record(y/n)\t"; 96. cin>>ch; 97. if (ch=='y'||ch=='Y') 98. { 99. f1.write((char*)&c,sizeof(c)); 100. } 101. f1.close(); 102. } 103. 104. //FUNCTION TO READ THE VALUES 105. 106. void read() 107. { 108. consumer c;
11
109. fstream f1; 110. f1.open("main.dat",ios::in|ios::binary); 111. while(!f1.eof()) 112. { 113. f1.read((char*)&c,sizeof(c)); 114. c.display(); 115. if(f1.eof()) 116. { 117. cout<<"\n\n End of the file reached\n\n"; 118. } 119. } 120. f1.close(); 121. } 122. 123. //FUCNTION FOR SEARCHING THE RECORD 124. 125. void search() 126. { 127. consumer c; 128. int rn; 129. char rc[20]; 130. char found='n'; 131. ifstream f1("main.dat",ios::in); 132. cout<<"\n\n Enter Customer ID you want to search :\t"; 133. cin>>rn; 134. cout<<"\n\n Enter the Customer Name :\t"; 135. gets(rc); 136. while(!f1.eof()) 137. { 138. f1.read((char*)&c,sizeof(c)); 139. if(c.rcno()==rn&&strcmp(c.cname,rc)) 140. { 141. c.display(); 142. found='y'; 143. break; 144. } 145. } 146. if(found=='n') 147. cout<<"\n\n\tRECORD NOT FOUND!!!!!!!!!!!!!\n"<<endl; 148. f1.close(); 149. } 150. 151. //FUNCTION TO DELETE THE RECORD 152. 153. void del() 154. { 155. ifstream f1("main.dat",ios::in); 156. ofstream f2("temp.dat",ios::out); 157. int rno; 158. char rname[20]; 159. char found='f',confirm='n'; 160. cout<<"\n\n Enter Customer ID you went to DELETE :\t"; 161. cin>>rno; 162. cout<<"\n\n Enter Customer Name :\t"; 163. gets(rname); 164. while(!f1.eof()) 165. { 166. f1.read((char*)&c,sizeof(c)); 167. if(c.rcno()==rno&&strcmp(c.cname,rname)) 168. { 169. c.display();
12
170. found='t'; 171. cout<<"\n\n Are you sure want to DELETE this record ? (y/n)\t";
172. cin>>confirm; 173. if(confirm=='n') 174. f2.write((char*)&c,sizeof(c)); 175. } 176. else 177. f2.write((char*)&c,sizeof(c)); 178. } 179. if(found=='f') 180. cout<<"\n\n\tRECORD NOT FOUND\n"; 181. f1.close(); 182. f2.close(); 183. remove("main.dat"); 184. rename("temp.dat","main.dat"); 185. f1.open("main.dat",ios::in); 186. system("cls"); 187. cout<<"\n\n\n Now the file contains\n\n\n"; 188. while(!f1.eof()) 189. { 190. f1.read((char*)&c,sizeof(c)); 191. if(f1.eof()) 192. c.display(); 193. } 194. f1.close(); 195. } 196. 197. //FUNCTION TO MODIFY THE RECORD 198. 199. void update() 200. { 201. fstream f1("main.dat",ios::in | ios::out | ios::binary); 202. int rno; 203. char rname[20]; 204. long pos; 205. char found='f'; 206. cout<<"\n\n Enter the Customer ID you want to MODIFY :\t"; 207. cin>>rno; 208. cout<<"\n\n Enter Customer Name :\t"; 209. gets(rname); 210. while(!f1.eof()) 211. { 212. pos=f1.tellg(); 213. f1.read((char*)&c,sizeof(c)); 214. if(c.rcno()==rno&&strcmp(c.cname,rname)) 215. { 216. c.entry(); 217. f1.seekg(pos); 218. f1.write((char*)&c,sizeof(c)); 219. found='t'; 220. break; 221. } 222. } 223. if(found=='f') 224. cout<<"\n\n\tRECORD NOT FOUND\n"; 225. f1.seekg(0); 226. system("cls"); 227. cout<<"\n Now the file contains\n\n"; 228. c.display(); 229. f1.close();
13
230. getch(); 231. } 232. 233. //STARING OF THE INT MAIN 234. 235. int main() 236. { 237. unsigned int sum,add,d,e,f,g,h,k,l,w,x,y,z,choice; 238. int abis=0,apep=0,amun=0,aperk=0,acoc=0,atit=0,alux=0,atid=0,aree=0,aden
=0; 239. unsigned int m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0; 240. int pend=0,print=0,graph=0,ram=0,hard=0,win=0,ant=0,p1=0,p2=0,g1=0,r1=0,
h1=0,w1=0,an1=0,mo=0,mous=0,web=0,aweb=0,asc=0,scan=0,total=0; 241. char pu,str[10],yes,et; 242. system("cls"); 243. 244. //WELCOME SCREEN 245. 246. system("cls"); 247. system("cls"); 248. system("cls"); 249. cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t WELCOME\n\n"; 250. cout<<"\t\t\t\t TO\n\n"; 251. cout<<"\t\t\t\t RELIANCE DIGITALS\n\n"; 252. getch(); 253. system("cls"); 254. cout<<"\n\n\tPLEASE BE CAREFUL ENTER THE PASSWORD IN SMALL LETTERS\n"; 255. cout<<"\n\t\tPASSWORD DOES NOT CONTAINS ANY NUMBER\n\n\n"; 256. pass:; 257. cout<<"\n\n\t\t\tEnter your Password\t"; 258. str[0]=getch(); 259. cout<<"*"; 260. str[1]=getch(); 261. cout<<"*"; 262. str[2]=getch(); 263. cout<<"*"; 264. str[3]=getch(); 265. cout<<"*"; 266. str[4]=getch(); 267. cout<<"*"; 268. str[5]=getch(); 269. cout<<"*"; 270. str[6]=getch(); 271. cout<<"*"; 272. str[7]='\0'; 273. cout<<"*"; 274. cout<<"\n\n\tPlease wait a moment"; 275. Sleep(1500); 276. if(strcmp(str,"adinjha")==0) 277. { 278. system("cls"); 279. cout<<"\n\n\n\tLoading"; 280. Sleep(1000); 281. cout<<".."; 282. Sleep(1000); 283. cout<<".."; 284. Sleep(500); 285. cout<<".."; 286. Sleep(500); 287. cout<<".."; 288. Sleep(500);
14
289. cout<<".."; 290. Sleep(500); 291. cout<<".."; 292. Sleep(500); 293. cout<<"\n\n\n\tOpening.........."; 294. Sleep(2000); 295. } 296. else 297. { 298. cout<<"\n\n\t\t Ooop's wrong password!!!!!!!!!!!\n"; 299. cout<<"\n\n\t\tPlease re-enter the password!!!!!!\n"; 300. getch(); 301. system("cls"); 302. k++; 303. if(k==3) 304. { 305. cout<<"\nExiting from the project!!!!!!! \n"; 306. getch(); 307. exit(0); 308. } 309. goto pass; 310. } 311. system("cls"); 312. gotoxy(1,6); 313. cout<<(" COMPUTER SCIENCE PROJECT\n"); 314. cout<<"\n\n"; 315. cout<<(" WELCOME TO RELIANCE DIGITALS\n"); 316. gotoxy(2,2); 317. cout<<(" SCHOOL : Kendriya Vidyalaya DRDO"); 318. gotoxy(2,2); 319. cout<<(" C.V. Raman Nagar"); 320. gotoxy(1,2); 321. cout<<(" SUBJECT TEACHER : MRS. ARUNA\n"); 322. gotoxy(1,2); 323. cout<< (" BY : HIMANSHU UPADHAYAY , DEVINDER SINGH , NISHANT JHA , SAI
PRASHANTH\n"); 324. gotoxy(1,2); 325. cout<<(" ROLL NO : 16 , 18 , 23 31\n"); 326. gotoxy(1,2); 327. cout<<(" CLASS : XII C\n"); 328. gotoxy(1,2); 329. cout<<(" YEAR : 2015-2016\n"); 330. cout<<"\n\n"; 331. gotoxy(45,10); 332. cout<<("PRESS ENTER TO CONTINUE!!!!!!!!!"); 333. getch(); 334. system("cls"); 335. 336. //DETAILS OF THIS PROJECT 337. 338. gotoxy(25,10); 339. cout<<("WELCOME TO THE WORLD OF COMPUTERS ."); 340. gotoxy(5,5); 341. cout<<("THIS PROJECT CONTAINS SOME ITEMS AND SIMPLE THING YOU HAVE TO DO
IS :-"); 342. gotoxy(5,2); 343. cout<<("ENTER THE NAME , CUSTOMER ID , SERIAL NUMBER , SMART CARD NUMBER
etc."); 344. gotoxy(5,2); 345. cout<<("THEN PURCHASE THE ITEMS AND REMEMBER THE QUANTITY ITEMS CARRY.")
;
15
346. gotoxy(5,2); 347. cout<<("YOU CAN ALSO MODIFY , DELETE , SEARCH A RECORD."); 348. gotoxy(5,2); 349. cout<<("YOU CAN ALSO SAVE ALL RECORDS YOU HAVE ENTERED IN YOUR COMPUTER.
"); 350. gotoxy(5,2); 351. cout<<("BUT DO NOT EXPECT FOR ANY DISCOUNT."); 352. gotoxy(5,2); 353. cout<<("WE HOPE THAT YOU WILL BE SATISFIED WITH OUR SERVICE."); 354. gotoxy(5,2); 355. cout<<("WE ARE NOT RESPONSIBLE FOR ANY DEFECT IN THE PRODUCT YOU PURCHAS
E."); 356. getch(); 357. system("cls"); 358. 359. //LOADING THE PROJECT 360. 361. gotoxy(32,13); 362. cout<<("LOADING YOUR PROJECT"); 363. Sleep(1000); 364. gotoxy(32,5); 365. cout<<("***********************"); 366. Sleep(1000); 367. gotoxy(32,3); 368. cout<<("PLEASE WAIT........."); 369. Sleep(200); 370. gotoxy(32,2); 371. cout<<("10 % completed.."); 372. Sleep(100); 373. gotoxy(32,2); 374. cout<<("20 % completed..."); 375. Sleep(100); 376. gotoxy(32,2); 377. cout<<("30 % completed...."); 378. Sleep(100); 379. gotoxy(32,2); 380. cout<<("40 % completed....."); 381. Sleep(100); 382. gotoxy(32,2); 383. cout<<("50 % completed......"); 384. Sleep(100); 385. gotoxy(32,2); 386. cout<<("60 % completed......."); 387. Sleep(100); 388. gotoxy(32,2); 389. cout<<("70 % completed........"); 390. Sleep(400); 391. gotoxy(32,2); 392. cout<<("80 % completed........."); 393. Sleep(300); 394. gotoxy(32,2); 395. cout<<("90 % completed........"); 396. Sleep(200); 397. gotoxy(32,2); 398. cout<<("100 % completed......."); 399. Sleep(1000); 400. 401. //TO PURCHASE,SEARCH,MODIFY,DELETE,DISPLAY ALL RECORDS,DETAILS,NEW CUSTO
MER 402. 403. again:;
16
404. system("cls"); 405. cout<<"\n\t\t\t * RELIANCE *\n\n"; 406. cout<<"\n\n\t\t\t* 1.NEW CUSTOMER *"; 407. cout<<"\n\n\t\t\t* 2.DETAILS *"; 408. cout<<"\n\n\t\t\t* 3.SEARCH A RECORD *"; 409. cout<<"\n\n\t\t\t* 4.DELETE A RECORD *"; 410. cout<<"\n\n\t\t\t* 5.MODIFY A RECORD *"; 411. cout<<"\n\n\t\t\t* 6.DISPLAY ALL RECORD *"; 412. cout<<"\n\n\t\t\t* 7.QUANTITY AVAILABLE *"; 413. cout<<"\n\n\t\t\t* 0.EXIT *"; 414. cout<<"\n\n\n\n\t ENTER YOUR CHOICE :\t"; 415. cin>>d; 416. switch(d) 417. { 418. case 1: 419. system("cls"); 420. cout<<"\n\n\n\t\t\t RELIANCE DIGITALS "; 421. cout<<"\n\n\n\t\t\t CONSUMER INFORMATION "; 422. 423. //TO ENTER THE DETAILS OF THE COSTUMER 424. 425. write(); 426. 427. //ITEM AND THEIR RATES 428. 429. cout<<"\n\n DO YOU WANT TO PURCHASE(Y/N):\t"; 430. cin>>pu; 431. if(pu=='Y'|| pu=='y') 432. { 433. system("cls"); 434. 435. //PURCHASE LIST 436. 437. items:; 438. 439. cout<<"\n\t\t\t\t PURCHASE LIST"; 440. cout<<"\n\n\t\t\t 1.PENDRIVE"; 441. cout<<"\n\n\t\t\t 2.SCANNER"; 442. cout<<"\n\n\t\t\t 3.PRINTER"; 443. cout<<"\n\n\t\t\t 4.WEBCAM"; 444. cout<<"\n\n\t\t\t 5.GRAPHIC CARD"; 445. cout<<"\n\n\t\t\t 6.RAM"; 446. cout<<"\n\n\t\t\t 7.HARD DISK"; 447. cout<<"\n\n\t\t\t 8.WINDOWS ORIGINAL CD'S"; 448. cout<<"\n\n\t\t\t 9.ANTIVIRUS"; 449. cout<<"\n\n\t\t\t 10.MOUSE"; 450. cout<<"\n\n\t\t\t ENTER YOUR CHOICE\t"; 451. cin>>choice; 452. if(choice==1) 453. { 454. 455. //ITEMS AND RATES 456. 457. bis:; 458. system("cls"); 459. cout<<"\n\n\t\t\tPEMDRIVES\n\n"; 460. cout<<"\n ITEMS\t\t\t\t\tRATE\n"; 461. cout<<"\n 1. 2GB \t\t\t\t\t350\n"; 462. cout<<"\n 2. 4GB \t\t\t\t\t500\n"; 463. cout<<"\n 3. 5GB \t\t\t\t\t700\n"; 464. cout<<"\n 4. 8GB \t\t\t\t\t800\n";
17
465. cout<<"\n 5. 16GB\t\t\t\t1800\n"; 466. cout<<"\n 6. 32GB\t\t\t\t2400\n"; 467. cout<<"\n 7. 64GB\t\t\t\t3000\n"; 468. cout<<"\n\n\t WHICH PENDRIVE YOU WANT TO PURCHASE : ";
469. cin>>p1; 470. if(p1==1) 471. { 472. pend=350; 473. } 474. else if(p1==2) 475. { 476. pend=500; 477. } 478. else if(p1==3) 479. { 480. pend=700; 481. } 482. else if(p1==4) 483. { 484. pend=800; 485. } 486. else if(p1==5) 487. { 488. pend=1800; 489. } 490. else if(p1==6) 491. { 492. pend=2400; 493. } 494. else if(p1==7) 495. { 496. pend=3000; 497. } 498. else if(p1==0) 499. { 500. goto items; 501. } 502. else if(p1!=1||p1!=2||p1!=3||p1!=4||p1!=5||p1!=6||p1!=7)
503. { 504. cout<<"\n\n\tOOPS!!!!!! WRONG CHOICE \n\n"; 505. getch(); 506. goto bis; 507. } 508. cout<<"\n\t PENDRIVE(MAX 5): "; 509. cin>>m; 510. if(m>5) 511. { 512. cout<<"ENTER QUANTITY SMALLER THAN 5"; 513. getch(); 514. goto items; 515. } 516. else 517. abis=1000-m; 518. cout<<"\n\t DO YOU WANT TO PURCHASE MORE(Y/N)"; 519. cin>>yes; 520. if(yes=='Y'||yes=='y') 521. { 522. system("cls"); 523. goto items;
18
524. } 525. else 526. { 527. system("cls"); 528. goto cash; 529. } 530. } 531. if(choice==2) 532. { 533. pep:; 534. system("cls"); 535. cout<<"\n\n\t\t\t\t SCANNER \n\n"; 536. cout<<"\n ITEMS \t\t\t\t RATE\n"; 537. cout<<"\n 1.FLATBED\t\t\t\t5000\n"; 538. cout<<"\n 2.SHETFED\t\t\t\t6000\n"; 539. cout<<"\n 3.PHOTO SCANNER\t\t\t4500\n"; 540. cout<<"\n 4.FILM SCANNER \t\t\t8000\n"; 541. cout<<"\n 5.PORTABLE SCANNER\t\t\t10000\n"; 542. cout<<"\n\n\n\tWHICH SCANNER DO YOU WANT TO PURCHASE\t";
543. cin>>scan; 544. if(scan==1) 545. { 546. asc=5000; 547. } 548. else if(scan==2) 549. { 550. asc=6000; 551. } 552. else if(scan==3) 553. { 554. asc=4500; 555. } 556. else if(scan==4) 557. { 558. asc=8000; 559. } 560. else if(scan==5) 561. { 562. asc=10000; 563. } 564. else if(scan==0) 565. { 566. goto items; 567. } 568. else if(scan!=1||scan!=2||scan!=3||scan!=4||scan!=5) 569. { 570. cout<<"\n\n\t OOPS!!!!!! WRONG CHOICE\n\n"; 571. getch(); 572. goto pep; 573. } 574. cout<<"\n\n\tSCANNER(MAX 5):\t"; 575. cin>>n; 576. if(n>5) 577. { 578. cout<<"\n\n\tENTER QUANTITY SMALLER THAN 5 : "; 579. getch(); 580. goto items; 581. } 582. else 583. apep=1000-n;
19
584. cout<<"\n\t DO YOU WANT TO PURCHASE MORE(Y/N)"; 585. cin>>yes; 586. if(yes=='Y'||yes=='y') 587. { 588. system("cls"); 589. goto items; 590. } 591. else 592. { 593. system("cls"); 594. goto cash; 595. } 596. } 597. if(choice==3) 598. { 599. den:; 600. system("cls"); 601. cout<<"\n\n\t\t\t\t PRINTER \n\n"; 602. cout<<"\n ITEMS RATE\n"; 603. cout<<"\n 1.HP LASER JET 2000\n"; 604. cout<<"\n 2.DOT MATRIX PRINTER 5000\n"; 605. cout<<"\n\n\t WHICH PRINTER YOU WANT TO PURCHASE\t"; 606. cin>>p2; 607. if(p2==1) 608. { 609. print=500; 610. } 611. else if(p2==2) 612. { 613. print=2000; 614. } 615. else if(p2==0) 616. { 617. goto items; 618. } 619. else if(p2!=1||p2!=2) 620. { 621. cout<<"\n\n\t OOPS!!!!! WRONG CHOICE\n\n"; 622. getch(); 623. goto den; 624. } 625. cout<<"\n\tPRINTER(MAX5) \t"; 626. cin>>o; 627. if(o>5) 628. { 629. cout<<"\n\t ENTER QUANTITY SMALLER THAN 5"; 630. goto items; 631. } 632. else 633. aden=110-o; 634. cout<<"\n\tDO YOU WANT TO PURCHASE MORE(Y/N)"; 635. cin>>yes; 636. if(yes=='Y') 637. { 638. system("cls"); 639. goto items; 640. } 641. else 642. { 643. system("cls"); 644. goto cash;
20
645. } 646. } 647. if(choice==4) 648. { 649. mun:; 650. system("cls"); 651. cout<<"\n\n\t\t\t\tWEBCAM\n\n"; 652. cout<<"\n ITEMS\t\t\t\t RATE \n"; 653. cout<<"\n 1. 5 PIXELS \t\t\t\t1500\n"; 654. cout<<"\n 2. 8 PIXELS \t\t\t\t6000\n"; 655. cout<<"\n 3. 12 PIXELS\t\t\t\t12000\n"; 656. cout<<"\n\n\t WHICH WEBCAM YOU WANT TO PURCHASE\t"; 657. cin>>web; 658. if(web==1) 659. { 660. aweb=1500; 661. } 662. else if(web==2) 663. { 664. aweb=6000; 665. } 666. else if(web==3) 667. { 668. aweb=12000; 669. } 670. else if(web==0) 671. { 672. goto items; 673. } 674. else if(web!=1||web!=2||web!=3) 675. { 676. cout<<"\n\n\t OOPS!!!!!! WRONG CHOICE\n\n"; 677. getch(); 678. goto mun; 679. } 680. cout<<"\n\n\t WEBCAM(MAX5):\t"; 681. cin>>p; 682. if(p>5) 683. { 684. cout<<"\n\t ENTER QUANTITY SMALLER THAN 5 \t"; 685. getch(); 686. goto items; 687. } 688. else 689. amun=1000-p; 690. cout<<"\n\t DO YOU WANT TO PURCHASE MORE(Y/N) : "; 691. cin>>yes; 692. if(yes=='Y'||yes=='y') 693. { 694. system("cls"); 695. goto items; 696. } 697. else 698. { 699. system("cls"); 700. goto cash; 701. } 702. } 703. if(choice==5) 704. { 705. park:;
21
706. system("cls"); 707. cout<<"\n\n\t\t\t\t GRAPHIC CARDS \n\n"; 708. cout<<"\n ITEMS \t\t\t\t RATE\n"; 709. cout<<"\n 1.32 BIT \t\t\t\t 5000\n"; 710. cout<<"\n 2.64 BIT \t\t\t\t 8000\n"; 711. cout<<"\n\n\n\t WHICH GRAPHIC CARD YOU WANT TO PURCHASE
\t"; 712. cin>>g1; 713. if(g1==1) 714. { 715. graph=5000; 716. } 717. else if(g1==2) 718. { 719. graph=8000; 720. } 721. else if(g1==0) 722. { 723. goto items; 724. } 725. else if(g1!=1||g1!=2) 726. { 727. cout<<"\n\n\t OOPS!!!!! WRONG CHOICE \n\n"; 728. getch(); 729. goto park; 730. } 731. cout<<"\n\t GRAPHIC CARD (MAX5):\t"; 732. cin>>q; 733. if(q>5) 734. { 735. cout<<"\n\n\t ENTER QUANTITY SMALLER THAN 5 "; 736. getch(); 737. goto items; 738. } 739. else 740. aperk=5000-q; 741. cout<<"\n\t DO YOU WANT TO PURCHASE MORE(Y/N)\t"; 742. cin>>yes; 743. if(yes=='Y'||yes=='y') 744. { 745. system("cls"); 746. goto items; 747. } 748. else 749. { 750. system("cls"); 751. goto cash; 752. } 753. } 754. if(choice==6) 755. { 756. coco:; 757. system("cls"); 758. cout<<"\n\n\t\t\t\t RAM \n\n"; 759. cout<<"\n ITEMS \t\t\t RATE \n"; 760. cout<<"\n 1. 1GB \t\t\t2000\n"; 761. cout<<"\n 2. 2GB \t\t\t4000\n"; 762. cout<<"\n\n\t WHICH RAM YOU WANT TO PURCHASE\t"; 763. cin>>r1; 764. if(r1==1) 765. {
22
766. ram=2000; 767. } 768. else if(r1==2) 769. { 770. ram=4000; 771. } 772. else if(r1==0) 773. { 774. goto items; 775. } 776. else if(r1!=1||r1!=2) 777. { 778. cout<<"\n\n\t OOPS!!!!! WRONG CHOICE\n\n"; 779. getch(); 780. goto coco; 781. } 782. cout<<"\n\t RAM(MAX2): "; 783. cin>>r; 784. if(r>2) 785. { 786. cout<<"\n\n\t ENTER QUANTITY SMALLER THAN 2\t"; 787. getch(); 788. goto items; 789. } 790. else 791. acoc=4000-r; 792. cout<<"\n\t DO YOU WANT TO PURCHASE MORE(Y/N)\t"; 793. cin>>yes; 794. if(yes=='Y'||yes=='y') 795. { 796. system("cls"); 797. goto items; 798. } 799. else 800. { 801. system("cls"); 802. goto cash; 803. } 804. } 805. if(choice==7) 806. { 807. titan:; 808. system("cls"); 809. cout<<"\n\n\t\t\t\t HARD DISK\n\n"; 810. cout<<"\n ITEMS\t\t\t\t RATE\n"; 811. cout<<"\n 1. 20 GB\t\t\t\t 1500\n"; 812. cout<<"\n 2. 50 GB\t\t\t\t2000\n"; 813. cout<<"\n 3. 80 GB\t\t\t\t3000\n"; 814. cout<<"\n 4. 160 GB\t\t\t\t5000\n"; 815. cout<<"\n 5. 3200 GB\t\t\t\t8000\n"; 816. cout<<"\n\n\t Which HARD DISK you want to purchase\t"; 817. cin>>h1; 818. if(h1==1) 819. { 820. hard=1500; 821. } 822. else if(h1==2) 823. { 824. hard=2000; 825. } 826. else if(h1==3)
23
827. { 828. hard=3000; 829. } 830. else if(h1==4) 831. { 832. hard=5000; 833. } 834. else if(h1==5) 835. { 836. hard=8000; 837. } 838. else if(h1==0) 839. { 840. goto items; 841. } 842. else if(h1!=1||h1!=2||h1!=3||h1!=4||h1!=5) 843. { 844. cout<<"\n\n\t Wrong Choice\n\n"; 845. getch(); 846. goto titan; 847. } 848. cout<<"\n\t HARD DISK(MAX5):\t"; 849. cin>>s; 850. if(s>5) 851. { 852. cout<<"\n\n\t Enter quantity less than 5\t"; 853. getch(); 854. goto items; 855. } 856. else 857. atit=100-s; 858. cout<<"\n\t Do you want to purchase more(Y/N)\t"; 859. cin>>yes; 860. if(yes=='Y'||yes=='y') 861. { 862. system("cls"); 863. goto items; 864. } 865. else 866. { 867. system("cls"); 868. goto cash; 869. } 870. } 871. if(choice==8) 872. { 873. lux:; 874. system("cls"); 875. cout<<"\n\n\t\t\t\t Windows Original CD's\n\n"; 876. cout<<"\n Items\t\t\t\t RATE\n"; 877. cout<<"\n 1. Windows XP\t\t\t\t1500\n"; 878. cout<<" 2. Windows Vista\t\t\t\t2000\n"; 879. cout<<" 3. Windows 7\t\t\t\t4000\n"; 880. cout<<" 4. Windows 8\t\t\t\t8000\n"; 881. cout<<" 5. Windows 8.1\t\t\t\t11000\n"; 882. cout<<"\n\n\t Which Windows CD you want to purchase\t";
883. cin>>w1; 884. if(w1==1) 885. { 886. win=1500;
24
887. } 888. else if(w1==2) 889. { 890. win=2000; 891. } 892. else if(w1==3) 893. { 894. win=4000; 895. } 896. else if(w1==4) 897. { 898. win=8000; 899. } 900. else if(w1==5) 901. { 902. win=11000; 903. } 904. else if(w1==0) 905. { 906. goto items; 907. } 908. else if(w1!=1||w1!=2||w1!=3||w1!=4||w1!=5) 909. { 910. cout<<"\n\n\t Wrong Choice\n\n"; 911. getch(); 912. goto lux; 913. } 914. cout<<"\n\t Windows Original CD(MAX 5):\t"; 915. cin>>t; 916. if(t>5) 917. { 918. cout<<"\n\n\t Enter quantity less than 5"; 919. getch(); 920. goto items; 921. } 922. else 923. alux=1000-t; 924. cout<<"\n\t Do you want to purchase more(y/n)"; 925. cin>>yes; 926. if(yes=='y') 927. { 928. system("cls"); 929. goto items; 930. } 931. else 932. { 933. system("cls"); 934. goto cash; 935. } 936. } 937. if(choice==9) 938. { 939. tid:; 940. system("cls"); 941. cout<<"\n\n\t\t\t Antivirus\n\n"; 942. cout<<"\n Items\t\t\t\t RATE\n"; 943. cout<<"\n 1. Norton\t\t\t\t1500\n"; 944. cout<<" 2. AVIRA\t\t\t\t2000\n"; 945. cout<<" 3. Kaspersky\t\t\t\t1300\n"; 946. cout<<"\n\n\t Which Antivirus you want to purchase\t"; 947. cin>>an1;
25
948. if(an1==1) 949. { 950. ant=1500; 951. } 952. else if(an1==2) 953. { 954. ant=2000; 955. } 956. else if(an1==3) 957. { 958. ant=1300; 959. } 960. else if(an1==0) 961. { 962. goto items; 963. } 964. else if(an1!=1|| an1!=2|| an1!=3|| an1!=4|| an1!=5) 965. { 966. cout<<"\n\n\t Wrong Choice\n\n"; 967. getch(); 968. goto tid; 969. } 970. cout<<"\n\t Antivirus(MAX 5):\t"; 971. cin>>u; 972. if(u>5) 973. { 974. cout<<"\n\n\t Enter quantity less than 5"; 975. getch(); 976. goto items; 977. } 978. else 979. alux=1000-t; 980. cout<<"\n\t Do you want to purchase more(y/n)\t"; 981. cin>>yes; 982. if(yes=='y'||yes=='Y') 983. { 984. system("cls"); 985. goto items; 986. } 987. else 988. { 989. system("cls"); 990. goto cash; 991. } 992. } 993. if(choice==10) 994. { 995. ree:; 996. system("cls"); 997. 998. cout<<"\n\n\t\t\t MOUSE\n\n"; 999. cout<<"\n Items\t\t\t\t\tRATE\n\n"; 1000. cout<<"\n 1. Ball Mouse\t\t\t\t150\n"; 1001. cout<<"\n 2. Laser Mouse\t\t\t\t300\n"; 1002. cout<<"\n\n\t Which Mouse you want to purchase\t"; 1003. cin>>mous; 1004. if(mous==1) 1005. { 1006. mo =150; 1007. } 1008. else if(mous==2)
26
1009. { 1010. mo=300; 1011. } 1012. else if(mous==0) 1013. { 1014. goto items; 1015. } 1016. else if(mous!=1||mous!=2) 1017. { 1018. cout<<"\n\n\t Wrong Choice\n\n"; 1019. getch(); 1020. goto ree; 1021. } 1022. cout<<"\n\t Mouse(MAX 2):\t"; 1023. cin>>v; 1024. if(v>2) 1025. { 1026. cout<<"\n\n\t Enter quantity less than 2\t"; 1027. getch(); 1028. goto items; 1029. } 1030. else 1031. aree=300-v; 1032. cout<<"\n\t Do you want to purchase more(y/n)\t"; 1033. cin>>yes; 1034. if(yes=='y'||yes=='Y') 1035. { 1036. system("cls"); 1037. 1038. //GO BACK TO PURCHASE LIST 1039. 1040. goto items; 1041. } 1042. else 1043. { 1044. system("cls"); 1045. 1046. //TO DISPALY BILL 1047. 1048. goto cash; 1049. } 1050. } 1051. cout<<"\n\n\n"; 1052. system("cls"); 1053. cash:; 1054. cout<<"\n\n\n\n\n\n\t\t\t\t S.T.A.R COMPUTERS\n"; 1055. cout<<"\n\n\t\t\t\t CASH MEMO\n"; 1056. cout<<"\n\n\n\n\n"; 1057. 1058. //TO DISPALY THE INFORMATION OF THE CUSTOMER 1059. 1060. c.display(); 1061. 1062. //TO DISPALY THE CASH MEMO 1063. 1064. cout<<"\n\n\n\n"; 1065. cout<<"\n Items"<<setw(40)<<"Quantity"<<setw(34)<<"Price(Rs.
)"; 1066. if(m>0) 1067. cout<<"\n\n PEN DRIVE"<<setw(35)<<m<<setw(28)<<"Rs."<<m*
pend;
27
1068. if(n>0) 1069. cout<<"\n\n SCANNER"<< setw(36)<<n<<setw(28)<<"Rs."<<n*a
sc; 1070. if(o>0) 1071. cout<<"\n\n PRINTER"<< setw(36)<<o<<setw(28)<<"Rs."<<o*p
rint; 1072. if(p>0) 1073. cout<<"\n\n WEBCAM"<< setw(37)<<p<<setw(28)<<"Rs."<<p*aw
eb; 1074. if(q>0) 1075. cout<<"\n\n GRAPHIC CARD"<< setw(31)<<q<<setw(28)<<"Rs."
<<q*graph; 1076. if(r>0) 1077. cout<<"\n\n RAM"<< setw(40)<<q<<setw(28)<<"Rs."<<r*ram;
1078. if(s>0) 1079. cout<<"\n\n HARD DISK"<< setw(34)<<q<<setw(28)<<"Rs."<<s
*hard; 1080. if(t>0) 1081. cout<<"\n\n WINDOWS ORIGINAL CD"<< setw(24)<<q<<setw(28)
<<"Rs."<<t*win; 1082. if(u>0) 1083. cout<<"\n\n ANTIVIRUS"<< setw(34)<<q<<setw(28)<<"Rs."<<u
*ant; 1084. if(v>0) 1085. cout<<"\n\n MOUSE"<< setw(34)<<q<<setw(28)<<"Rs."<<v*mo;
1086. e=m*pend; 1087. f= n*asc; 1088. g= o*print; 1089. h= p*aweb; 1090. k= q*graph; 1091. l= r*ram; 1092. w= s*hard; 1093. x= t*win; 1094. y= u*ant; 1095. z= v*mo; 1096. 1097. //TOTAL BILL 1098. 1099. sum=e+f+g+h+k+l+w+x+y+z; 1100. 1101. //QUANTITY OF BILL 1102. 1103. add=m+n+o+p+q+r+s+t+u+v; 1104. cout<<"\n\n\n TOTAL:"<<setw(38)<<add<<setw(27)<<"Rs."<<sum;
1105. money:; 1106. cout<<"\n\n\n\n\t\t Enter the cash paid\t"; 1107. cin>>total; 1108. cout<<"\n\n\n\n\t\t Cash received : "<<total; 1109. if((unsigned)total<sum) 1110. { 1111. cout<<"\n\n\t The money you paid is less !!! Please pay
the adequate"; 1112. getch(); 1113. goto money; 1114. } 1115. system("cls"); 1116. cout<<"\n\n\n\n\n\t No credit of the additional duty of"; 1117. cout<<"\n\n\t Customs levied under SECTION (5) of";
28
1118. cout<<"\n\n\t Section-3 of the customs tariff act"; 1119. cout<<"\n\n\t 1975 have been availed/shall be admissible\n\n
"; 1120. cout<<"\n\n\n\n\n\t\t Cash received:\t"<<total; 1121. cout<<"\n\n\t\t Cash amount:\t"<<sum; 1122. cout<<"\n\n\t\t Balance returned:\t"<<total-sum; 1123. cout<<"\n\n\t Thank you. \t\t\t\t Do Visit Us Again\n"; 1124. cout<<"\n\n\t Thank you for using our service\n\n"; 1125. getch(); 1126. goto again; 1127. } 1128. else 1129. { 1130. system("cls"); 1131. getch(); 1132. goto again; 1133. } 1134. case 2: 1135. 1136. //TO DISPALY THE CANTEEN DETAILS 1137. 1138. system("cls"); 1139. cout<<"\n\n\n\n\n\t\t\t\t SHOP DETAILS \n\n\n"; 1140. cout<<"\t\t # TIMING: 11AM TO 02 PM & 03 PM TO 05 PM \n"; 1141. cout<<"\t\t # SHOP WILL BE CLOSED ON TUESDAY \n"; 1142. cout<<"\t\t # GOODS ONCE SOLD WILL NOT BE EXCHANGED/REPLACED \n"
; 1143. cout<<"\t\t # TAKE YOUR SMART CARD WITH YOU \n"; 1144. cout<<"\t\t # COLLECT YOUR CARD AND BILL AFTER PAYMENT \n"; 1145. cout<<"\t\t # DO NOT BREAK ANY SHOP ITEMS \n"; 1146. cout<<"\t\t # 25 YEARS OF EXPERIENCE \n"; 1147. cout<<"\t\t # CHAIR PERSON- MR. NISHU WADEKAR \n"; 1148. cout<<"\t\t # AN ISO 9001-2015 CERTIFIED COMPANY \n"; 1149. cout<<"\t\t # EMAIL:- [email protected] \n"; 1150. getch(); 1151. system("cls"); 1152. goto again; 1153. case 3: 1154. system("cls"); 1155. search(); 1156. getch(); 1157. goto again; 1158. case 4: 1159. system("cls"); 1160. del(); 1161. getch(); 1162. goto again; 1163. case 5: 1164. system("cls"); 1165. update(); 1166. getch(); 1167. goto again; 1168. case 6: 1169. system("cls"); 1170. read(); 1171. getch(); 1172. goto again; 1173. case 7: 1174. system("cls"); 1175. if(m>0||n>0||o>0||p>0||q>0||r>0||s>0||t>0||u>0||v>0) 1176. {
29
1177. cout<<"\n\t\t Items available in shop \n\n\n"; 1178. cout<<"\n Items"<<setw(40)<<"QUANTITY"; 1179. cout<<"\n\n\n PENDRIVE"<< setw(37)<<abis; 1180. cout<<"\n\n\n SCANNER"<< setw(38)<<apep; 1181. cout<<"\n\n\n PRINTER"<< setw(38)<<aden; 1182. cout<<"\n\n\n WEBCAM"<< setw(39)<<amun; 1183. cout<<"\n\n\n GRAPHIC CARD"<< setw(33)<<aperk; 1184. cout<<"\n\n\n RAM"<< setw(42)<<acoc; 1185. cout<<"\n\n\n HARD DISK"<< setw(35)<<atit; 1186. cout<<"\n\n\n WINDOWS ORIGINAL CD"<< setw(26)<<alux; 1187. cout<<"\n\n\n ANITVIRUS"<< setw(36)<<atid; 1188. cout<<"\n\n\n MOUSE"<< setw(40)<<aree; 1189. getch(); 1190. goto again; 1191. } 1192. else 1193. { 1194. { 1195. cout<<"\n\t\t Items available in shop \n\n\n"; 1196. cout<<"\n Items"<<setw(40)<<"QUANTITY"; 1197. cout<<"\n\n PENDRIVE"<<setw(37)<<"1000"; 1198. cout<<"\n\n SCANNER"<<setw(38)<<"1000"; 1199. cout<<"\n\n PRINTER"<<setw(37)<<"110"; 1200. cout<<"\n\n WEBCAM"<<setw(39)<<"1000"; 1201. cout<<"\n\n GRAPHIC CARD"<<setw(32)<<"500"; 1202. cout<<"\n\n RAM"<<setw(41)<<"400"; 1203. cout<<"\n\n HARD DISK"<<setw(35)<<"100"; 1204. cout<<"\n\n WINDOWS ORIGINAL CD"<<setw(26)<<"1000"; 1205. cout<<"\n\n ANITVIRUS"<<setw(36)<<"1000"; 1206. cout<<"\n\n MOUSE"<<setw(39)<<"300"; 1207. getch(); 1208. goto again; 1209. } 1210. case 0: 1211. system("cls"); 1212. cout<<"\n\n\n\t Are you sure to exit from the program? (y/n)
\t"; 1213. cin>>et; 1214. if(et=='y'||et=='Y') 1215. { 1216. goto ex; 1217. } 1218. else 1219. { 1220. goto again; 1221. } 1222. ex:; 1223. system("cls"); 1224. system("cls"); 1225. gotoxy(35,10); 1226. cout<<"THANKS"; 1227. Sleep(1000); 1228. system("cls"); 1229. gotoxy(15,30); 1230. cout<<"THANK YOU FOR USING THE PROJECT \n\n\n\n"; 1231. gotoxy(35,5); 1232. cout<<("HAVE A NICE DAY!"); 1233. gotoxy(45,10); 1234. cout<<("Press ENTER to EXIT"); 1235. getch(); 1236. exit(0);
30
1237. default: 1238. cout<<"OOPS!!! Your choice is wrong"; 1239. getch(); 1240. goto again; 1241. } 1242. } 1243. }
31
32
33
34
35
www.google.com
en.wikipedia.org
Computer Science with C++ by
Sumita Arora
Object Oriented Programming by
Robert Lafore
Let us c++ written by Yashwanth
Kanethkar