Computer Science Project: Music Store
Computer Science Project: Music Store
Music Store
Irfan Sheikh
XII-B
CONTENTS
CERTIFICATE
ACNOWLEGMENT
SYNOPSIS
PROGRAM CODE
OUTPUT SNAPSHOTS
BIBLIOGRAPHY
CERTIFICATE
SIGNATURE
Ms. Pratibha Dwivedi
HOD (Computer Department)
DAV Public School, Vasant Kunj
ACKNOWLEDGEMEMT
SYNOPSIS
Music Store is an Entertaining Program to fulfil all requirements of
Music lovers. It provides a user friendly interactive text mode screen
where user has the facility to record, modify, search, delete and
generate bill. It takes the inputs from the customer for their required
music and show their details if the record has been saved by the
Administrator. The program has the following options: 1. Upload Data.
2. Read Data.
3. Search for Data.
4. Modify Data.
5. Delete Data.
Upload Data- Here user enters all the data to generate bill, it asks the
favourite music no. and quantities of CDs required. These data are
required to generate bill on the program ask to continue after
completion of one record that way all customer data can entered into
the system.
Read All Data- This option retrieve all entered data for the
verification of the details of the customer. It shows all record one by
one.
Search for Data-Instead of reading all customer data the program has
a facility to search a particular customer data. For Example-It asks to
enter the music no. which is required to be searched and retrieve all
the information based on it.
HARDWARE AND
SOFTWARE
HARDWARE:
RAM
REQUIRED: - 512MB
AVAILABLE: - 2GB
HARD DISK:
REQUIRED: - 40GB
AVAILABLE: - 320GB
SOFTWARE:
OPERATING SYSTEM: -WINDOWS XP/WINDOWS 7
TURBO C++
MICROSOFT OFFICE (MS WORD)
char* retname()
{return name;}
int retdis()
{return dis;}
};
fstream rockers;
music mu;
void write_music()
{
rockers.open("Collection.dat",ios::out|ios::app);
mu.create_music();
rockers.write((char*)&mu,sizeof(music));
rockers.close();
cout<<"\n\nThe Music CD Has Been Created ";
getch();
}
void display_all()
{
clrscr();
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
rockers.open("Collection.dat",ios::in);
while(rockers.read((char*)&mu,sizeof(music)))
{
mu.show_music();
cout<<"\n\n====================================\n";
getch();
}
rockers.close();
getch();
}
void display_sp(int n)
{
int flag=0;
rockers.open("Collection.dat",ios::in);
while(rockers.read((char*)&mu,sizeof(music)))
{
if(mu.retmno()==n)
{
clrscr();
mu.show_music();
flag=1;
}
}
rockers.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}
void modify_music()
{
int no,found=0;
clrscr();
cout<<"\n\n\tTo Modify ";
cout<<"\n\n\tPlease Enter The Music No. of Your Favourite One ";
cin>>no;
rockers.open("Collection.dat",ios::in|ios::out);
while(rockers.read((char*)&mu,sizeof(music)) && found==0)
{
if(mu.retmno()==no)
{
mu.show_music();
cout<<"\nPlease Enter The New Details of Music"<<endl;
mu.create_music();
int pos=-1*sizeof(music);
rockers.seekp(pos,ios::cur);
rockers.write((char*)&mu,sizeof(music));
cout<<"\n\n\t Record Updated";
found=1;
}
}
rockers.close();
if(found==0)
cout<<"\n\n Record Not Found ";
getch();
}
void delete_music()
{
int no;
clrscr();
cout<<"\n\n\n\tDelete Record";
cout<<"\n\nPlease Enter The Music no. of The Music You Want To
Delete(means You Hate)";
cin>>no;
rockers.open("Collection.dat",ios::in|ios::out);
fstream rockers2;
rockers2.open("Temp.dat",ios::out);
rockers.seekg(0,ios::beg);
while(rockers.read((char*)&mu,sizeof(music)))
{
if(mu.retmno()!=no)
{
rockers2.write((char*)&mu,sizeof(music));
}
}
rockers2.close();
rockers.close();
remove("Collection.dat");
rename("Temp.dat","Collection.dat");
cout<<"\n\n\tRecord Deleted ..";
getch();
}
void menu()
{
clrscr();
rockers.open("Collection.dat",ios::in);
if(!rockers)
{
cout<<"ERROR!!! MUSIC YOU WANT COULD NOT BE OPEN\n\n\n Go To
Admin Menu to create File";
cout<<"\n\n\n Program is closing ......Just Go And Check Another
Music Store";
getch();
exit(0);
}
cout<<"\n\n\t\tMUSIC MENU\n\n";
cout<<"====================================================\n";
cout<<"M.NO.\t\tNAME\t\tPRICE\n";
cout<<"====================================================\n";
while(rockers.read((char*)&mu,sizeof(music)))
{
cout<<mu.retmno()<<"\t\t"<<mu.retname()<<"\t\t"<<mu.retprice()<<endl;
}
rockers.close();
}
void place_order()
{
int order_arr[50],quan[50],c=0;
float amt,damt,total=0;
char ch='Y';
menu();
cout<<"\n============================";
cout<<"\n
PLACE YOUR ORDER";
cout<<"\n============================\n";
do{
cout<<"\n\nEnter The Music No. Of Your Favourite One : ";
cin>>order_arr[c];
cout<<"\nQuantity of CDs You Want in number : ";
cin>>quan[c];
c++;
cout<<"\nDo You Want To Order Another Music CD ? (y/n)";
cin>>ch;
}while(ch=='y' ||ch=='Y');
cout<<"\n\nThank You For Placing The Order";
getch();
clrscr();
cout<<"\n\n********************************INVOICE*********************
***\n";
cout<<"\nMusic No.\tMusic Name\tQuantity \tPrice \tAmount
\tAmount after discount\n";
for(int x=0;x<=c;x++)
{
rockers.open("Collection.dat",ios::in);
rockers.read((char*)&mu,sizeof(music));
while(!rockers.eof())
{
if(mu.retmno()==order_arr[x])
{
amt=mu.retprice()*quan[x];
damt=amt-(amt*mu.retdis()/100);
cout<<"\n"<<order_arr[x]<<"\t"<<mu.retname()<<"\t"<<quan[x]<<"\t\t"<<mu
.retprice()<<"\t"<<amt<<"\t\t"<<damt;
total+=damt;
}
rockers.read((char*)&mu,sizeof(music));
}
rockers.close();
}
cout<<"\n\n\t\t\t\t\tTOTAL = "<<total;
getch();
}
void intro()
{
clrscr();
gotoxy(31,11);
cout<<"MUSIC WORLD-ALL HITS";
gotoxy(35,14);
cout<<"PURCHASING MUSIC CDs";
gotoxy(35,17);
cout<<"PROJECT";
cout<<"\n\nMADE BY : MRUTUNJAY AND IRFAN";
cout<<"\n\nSCHOOL : DAV PUBLIC SCHOOL";
cout<<"\n ADDRESS :VASANT KUNJ,NEW DELHI";
getch();
}
void musicmaster_menu()
{
clrscr();
char ch2;
cout<<"\n\n\n\tMUSIC MASTER MENU(ADMIN)";
cout<<"\n\n\t1.CREATE MUSIC";
cout<<"\n\n\t2.DISPLAY ALL MUSICS";
cout<<"\n\n\t3.QUERY ";
cout<<"\n\n\t4.MODIFY MUSIC";
cout<<"\n\n\t5.DELETE MUSIC";
cout<<"\n\n\t6.VIEW MUSIC MENU";
cout<<"\n\n\t7.BACK TO MAIN MENU";
cout<<"\n\n\tPlease Enter Your Choice (1-7) ";
ch2=getche();
switch(ch2)
{
case '1': clrscr();
write_music();
break;
SNAPSHOTS
BIBLIOGRAPHY
CLASS NOTEBOOK
C++ COURSE BOOK BY SUMITA ARORA