You are on page 1of 25

`

SUBMITTED BY:
AKSHAT MODI

Bio-Data Acknowledgement Lab Certificate Introduction Variables Used Functions Used Program Listing Output Conclusion Bibliography Remarks

GAME CD MANAGEMENT deals with the record maintenance of Game cds. Game Cd Management contains a wide selection of old and recent Games. Our project on Game Cds helps in providing proper means and information to the customer to access over wide range of games in a short period of time.

ACKNOWLEDGEMENT SHEET
I Akshat Modi wish to express my sincere gratitude to my guide as well as my subject teacher MR.ANSHUL GUPTA, who helped me in selecting and completing this assignment successfully and imparting through knowledge of the subject. I further acknowledge the continuous support and guidance of Mrs.P.WADHAWAN (founder principal), Mr.ARUN WADHAWAN and Mr.A.K.LAL (founder directors), and Mrs. Rita Srivastava (principal). I also thank my Parents, my Friends and Classmates who proved to be a major factor in the successful accomplishment of my project.

This is to certify that AKSHAT MODI of class XII-commerce has successfully completed this investigation project all by himself and in compliance with the rules and regulations prescribed by Central Board of Secondary Education, New Delhi in the year 2006-2007

MR. ANSHUL GUPTA [COMPUTER TEACHER]

TYPE VARIABLE
float float int int int int char char char char COST P SP CNO CP CS DOP[10] GR[10] Type[20] N[20]

FUNCTION
Stores the cost of the game Gives the profit Stores the selling price of the game Stores the game number Stores the number of Games purchased Stores the number of Games sold Stores the date of purchase of the Game Stores the Game releaser Store the type of gamemission, educational etc. Stores the name of the Game

FULL FORM
Cost Profit Selling Price Game Number Copies Purchased Copies Sold Date of Puchase Game Releaser Type Name

FUNCTION
VOID INDATA( ) VOID OUTDATA( ) VOID CALCULATE( ) VOID READ( ) VOID ADD( ) VOID DEL( ) VOID MODIFY( )

PURPOSE
To Input The Values To Print The Values To Calculate The Profit To Read The Records To Add The Records To Delete The Records To Modify The Records

#include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> #include<process.h> #include<string.h> class GMANIA { int CNO; int CP; int CS; float COST; float P, SP; char DOP[10],GR[10],N[20],TYPE[20]; public: void indata(); void calculate(); void outdata(); void read(); void add(); void del(); void modify(); }; void GMANIA::indata() { cout<<"Enter Game Cd No. "; cin>>CNO; cout<<endl; cout<<"Enter No. of Copies Purchase "; cin>>CP; cout<<endl; cout<<"Enter No. of Copies Sold "; cin>>CS; cout<<endl; cout<<"Enter Cost Of Game "; cin>>COST;

cout<<endl; cout<<"Enter Selling Price "; cin>>SP; cout<<endl; cout<<"Enter Date Of Purchase "; gets(DOP); cout<<endl; cout<<"Enter Name of Game "; gets(N); cout<<endl; cout<<"Enter Game Releaser "; gets(GR); cout<<endl; cout<<"Enter Type Of Game "; gets(TYPE); cout<<endl; } void GMANIA::calculate() { P=SP-COST; } void GMANIA::outdata() { calculate(); cout<<"Game No. is " <<CNO<<endl<<endl; cout<<"No. of Copies Purchased are"<<CP<<endl<<endl; cout<<"No. of Copies Sold are"<<CS<<endl<<endl; cout<<"Cost of Game is"<<COST<<endl<<endl; cout<<"Selling Price is"<<SP<<endl<<endl; cout<<"Profit is"<<P<<endl<<endl; cout<<"Date Of Purchase is"; puts(DOP); cout<<endl; cout<<"Name of Game is"; puts(N); cout<<endl; cout<<"Game Releaser is";

puts(GR); cout<<endl; cout<<"Type Of Game is"; puts(TYPE); cout<<endl; getch(); } void GMANIA::read() { clrscr(); GMANIA obj; ifstream ifile; ifile.open("game.dat",ios::in); while(ifile) { ifile.read((char*)&obj,sizeof(obj)); obj.outdata(); } ifile.close(); } void GMANIA::add() { clrscr(); GMANIA obj; fstream afile; afile.open("game.dat",ios::app); int x,i; cout<<"Enter no. of games to add"; cin>>x; for(i=0;i<x;i++) { obj.indata(); afile.write((char*)&obj,sizeof(obj)); } afile.close(); } void GMANIA::del()

{ clrscr(); GMANIA obj; ofstream ofile; ofile.open("game1.dat",ios::out); ifstream ifile; ifile.open("game.dat",ios::in); char ch; while(ifile) { ifile.read((char*)&obj,sizeof(obj)); if(ifile.eof()) break; obj.outdata(); cout<<"Do you want to delete this record(Y for yes, N for no)"; cin>>ch; if(ch=='n'||ch=='N') { ofile.write((char*)&obj,sizeof(obj)); } } ifile.close(); ofile.close(); remove("game.dat"); rename("game1.dat","game.dat"); } void GMANIA::modify() { clrscr(); GMANIA obj; char ch; ifstream ifile; ofstream ofile; ifile.open("game.dat",ios::in); ofile.open("game1.dat",ios::out); while(ifile) {

ifile.read((char*)&obj,sizeof(obj)); if(ifile.eof()) break; obj.outdata(); cout<<"Do you want to modify this record y for yes or n for no"; cin>>ch; if(ch=='y') { obj.indata(); } ofile.write((char*)&obj,sizeof(obj)); } ifile.close(); ofile.close(); remove("game.dat"); rename("game1.dat","game.dat"); } void main() { GMANIA obj; int ch; do { clrscr(); for(int i=0;i<18;i++) { cout<<"\n"; } cout<<"\t\t***************MAIN MENU********************"<<endl;cout<<"\n"; cout<<"\t\t\t 1. VIEW ALL GAMES"<<endl; cout<<"\n"; cout<<"\t\t\t 2. ADD GAME"<<endl; cout<<"\n"; cout<<"\t\t\t 3. DELETE RECORDS OF GAME "<<endl; cout<<"\n"; cout<<"\t\t\t 4. MODIFY GAME"<<endl; cout<<"\n"; cout<<"\t\t\t 5. EXIT"<<endl; cout<<"\n";

cout<<"\t\t********************************************"<<e ndl;cout<<"\n"; cout<<"\t\t\t Enter Your Choice"; cin>>ch; switch(ch) { case 1:obj.read(); break; case 2:obj.add(); break; case 3:obj.del(); break; case 4:obj.modify(); break; case 5:exit(0); default:cout<<"Enter Correct Choice"; getch(); } } while(1); }

Screen1
************************MainMenu********************** 1. Read Records 2. Add Records 3. Delete Records 4. Modify Records 5. Exit

Enter your choice :: 1

Screen2
Enter Game Cd no. 088 Enter no. of Copies purchased 12 Enter the no. of copies sold 08 Enter the cost of game 50 Enter selling price 75 Enter date of Purchase 08/01/2007 Enter the name of Freedom Fighters Enter game releaser EA Sports Enter type of game Mission

Enter your choice :: 2

Screen3
Enter no. of games to add 1 Enter game no. 44 Enter no. of Copies purchased 6 Enter the no. of copies sold 4 Enter the cost of game 40 Enter selling price 65 Enter date of Purchase 10/01/2007 Enter the name of game NBA Live 2007 Enter game releaser EA Sports Enter type of game Sporty

Enter your choice :: 3

Screen4
Enter game no. 72 Enter no. of Copies purchased 10 Enter the no. of copies sold 09 Enter the cost of game 60 Enter selling price 90 Enter date of Purchase 12/01/2007 Enter the name of game Project Eden Enter game releaser I O Interactive Enter type of game Mission Do you want to delete this record :: n

Enter your choice :: 4

Screen5
Enter game no. 04 Enter no. of Copies purchased 30 Enter the no. of copies sold 29 Enter the cost of game 50 Enter selling price 80 Enter date of Purchase 04/01/2007

Enter the name of game London Racer 2 Enter game releaser Enter type of game Eidos Interractive Racing

Do you want to modify this record:: y

Screen6
Enter game no. 04 Enter no. of Copies purchased 30 Enter the no. of copies sold 29 Enter the cost of game 50 Enter selling price 80 Enter date of Purchase 04/01/2007

Enter the name of game London Racer 2 Enter game releaser Enter type of game Eidos Interractive Racing

Screen7
Enter correct choice

CONCLUSION

ComputerScience with C++ Sumita Arora Introduction to C++ Rita Sahu

REMARKS

You might also like