Description # Write a class called Song in a file called Song.h with three fields: Title (string) Singer (string) Chart Position (int) # Place these method headers in the Song.h file 1. Getter and setter for each field 2. Other methods 1. Song(); // default constructor 2. Song(std::string title,std::string singer, int chartPosition); // custom constructor 3. std::string toString(); // returns object as a string 4. bool operator<(Song other) // overloads the < operator -returns true if the chart position of this song is les other's 5. friend std::ostream& operator<<(std::ostream&, Song* s); // overloads the << operator #Write the implementation of these methods in a file called Song.cpp # Write a driver called SongMain.cpp that does the following a. Creates a dynamic array that reads in data from SongData.txt and b. Populates the array by constructing song objects from this data c. Uses the non-recursive selection sort method to sort the array according to chart position (uses the overloaded < operator on Song objects) d. Prints the top ten songs in the chart (uses the overloaded << operator) e. Searches for any song by title and returns chart position asks user for song title, does linear search returns position or -1 Todo List: Use the templates given to you. You are given starter code for Song.h, Song.cpp and SongMain.cpp Code marked GIVEN CODE is given to you for free Comments marked //TODO indicated you need to fill in code.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

What will We will implement it according to the given description.. 

 

Description
# Write a class called Song in a file called Song.h with three fields:
Title (string)
Singer (string)
Chart Position (int)
# Place these method headers in the Song.h file
1. Getter and setter for each field
2. Other methods
1. Song();
// default constructor
2. Song(std::string title,std::string singer, int chartPosition);
// custom constructor
3. std::string toString();
// returns object as a string
4. bool operator<(Song other)
// overloads the < operator -returns true if the chart position of this song is less
other's
5. friend std::ostream& operator<<(std::ostream&, Song* s);
// overloads the << operator
# Write the implementation of these methods in a file called Song.cpp
# Write a driver called SongMain.cpp that does the following
a. Creates a dynamic array that reads in data from SongData.txt and
b. Populates the array by constructing song objects from this data
c. Uses the non-recursive selection sort method to sort the array
according to chart position (uses the overloaded < operator on Song
objects)
d. Prints the top ten songs in the chart (uses the overloaded <<
operator)
e. Searches for any song by title and returns chart position
asks user for song title, does linear search returns position or -1
Todo List:
Use the templates given to you. You are given starter code
for
Song.h, Song.cpp and SongMain.cpp
Code marked GIVEN CODE is given to you for free
Comments marked //TODO indicated you need to fill in
code.
Transcribed Image Text:Description # Write a class called Song in a file called Song.h with three fields: Title (string) Singer (string) Chart Position (int) # Place these method headers in the Song.h file 1. Getter and setter for each field 2. Other methods 1. Song(); // default constructor 2. Song(std::string title,std::string singer, int chartPosition); // custom constructor 3. std::string toString(); // returns object as a string 4. bool operator<(Song other) // overloads the < operator -returns true if the chart position of this song is less other's 5. friend std::ostream& operator<<(std::ostream&, Song* s); // overloads the << operator # Write the implementation of these methods in a file called Song.cpp # Write a driver called SongMain.cpp that does the following a. Creates a dynamic array that reads in data from SongData.txt and b. Populates the array by constructing song objects from this data c. Uses the non-recursive selection sort method to sort the array according to chart position (uses the overloaded < operator on Song objects) d. Prints the top ten songs in the chart (uses the overloaded << operator) e. Searches for any song by title and returns chart position asks user for song title, does linear search returns position or -1 Todo List: Use the templates given to you. You are given starter code for Song.h, Song.cpp and SongMain.cpp Code marked GIVEN CODE is given to you for free Comments marked //TODO indicated you need to fill in code.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY