Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

using visual studio 2015 Rubrics: The songs.txt file can be read by the applicat

ID: 3808687 • Letter: U

Question

using visual studio 2015

Rubrics:

The songs.txt file can be read by the application and the songs'information stored in arrays--

Levels of Achievement:

Points 0 (0%) - 10 (20%)

The user enters the length of the event and the songs that will be played during the event are listed--

Levels of Achievement:

Points 0 (0%) - 10 (20%)

The songs can be displayed by genre--

Levels of Achievement:

Points 0 (0%) - 10 (20%)

A second form displays the playlist in the current order or as a sorted song list--

Levels of Achievement:

Points 0 (0%) - 10 (20%)

A Clear and Exit menu items are provided in the application--

Levels of Achievement:

Points 0 (0%) - 4 (8%)

Case Programming Assignments WEDDING BAND according to the prog the cod application and write the code that will execute writing ure 8-117. Before user create a Use Case Definition Before event planning document for each event in the program REQUIREMENTS DOCUMENT March 4, 2017 Date: Date Submitted: Application Title: Wedding Band This Windows application opens a text file that contains song names ordered by popularity, their music genre, and the song length in minutes. The application determines how many songs from the playlist can be performed during the reception and displays the songs to be played. A Purpose list of songs in a particular can be displayed In a Windows the user can enter the length of the reception and view the songs application, Program that be performed from the playlist. The user can also select a type of music and have the will Procedures: appropriate songs on the playlist displayed in sorted order. 1. The application opens and reads the values from a song list named songs.txt, which includes Algorithms, Processing, and the title, genre, and length of each song. The length of each song is listed in the format minutes seconds. For example, 3.16 represents 3 minutes and 16 seconds. Conditions: 2. The user can enter the length of the event and tap or click the Show Music List button to display the songs that will be performed from the playlist during the event 3. The user can tap or click a drop-down list of music genres, select a genre, and display the ongs in the playlist from that genre 4. The user can select the Display Song Set menu item to open a second Form object that provides a choice of displaying the playlist in the current play order or as a sorted song list The first Form object closes. The second Form object provides a button that the user can tap or click to return to the first Form object 5. The user can select the Clear menu item to clear and reset the first Form object. The user can also select the Exit menu item to close the application. Notes and Restrictions: The songs.txt file is available on CengageBrain.com Comments: FIGURE 8-117

Explanation / Answer

I have created the event planning scenario which gives the length of the song and provides the length of the songs array. I have attached the code along with the comments for the code.

Code:-

// Header Declaration
#include <iostream>
#include <fstream>
#include <cstring>

using namespace std;

// Here we are defining the constanats
const int MAXCHAR = 300;
// Create a struct class
struct EventPlanning
{
   char songName[MAXCHAR];
   int songList;
   char album[MAXCHAR];

};

// add the parameters to the function
int readSongData(ifstream &fileList, EventPlanning songArray[]);

int main()
{
string songLength = "";

// To let the user type some input
cout << "Please enters the length of the event : >";
getline(cin, songLength);
cout << "The length of the event: " << songLength << endl << endl;
   EventPlanning collectionList[MAXCHAR];
   ifstream fileList;
   ofstream outFile;
   int songCount = 0;

   fileList.open("songs.txt");

   songCount = readSongData(fileList, collectionList);

   for (int i = 0; i < songCount; i++)
   {
       cout << collectionList[i].songName << " "
           << collectionList[i].songList << " "  
           << collectionList[i].album << endl;
   }
}

// user inputs eventplanning data into arrays and returns the specified set of data in the list

int readSongData(ifstream &fileList, EventPlanning songArray[])
{
   char delim;
   int count = 0;
   while (fileList)
   {

      
       fileList.getline(songArray[count].songName, MAXCHAR, ';');

       fileList >> songArray[count].songList >> delim;
       fileList.getline(songArray[count].album, MAXCHAR);

       if(fileList)
       {
           count++;
       }
   }
   return count;
}