I have to take in a list of song names. When the user types in "mmm" then it stops, and it spits out the first and last song titles in a sorted list (alphabetically). This is what I came up with, and there's many an error, all seemingly bool errors.
So, any suggestions?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string songTitles;
int songMax = 0;
int songMin = 0;
while (songTitles != "mmm")
{
cout << "Please enter a song title: ";
getline (cin, "songTitle")
if (songTitles != "mmm")
songTitles = songMin;
if (songTitles < songMin && songTitles != "mmm")
songTitles = songMin;
if (songTitles > songMin && songTitles != "mmm")
songTitles = songMax;
if (songTitles > songMax && songTitles != "mmm")
songTitles = songMax;
}
cout << "First song: " << songMin;
cout << "Last song: " << songMax;
return 0;
}