Switch Statement Help

I have the rest of my coding correct but I am doing something wrong with the switch statement. Can someone let me know what I am doing wrong?

#include <iostream>
#include <string>

using namespace std;

int main()
{

string pName;
string sTitle1, sTitle2, sTitle3;
string sArtist1, sArtist2, sArtist3;
string sGenre1, sGenre2, sGenre3;
float sLength1, sLength2, sLength3;
float totalLength;
float playlistAverage;


cout << "############################################################\n";
cout << " Welcome to the DJ Dance Playlist Manager\n";
cout << "############################################################\n\n\n";


cout << "Insert a name for this playlist: ";
getline (cin, pName);


cout << "Insert the title of the first song: ";
getline (cin, sTitle1);
cout << "Insert the artist name of the first song: ";
getline (cin, sArtist1);
cout << "Insert the genre of the first song: ";
getline (cin, sGenre1);
cout << "Insert the length of the first song: ";
cin >> sLength1;
fflush(stdin);


cout << "\nInsert the title of the second song: ";
getline (cin, sTitle2);
cout << "Insert the artist name of the second song: ";
getline (cin, sArtist2);
cout << "Insert the genre of the second song: ";
getline (cin, sGenre2);
cout << "Insert the length of the second song: ";
cin >> sLength2;
fflush(stdin);


cout << "\nInsert the title of the third song: ";
getline (cin, sTitle3);
cout << "Insert the artist name of the third song: ";
getline (cin, sArtist3);
cout << "Insert the genre of the third song: ";
getline (cin, sGenre3);
cout << "Insert the length of the third song: ";
cin >> sLength3;

cout << "Choose your favorite genre" << endl;
cout << " 1 : " << sGenre1 << endl;
cout << " 2 : " << sGenre2 << endl;
cout << " 3 : " << sGenre3 << endl;
cout << " 4 : Exit program " << endl;

int choice = 0;


cout << "Your choice: ";
cin>>choice;
switch(choice)
{
case 1:
cout << “Sweet Choice!” << endl;
break;
case 2:
cout << “Rad Decision!” << endl;
break;
case 3:
cout << “Tubular Thinking!” << endl;
break;
case 4:
cout << "Exiting program..." << endl;
break;
}




totalLength = sLength1 + sLength2 + sLength3;
playlistAverage = sLength1 + sLength2 + sLength3 / 3;

cout << "Name of the playlist: " << pName << "\n\n";
cout << "1.--------------------------------------\n";
cout << " Title: \t" << sTitle1 << "\n";
cout << " Artist:\t" << sArtist1 << "\n";
cout << " Genre: \t" << sGenre1 << "\n";
cout << " Length:\t" << sLength1 << "\n\n";

cout << "2.--------------------------------------\n";
cout << " Title: \t" << sTitle2 << "\n";
cout << " Artist:\t" << sArtist2 << "\n";
cout << " Genre: \t" << sGenre2 << "\n";
cout << " Length:\t" << sLength2 << "\n\n";

cout << "3.--------------------------------------\n";
cout << " Title: \t" << sTitle3 << "\n";
cout << " Artist:\t" << sArtist3 << "\n";
cout << " Genre: \t" << sGenre3 << "\n";
cout << " Length:\t" << sLength3 << "\n\n";




cout << "The playlist named " << pName << " has a total length of " << totalLength << " minutes.";
cout << "Also, the playlist named " << pName << " has an average length of " << playlistAverage << "minutes";
}
You are using the wrong kind of quotes on switch statement.

“ vs ".
Wow I can't believe I missed that. Thank you. Maybe I should take a break for my eyes sake haha.
Topic archived. No new replies allowed.