Can you help with a C++ Program for the following: Define a type of map that stores a collection of songs. Each song has a title, an artist and a recording year. The title and artist are strings and both can consist of multiple words. The year is an integer. The titles of the songs should be used as keys. Use a type alias (using) to give this type of map the name SongMap. Define any other types you may need. You can use your class Song from earlier assignments, if you want. (b) Suppose that a file contains the titles, artists and recording years of a collection of songs. The data for each song is given on three consecutive lines, as follows: Title Artist Recording year Create a function read_songs(m, file_name) that reads a song file and stores all the data in map m. The argument m is a SongMap and the argument file_name is a C++ string. (c) Create a function print_recent(m, year) that prints to standard output the titles of all the songs in m that were recorded since the given year. The argument m is a SongMap and the argument year is an integer.
Can you help with a C++
Define a type of map that stores a collection of songs. Each song has
a title, an artist and a recording year. The title and artist are strings
and both can consist of multiple words. The year is an integer. The
titles of the songs should be used as keys. Use a type alias (using) to
give this type of map the name SongMap. Define any other types you
may need. You can use your class Song from earlier assignments, if
you want.
(b) Suppose that a file contains the titles, artists and recording years of
a collection of songs. The data for each song is given on three consecutive lines, as follows:
Title
Artist
Recording year
Create a function read_songs(m, file_name) that reads a
song file and stores all the data in map m. The argument m is a
SongMap and the argument file_name is a C++ string.
(c) Create a function print_recent(m, year) that prints to standard output the titles of all the songs in m that were recorded since
the given year. The argument m is a SongMap and the argument
year is an integer.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images