#include #include #include #include #include #include #include void bye_bye(); void initiate(); void welcome_screen(); void aid(); void call(char[]); //--------------------------------CLASS------------------------------------class Music { private: char Track_Id[10]; char Track_Name[20]; char Category[20]; char Marketing_Brand[20]; char Year_of_release[15]; int Stock_record; float Record_Price; public : void add_records(); void enter_data(); void enter_datas(); void show_data(); void search(); void edit(); void create(); void view_data(); void delete_record(); void test(); int check(char[]); char Choice(char*); }global; //-------------------------------FUNCTIONS---------------------------//FUNCTION 1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void aid() { clrscr(); cout<<" --------------------"<
cout<<" --------------------"< ADD TRACKS "< VIEW DATA FROM FILE "< SEARCH RECORD(s)"< EDIT DATA "< DELETE RECORDS FROM FILE "< EXIT TO PROGRAM WINDOWS " <
//FUNCTION 4: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::enter_data() { cout<<" WELCOME TO MUSIC MILLENIUM "<=1) { cout<<" The Id entered already exists, please enter a new Id "<>Stock_record; cout<<" ~ Enter track's price " <>Record_Price; } //FUNCTION 5~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char Music::Choice(char *s) { cout<<"\n MODIFY \t "<
gets(Track_Name); } cout<>Stock_record; } cout<>Record_Price; } cout<
//FUNCTION 8~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::create() { ifstream mem0; mem0.open("MUWORLD",ios::binary); mem0.close(); } //FUNCTION 9~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::search() { ifstream mem1; mem1.open("MUWORLD",ios::binary); if(!mem1) { cout<<" No space No space "; getch(); exit(0); } int z=0; char searchh[10]; char ch='y'; while(ch=='y'||ch=='Y') { z=0; global.test(); cout<<" Enter tracks Id to Search: "<
if(z==0) { cout<<" No such track present, please enter the Id properly "<>ch; aid(); } } //FUNCTION 10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::view_data() { ifstream mem3; mem3.open("MUWORLD",ios::binary); if(!mem3) { cout<<" No space present "; getch(); exit(0); } global.test(); char chy='y'; int x=0,y=0; char choice1; char Id[10]; while(chy=='y'||chy=='Y') { mem3.seekg(0); aid(); cout<<" ->Enter your choice:"< see record of choice"< all records"< exit"<>choice1; switch(choice1) { case 'U': case 'u': x=0; mem3.close(); mem3.open("MUWORLD"); cout<<" Enter tracks Id "<
while(mem3.read((char*)&global,sizeof(global))) { if(strcmp(global.Track_Id,Id)==0) { global.show_data(); x++; } } mem3.seekg(0); mem3.close(); if(x==0) cout<<" No such Id present, Enter proper ID "; break; case 'V': case 'v': y=0; mem3.close(); mem3.open("MUWORLD"); while(mem3.read((char*)&global,sizeof(global))) { global.show_data(); y++; } mem3.seekg(0); mem3.close(); if(y==0) cout<<" NO DATA PRESENT "<
}
default: cout<<" Enter proper choice U or V "; //for switch mem3.close(); cout<>chy; } cout<<" Press any key to continue :-";
aid();
getch(); }
//for function
//FUNCTION 11~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::add_records() { ofstream mem4("MUWORLD",ios::binary|ios::ate); if(!mem4) { cout<<" Not enough space "; getch(); exit(0); } global.test(); mem4.close(); char chyr='y'; while(chyr=='y'||chyr=='Y') { mem4.open("MUWORLD",ios::ate); global.enter_data(); mem4.write((char*)&global,sizeof(global)); cout<<" Track Added , Wana continue "; cin>>chyr; if(chyr=='y'||chyr=='Y') mem4.close(); aid(); } mem4.close(); } //FUNCTION 12~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void Music::edit() { ifstream mem7; mem7.open("MUWORLD",ios::binary); ofstream mem12; mem12.open("M",ios::binary,ios::ate); if(!mem7) { cout<<" No space No space "; getch(); exit(0); }
mem7.close(); mem12.close(); char p; int z=0; char editt[10]; char ch='y'; while(ch=='y'||ch=='Y') { z=0; Music::test(); cout<<" Enter 'e' Id to Edit : "<>p; switch(p) { case 'e': case 'E': cout<<" Enter tracks Id to Edit : "<
cout<<" Want to continue "; cin>>ch; aid(); } aid(); } //FUNCTION 13~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Music::delete_record() { global.test(); ifstream mem9("MUWORLD",ios::binary); ofstream mem10("TEMPM",ios::binary|ios::app); if(!mem9&&!mem10) { cout<<" Not Enough Space "<>tem; switch(tem) { case 3: return; case 2: mem9.close(); mem9.open("MUWORLD"); int m=0; cout<<" Enter the Id of track to be deleted "<
} mem9.seekg(0); mem9.close(); mem10.close(); if(m==0) cout<<" NO SUCH ID PRESENT, ID MUST HAVE BEEN DELETED "<>entry; aid(); } mem9.close(); mem10.close(); remove("MUWORLD"); rename("TEMPM","MUWORLD"); } //~~~~~~~~~~~~~~~~~~~HICCUPS DISPLAY~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void call(char a[50]) { int l,i; l=strlen(a); for (i=0;i
cprintf("%c",a[i]); } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~WELCOME~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void welcome_screen() { clrscr(); int xx; for(xx=1;xx<80;xx++) cout<<"*"; for(xx=1;xx<=48;xx++) { gotoxy(1,xx); cout<<"*"; } for(xx=1;xx<=48;xx++) { gotoxy(79,xx); cout<<"*"<=0;x--) { delay(5); if(x==639)
// make box
//Design
{ delay(50); gotoxy(2,13); cout<<" --------------------------------------------------------------------------"; gotoxy(2,21); cout<<" --------------------------------------------------------------------------"; gotoxy(38,15); call("PRESENTING"); gotoxy(29,17); call("A PROJECT ON "); gotoxy(33,19); call("MUSIC SHOP MANAGEMENT"); delay(50); } }
gotoxy(22,25); for(int k=0;k<52;k++) { cout<<"#"; } for(k=25;k<29;k++) { gotoxy(22,k); cout<<"#"<25;k--) { gotoxy(73,k); cout<<"#"; } gotoxy(23,27); cputs(" LOADING "); for(int h=1;h<=38;h++) { cprintf("%c",14); delay(100); } gotoxy(2,47); cputs(" COMPLETE ..... "); gotoxy(29,47); //takes to the beginning of line cputs("Press Any Key To Login...."); getch(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~BYE--BYE~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void bye_bye() { clrscr(); int x; for(x=1;x<80;x++) cout<<"*"; gotoxy(1,1); for(x=1;x<=48;x++) cout<<"*"<
cout<<" --------------------"< ADD TRACKS "< VIEW DATA FROM FILE "< SEARCH RECORD(s)"< EDIT DATA "< DELETE RECORDS FROM FILE "< EXIT TO PROGRAM WINDOWS " <>choose; switch(choose) { case '1': global.add_records(); break; case '2': global.view_data(); break; case '3': global.search(); break; case '4': global.edit(); break; case '5': global.delete_record(); break; case '6': return; default: cout<<" Please enter proper choice "<>contin; if(contin=='y'||contin=='Y') aid(); } }
//~~~~~~~~~~~~~~~~~~~~VOID MAIN FUNCTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void main() {char pass[20]; welcome_screen(); clrscr(); gotoxy(30,15); cout<<" ENTER THE PASSWORD : "<