Prog 2: Rally Songs

9/13 Added the comment on what to do if random line begins with '#', space, or has length 0.  Shown below in blue.

Write a program to display random lyrics from the songs used at 2020 presidential campaign rallies.  Create a quiz to display random lyrics and ask the user to guess if the lyrics are from Donald Trump or Elizabeth Warren.  

Running the program in Codio should look like the following, where user input is shown in bold:

----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 2  Singing Sweet Home Alabama all summer long And the last known survivor stalks his prey in the night Sipping whiskey out the bottle, not thinking 'bout tomorrow  ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 3  Get up now, get up, get up now You're the only one I see And so on and so on and scooby dooby doo  ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 1  Enter the number of lines you want to display -> 5  ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 2  Sweet home Alabama From Detroit down to Houston You had a busy day today Cause I'm as free as a bird now And this bird you can not change  ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 4  Need a little help y'all And you cannot slip You're the one that always calls Yeah, you turn me on (They say love hurts)  Enter 1 for Trump, 2 for Warren: 2  Correct! You got 1 out of 1, which is 100%   ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 4  It was 1989, my thoughts were short my hair was long It was 1989, my thoughts were short my hair was long Carry on, nothing equals the splendor Turning back she just laughs The eye of the tiger  Enter 1 for Trump, 2 for Warren: 2  Wrong! You got 1 out of 2, which is 50%   ----  Program 2: Rally Songs  ---- Select from the following:    1. Set number of lines to display    2. Get random lines from Trump.txt    3. Get random lines from Warren.txt    4. Rally song quiz    5. Exit the program Your choice --> 5  You got 1 out of 2, which is 50% 

What You Need to Know

Variables, Expressions, Decision (if) statements, srand() and rand(), Loops, Functions and Parameters, Reading from a file, strings

Details

Food For Thought (but not assigned)

How many song lyric lines on average do you need to look at to score well on the quiz?  What is the optimal value? 

How are you able to make correct guesses, given your knowledge of the candidates?  How might this sort of expertise (in some future course) be captured?