The user should enter song name and artist name in order of position.The output should be printed in table format and should be allow user to re-arrange songs later if she want to do so.
The user has to enter song name and the new position she wants the song moved to (this means she chooses from the 20 filled positions).For example if the user want to take a song from position10 to position1, the song will make the song in position1 move one position down and the same to the rest of the song
So the problem I have is how to make this work, i have a little knowldge in sorting arrays of which I think could help. Can Someone help me copmlete the following code:
Expand|Select|Wrap|Line Numbers
- //last part of the code
- //print data
- for int pos=0;pos<20;pos++
- cout<<setw(5)<<(pos+1)<<setw(15)<<song[pos]<<setw(15)<<artist[pos]<<endl;
- //here i need to tell the program to move songs one step up or down depending on user choice