Question: I need this answered using C programming please, not C++ so not using cout or any of those functions from C++ thanks Also please solve
You are to read a song database from a file that contains the following data attributes for each song: artist, album, genre, year, and duration. Write a C program that a) Asks the user to enter the file that contains the song database. Reads the songs from the file into an array of type song of size up to 100 songs (the file is assumed not to exceed this limit). Allows a user to query for any songs that match a char attribute. b) c) Your program MUST use the following structure: typedef struct char title[100]; char artist[10]; char album[10e]; int year int duration; song; Note that the duration is stored in seconds, but should be displayed in the format mm:ss when printed on creen. Your program MUST use the following two user-defined functions -You are allowed to add arguments to the functions but not remove. You are allowed to develop other functions song readsong (FILE inp); /reads one song from the file pointed by inp and returns it void printSong (song *s); // prints all attributes of a song pointed by s void searchSong (song x[], int size, char target[], int att); /x is the array of songs, size is the length of the array, target is the target string the user is searching for, and att is to search by title, 1 to search by artist, or 2 to search by album. Printing of matching songs occurs within this function by calling the printSong function Note: You will not be penalized if you choose to use a dynamically allocated array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
