Science 7 - LAND and SEA BREEZE and its Characteristics
Computer Investigatory Project
1. 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. 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. 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.
5. 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. 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.
8. 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. 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<<"nnnnnCustomer ID : ";
42. cin>>cno;
43. cout<<"nnnCustomer Name : ";
44. gets(cname);
45. cout<<"nnnCustomer Address : ";
46. gets(address);
47. cout<<"nnnCustomer Service Number : ";
10. 10
48. cin>>a;
49. cout<<"nnnCustomer Smart Card Number : ";
50. cin>>b;
51. cout<<"nnnCustomer Phone Number : ";
52. cin>>c;
53. cout<<"nnnCustomer Bill Number : ";
54. cin>>i;
55. }
56.
57. //FUNCTION TO DISPLAY THE VALUES
58.
59. void display()
60. {
61. cout<<"nn";
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<<"nntDo 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. 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<<"nn End of the file reachednn";
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<<"nn Enter Customer ID you want to search :t";
133. cin>>rn;
134. cout<<"nn 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<<"nntRECORD 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<<"nn Enter Customer ID you went to DELETE :t";
161. cin>>rno;
162. cout<<"nn 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. 12
170. found='t';
171. cout<<"nn 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<<"nntRECORD NOT FOUNDn";
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<<"nnn Now the file containsnnn";
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<<"nn Enter the Customer ID you want to MODIFY :t";
207. cin>>rno;
208. cout<<"nn 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<<"nntRECORD NOT FOUNDn";
225. f1.seekg(0);
226. system("cls");
227. cout<<"n Now the file containsnn";
228. c.display();
229. f1.close();
13. 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<<"nnnnnnnnnnnntttt WELCOMEnn";
250. cout<<"tttt TOnn";
251. cout<<"tttt RELIANCE DIGITALSnn";
252. getch();
253. system("cls");
254. cout<<"nntPLEASE BE CAREFUL ENTER THE PASSWORD IN SMALL LETTERSn";
255. cout<<"nttPASSWORD DOES NOT CONTAINS ANY NUMBERnnn";
256. pass:;
257. cout<<"nntttEnter your Passwordt";
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<<"nntPlease wait a moment";
275. Sleep(1500);
276. if(strcmp(str,"adinjha")==0)
277. {
278. system("cls");
279. cout<<"nnntLoading";
280. Sleep(1000);
281. cout<<"..";
282. Sleep(1000);
283. cout<<"..";
284. Sleep(500);
285. cout<<"..";
286. Sleep(500);
287. cout<<"..";
288. Sleep(500);
14. 14
289. cout<<"..";
290. Sleep(500);
291. cout<<"..";
292. Sleep(500);
293. cout<<"nnntOpening..........";
294. Sleep(2000);
295. }
296. else
297. {
298. cout<<"nntt Ooop's wrong password!!!!!!!!!!!n";
299. cout<<"nnttPlease 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 PROJECTn");
314. cout<<"nn";
315. cout<<(" WELCOME TO RELIANCE DIGITALSn");
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. ARUNAn");
322. gotoxy(1,2);
323. cout<< (" BY : HIMANSHU UPADHAYAY , DEVINDER SINGH , NISHANT JHA , SAI
PRASHANTHn");
324. gotoxy(1,2);
325. cout<<(" ROLL NO : 16 , 18 , 23 31n");
326. gotoxy(1,2);
327. cout<<(" CLASS : XII Cn");
328. gotoxy(1,2);
329. cout<<(" YEAR : 2015-2016n");
330. cout<<"nn";
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. 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. 16
404. system("cls");
405. cout<<"nttt * RELIANCE *nn";
406. cout<<"nnttt* 1.NEW CUSTOMER *";
407. cout<<"nnttt* 2.DETAILS *";
408. cout<<"nnttt* 3.SEARCH A RECORD *";
409. cout<<"nnttt* 4.DELETE A RECORD *";
410. cout<<"nnttt* 5.MODIFY A RECORD *";
411. cout<<"nnttt* 6.DISPLAY ALL RECORD *";
412. cout<<"nnttt* 7.QUANTITY AVAILABLE *";
413. cout<<"nnttt* 0.EXIT *";
414. cout<<"nnnnt ENTER YOUR CHOICE :t";
415. cin>>d;
416. switch(d)
417. {
418. case 1:
419. system("cls");
420. cout<<"nnnttt RELIANCE DIGITALS ";
421. cout<<"nnnttt CONSUMER INFORMATION ";
422.
423. //TO ENTER THE DETAILS OF THE COSTUMER
424.
425. write();
426.
427. //ITEM AND THEIR RATES
428.
429. cout<<"nn 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<<"ntttt PURCHASE LIST";
440. cout<<"nnttt 1.PENDRIVE";
441. cout<<"nnttt 2.SCANNER";
442. cout<<"nnttt 3.PRINTER";
443. cout<<"nnttt 4.WEBCAM";
444. cout<<"nnttt 5.GRAPHIC CARD";
445. cout<<"nnttt 6.RAM";
446. cout<<"nnttt 7.HARD DISK";
447. cout<<"nnttt 8.WINDOWS ORIGINAL CD'S";
448. cout<<"nnttt 9.ANTIVIRUS";
449. cout<<"nnttt 10.MOUSE";
450. cout<<"nnttt ENTER YOUR CHOICEt";
451. cin>>choice;
452. if(choice==1)
453. {
454.
455. //ITEMS AND RATES
456.
457. bis:;
458. system("cls");
459. cout<<"nntttPEMDRIVESnn";
460. cout<<"n ITEMStttttRATEn";
461. cout<<"n 1. 2GB ttttt350n";
462. cout<<"n 2. 4GB ttttt500n";
463. cout<<"n 3. 5GB ttttt700n";
464. cout<<"n 4. 8GB ttttt800n";
35. 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