Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming C programming C programming C programming (The artistes+song.txt file can be any artist and song of your choice eg.) Ed Sheeran Shape of

C programming C programming C programming C programming

image text in transcribed

(The artistes+song.txt file can be any artist and song of your choice eg.)

Ed Sheeran

Shape of you**3:53

Afterglow**3:05

Eminem

Till I Collapse***4:57

Maroon 5

Moves like jagger***3:21

Detailed Specification Input The program takes its input from a 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 artistes+songs.txt. If no such file exists, the program prints a message "No file found." and then prompts the user to enter the artistes and songs information from the keyboard according to the specified format. The format of the file is as follows: Artiste name Song title***Song duration Song title***Song duration Song title***Song duration Artiste name Song title***Song duration Song title***Song duration Song title***Song duration Each song title comprises alphanumeric characters (letters, numbers and symbols) but does not contain the sub-string *** "Song duration" is in the form [m]m:ss, where [m]m denotes a one or two-digit number of minutes and ss denotes a two-digit number of seconds. For testing purposes, at least two artistes should have three or more songs each. Sort artistes and songs Your program should then sort the input by artiste name and then by song title and print it out in the following format: Sorted list of artistes and songs Artiste name o Song title***Song duration o Song title***Song duration o Song title***Song duration Artiste name o Song title***Song duration o Song title***Song duration o Song title***Song duration Detailed Specification Input The program takes its input from a 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 artistes+songs.txt. If no such file exists, the program prints a message "No file found." and then prompts the user to enter the artistes and songs information from the keyboard according to the specified format. The format of the file is as follows: Artiste name Song title***Song duration Song title***Song duration Song title***Song duration Artiste name Song title***Song duration Song title***Song duration Song title***Song duration Each song title comprises alphanumeric characters (letters, numbers and symbols) but does not contain the sub-string *** "Song duration" is in the form [m]m:ss, where [m]m denotes a one or two-digit number of minutes and ss denotes a two-digit number of seconds. For testing purposes, at least two artistes should have three or more songs each. Sort artistes and songs Your program should then sort the input by artiste name and then by song title and print it out in the following format: Sorted list of artistes and songs Artiste name o Song title***Song duration o Song title***Song duration o Song title***Song duration Artiste name o Song title***Song duration o Song title***Song duration o Song title***Song duration

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_2

Step: 3

blur-text-image_3

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 Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

2. What type of team would you recommend?

Answered: 1 week ago