You work for a disc jockey who has asked you to obtain a list of the top 1000 mu
ID: 3865832 • Letter: Y
Question
You work for a disc jockey who has asked you to obtain a list of the top 1000 must listen to songs1 and write a program that allows her to list the songs according to Theme, Title, Artist, Year. In addition, from the list she can select a particular song to Be played on “Spotify” (NOTE: the "playing on Spotify" is sketchy and may not work correctly on your computer but as long as the code to do so is correct then you will get full credit). To be considered correct, your program will need to implement several functions described next.
COLUMNINDEX GetColumIndex(…) – This function takes a string as an argument (which is one of the column names in the 1000songs.csv file) and returns an enumeration which needs to be used in a branching statement in your main routine to determine what data to prompt for next. The enumeration type is defined as: enum COLUMNINDEX { THEME, TITLE, ARTIST, YEAR, SPOTIFYURL};
void LaunchSpotify(…) – This function takes the Spotify URL and attempts to launch a web browser and play the song. The reason I say attempt is because sometimes it works … and sometimes it doesn’t. The reasons are vast such as what web browser is configured as the default, user privileges, the data itself, and the data is kind of “dirty”, and other things. But implement it anyhow. if you discover a better method indicate it in your program and I will give you some extra points. In this void LaunchSpotify(…) function, to launch your default Web browser and go to the page indicated by the Spotify URL (Links to an external site.)Links to an external site., call the Windows function:
ShellExecuteA(NULL, NULL, strURL.c_str(), NULL, NULL, SW_SHOWNORMAL); (Links to an external site.)Links to an external site.
NOTE: “strURL.c_str()” is the Spotify URL passed into this.
int main() – The main body of the program.A suggested use for this function follows:
Open the file.
Prompt user for input
Initialize looping variables (i.e. file record number).
While not the end of file …
Get a row from the file.
Look for match (depends on what user selected) and display data.
Check for records per page. If the maximum number of records (lines in the file) has been displayed then pause for user input.
If user wants to go to Spotify prompt for record number and launch Spotify
Explanation / Answer
#include #include // contains prototypes for functions srand and rand #include // contains prototype for function time using namespace std; // enumeration with constants that represent the game status enum Status { CONTINUE = -1, LOST , WON}; // all caps in constants // Declare any functions that are defined in this file int rollDice(int die1, int die2); // rolls dice, calculates and displays sum int getPoint(int myPoint, int Balance, int wager); // play's the craps game and returns game status int continueCraps(int myPoint, int Balance, int wager); // Keep playing craps until a win or loss int main() { int Balance = 1000; //betting balance int wager; // the ammount bet against a round Status gameStatus; // randomize random number generator using current time srand( time( 0 ) ); // seed the random numbers while(Balance >= 0) // while the balance is positive keep running { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.