To the attached music management system www ww program in the text; www www -Add a function that will allow us to add the prices of music; www w m www w ww ww m m -Add a function that will give the total price of the music the user bought.
#include<bits/stdc++.h>
using namespace std;
// Class representing music data
class Song {
public:
string musicName, musicDescription;
};
// Function to take input for music description
Song addDescription()
{
Song s1;
cout<<"Enter the Music name : ";
cin>>s1.musicName;
cout<<"Enter the Music description : ";
cin>>s1.musicDescription;
return s1;
}
// Function to write music object details into a txt file
void storeInfoToDatabase(Song s){
ofstream fileObject;
// Opening the file in append mode
fileObject.open("Database.txt", ios::app);
fileObject << s.musicName;
fileObject << " ";
fileObject << s.musicDescription;
fileObject << "\n";
}
// Driver Function
int main(){
Song s = addDescription();
storeInfoToDatabase(s);
cout<<"Data written into file succesfully...";
return 0;
}
![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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9b0a068a-6846-4ec1-9548-63b636eb96c5%2Ff081cd59-3b70-4bf4-ab32-5bd45994895c%2Fygwypi_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)