Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

Question Can any type of stock or securities be used in an ESOP?

Answered: 1 week ago

Question

Question Can a self-employed person adopt a money purchase plan?

Answered: 1 week ago