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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started