Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First, your program roads from a data file named Dopongsdut Each song this dza 11s des Tibed by our information(1)the rank of the song at

image text in transcribed
image text in transcribed
image text in transcribed
First, your program roads from a data file named "Dopongsdut" Each song this dza 11s des Tibed by our information(1)the rank of the song at the end of the yar, (2) the name of the artist,(3) the title of the song and (4) the year the song debut. An example song recoed is shown blow number 1 ranked song artist name Katy Parry Dark Horse 2014 e song titlk bilboard yar There can be a maximum of 500 song records in the data file. You can copy this file inno your project folder with the command cp data/tepsongs dat workspace directory project directory To allow theuerto intoract with the program, display a menu as shown below Billboard Top Song Managemen Please sclect from the following menu choices L. Look up top hits by antist 2. Look up top his by year . Add a new song 4. Delae a song . Exit The program should allow the swer to continually interact with the program by typing menu choices "1-4 The program only terminges when the user types the menuchoice "5 If the us f sclects choce "I'. (s then displays ALL the songs by this artist that have appeared in the billboard chars. If the artist docs not have any op songs in the past 4 years, an emor mosage should be displayed * should be prepud to caler Ehe same of the artil peoFan Display information about the songs in tabula format sing setn(number). For example, if the mame of the artist enlered is: Beyonce, the output of the progr am should be Here are the songs by Beyonce Rank Year 22 2015 72 2015 Best Thing I Never Had 57 22 Drunk in Lave If the wsar selects choice '2". (she should be prompted to enter the year to look for. The program displays the titdles of ALL the songs in that year in table format Diiplay dhe song tals only If the wsr selects choice 3,(s)he should be proempied to enter the Eollowing information (1) the tk (2) the awst mame, (3) the rank, and (4) the year of a new seng. This new song recond should then be * If the user selects choice ,4%she should be prompted enter the u0c of the song to be drkted The program then deletes the song from the ray. If no such song isfound. dsplay an emor message. If the sr selects ', the program teminaes Programming requirements .A user defined function named PrintByArtist should be defined that displays all the songs by an arist This function takes as parameters: the array of songs, the number of son artist name. The array of songs should be passed as a "const amay stored in the amay, and the .A userdefined funcsion named "PrintByYear shouild be defined that displays all the songs in a year This fancton takes as paramets: the amay of songs, tbe number of songs sured ldi the amy, and the year value. The aray of songs should be passed as a "comst" amay Auser defined Saton named "AddSong" should be usod that add a new song into the list of sonp This fancton takes as paramears: the array of songs, the mamber of songs sred in the array * .A userdefined function named "DeleSong should be used that dekte a song from the list of songs This function takes as parameters: the amay of songs, the number of soegs stored in the amay. If the user selects choice 4', (s)he should be prompted to enter the title of the song to be deleted. The program then deletes the song from the array. If no such song is found, display an error message. I he user selects 'S,the program terminates. Programming requirements A user defined function named "PrintByArtist" should be defined that displays all the songs by an artist. This function takes as parameters: the array of songs, the number of songs stored in the array, and the artist name. The array of songs should be passed as a "const" array A user defined function named "PrintByYear" should be defined that displays all the songs in a year. This fiunction takes as parameters: the array of songs, the number of songs stored in the armay, and the year value. The array of songs should be passed as a "const" array A user defined function named "AddSong" should be used that add a new song into the list of songs This function takes as parameters: the array of songs, the number of songs stored in the array .A user defined function named "DeleteSong" should be used that delete a song from the list of songs This function takes as parameters: the array of songs, the number of songs stored in the array This program aims to write a C++program that uses the array of structs to maintain the top hit songs in a database. First, your progam reads from a data file named "topsongs dat. Each song in this data file is described by four information: (1) the rank of the song at the end of the year, (2) the name of the artist, (3) the title of the song, and (4) the year the song debut. An example song record is shown below number 1 ranked song Katy Perry Dark Horse 2014 artist name song title billboard year There can be a maximum of $00 song records in the data file. You can copy this file into your project folder with the command cp cen/data/topsongs dat workspace directory/project directery. To allow the user to interact with the program, display a menu as shown below Billboard Top Song Management Please select from the following menu choices: . Look up top hits by artist 2. Look up top hits by year 3. Add a new song 4. Delete a song . Exit The program should allow the user to continually interact with the program by typing menu choices"I"-4" The program only terminates when the user types the menu choice If the user selects choice, (s )he should be prompted to enter the name of the artist. The program then displays ALL the songs by this artist that have appeared in the billbourd charts. If the artist does not have any top songs in the past 4 years, an error message should be displayed Display information about the songs in tabular format using setw number). For example, if the name of the artist entered is: Beyonce, the output of the program should be: Here are the songs by Beyonce Title Drunk in Love Partition Best ThingI Never Had Countdown Rank Year 22 2015 72 2015 57 2012 100 2012 If the user selects choice "2", (s )he should be prompted to enter the year to look for. The program displays the titles of ALL the songs in that year in table format. (Display the song titles only .If the user selects choice 3'.(syhe should be prompted to enter the following information: (1) the titk (2) the artist name, (3) the rank, and (4) the year of a new song. This new song record should then b added to the end of the list .If the user selects choice 4, (s )he should be prompted to enter the title of the song to be deleted. The If no program then deletes the song from the array. If no such song is found, display an error message. If the user selects S, the program terminates

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago