Question: Write a C program; The program takes its input from a .txt file specified as an argument to the program. If the file does not

Write a C program;

The program takes its input from a .txt file specified as an argument to the program. If the file does not exists or is not readable, the program prints out an error message to this effect. If no file is specifed, the program searches in the current directory for a file called songs.txt. If no file exists, the program prints a message No file. and then prompts the user to enter the artists and songs information from the keyboard.

The format of the file is as follows:

Artiste name

Song title***Song duration Song title***Song duration

Your program should then sort the input by artiste name and then by song title and print it out

The program should then generate a random playlist of the songs given as input, according to the following constraints:

An artist cannot have more than two songs in a row

A song cannot appear twice in the playlist;

The total playlist length should be as close as possible to one hour.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!