#includeusing namespace std;// Class representing music dataclass Song {public:string musicName, musicDescription;};// Function to take input for music descriptionSong addDescription(){Song s1;cout<"enter the="" music="" name="" :="">"enter>cin>>s1.musicName;cout<"enter the="" music="" description="" :="">"enter>cin>>s1.musicDescription;return s1;}// Function to write music object details into a txt filevoid storeInfoToDatabase(Song s){ofstream fileObject;// Opening the file in append modefileObject.open("Database.txt", ios::app);fileObject <>fileObject < "="">fileObject <>fileObject <>}// Driver Functionint main(){Song s = addDescription();storeInfoToDatabase(s);cout<"data written="" into="" file="">"data>return 0;}Extracted text: To the attached music management system ww ww w w w mm w program in the text; -Add a function that will allow us to add the prices www ww ww m w m of music; -Add a function that will give the total price of the music the user bought. www ww
// Class representing music dataclass Song {public:string musicName, musicDescription;};// Function to take input for music descriptionSong addDescription(){Song s1;cout<"enter the="" music="" name="" :="">"enter>cin>>s1.musicName;cout<"enter the="" music="" description="" :="">"enter>cin>>s1.musicDescription;return s1;}
// Function to write music object details into a txt filevoid storeInfoToDatabase(Song s){ofstream fileObject;// Opening the file in append modefileObject.open("Database.txt", ios::app);fileObject <>fileObject < "="">fileObject <>fileObject <>}
// Driver Functionint main(){Song s = addDescription();storeInfoToDatabase(s);cout<"data written="" into="" file="">"data>return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here