Write your question here. With the aid of three parallel arrays, accept the name of six songs, the artists who sang the songs, as well as the play count for each song. Using a fourth array assign a rating to the song based on the following criteria: Play Count Rating
0 0
1 - 3 1
4 - 5 2
6 - 8 3
9 - 12 4
Over 12 5
Display the name of the songs, as well as the person who sang the songs
I'm not so good with parallel array's
but I did make a list of artist nd songs (I didn't use real ones just made up artist and songs)
artist song play count rating
sam tuner western wind 5 2
tina baher I love you always 7 3
Justin smith pearls 8 3
adam Lockheed heart of steel 3 1
sarah Farrah timeless 12 4
amy Anderson for you 13 5
if the play rate is 0 then the rating is 0
if the playrate is 1 to 3 then the rating is 1
if the playrate is 4 to 5 then the rating is 2
if the playrate is 6 to 8 then the rating is 3
if the playrate is 9 to 12 then the rating is 4
if the playrate is over 12 then the rating is 5
#include <iostream>
using std::string;
int main()
{
string artist[6] = { "tina baher", ...};
string song[6] = { " I love you always", ... };
int playrate[6] = { 7, ...};
int rating [6] = { 0 }; //empty at the start
return 0;
}
There's a start you can work on. The principle involved in parallel arrays is the common index number which enables access to the various arrays to store and retrieve the various details.
You will have to write a few lines of code to fill the rating array once you have loaded the other data. Probably use a for loop with a switch or if's control. If you don't know what that means then go to the tutorials here or your textbook/notes
if I waited to change it so it will accept any song ,artist ,playrate then based on the playrate give it a rating(based on the criteria) like on an ipod.