subject

Given main(), complete the Artist class (in files Artist. h and Artist. cpp) with constructors to initialize an artist's information, get member functions, and a PrintInfo( member function. The default constructor should initialize the artist's name to "None" and the years of birth and death to 0. PrintInfo() should display Artist Name, born if the year of death is -1 or Artist Name (-) otherwise. Complete the Artwork class (in files Artwork. h and Artwork. cpp) with constructors to initialize an artwork's information, get member functions, and a PrintInfo( member function. The constructor should by default initialize the title to "None", the year created to 0. Declare a private field of type Artist in the Artwork class. Ex. If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881-1973) Title: Three Musicians, 1921 If the input is: Brice Marden 1938 -1 Distant Muses 2000 the output is: Artist: Brice Marden, born 1938 Title: Distant Muses, 2000 File is marked as read only Current file: main. cpp 1 #include "Artist. h" 2 #include "Artwork. h" 3 #include 4 #include 5 using namespace std; 7 int main(int argc, const char* argv[]) { string userTitle, userArtistName; int yearCreated, userBirthYear, userDeathYear; getline(cin, userArtistName); cin >> userBirthYear; cin. ignore(); cin >> userDeathYear; cin. ignore(); getline(cin, userTitle); cin >> yearCreated; cin. ignore(); 20 Artist userArtist = Artist(userArtistName, userBirthYear, userDeathYear); Artwork newArtwork = Artwork(userTitle, yearCreated, userArtist); 23 24 newArtwork. PrintInfo(); 25 } Current file: Artist. h 1 #ifndef ARTISTH 2 #define ARTISTH 4 #include 5 using namespace std; 10 12 class Artist public: Artist(); Artist(string artistName, int birthYear, int deathYear); string GetName() const; int GetBirthYear() const; int GetDeathYear() const; void PrintInfo() const; private: // TODO: Declare private data members - artistName, birthYear, deathYear string artistName; int birthYear; int deathYear; }; 14 15 16 18 19 20 22 #endif Current file: Artist. cpp Load default template... 1 #include "Artist. h" 2 #include 3 #include 4 using namespace std; 6 Artist: :Artist() 15 16 artistName = "None"; birthYear = 0; deathYear = 0; 11 } 12 Artist:: Artist(string artistName, int birthYear, int deathYear) 13 { this->artistName = artistName; this->birthYear = birthYear; this->deathYear = deathYear; 17 } 18 string Artist::GetName() const 19 { 20 return artistName; 21 } int Artist::GetBirthYear() const 23 { 24 return birthYear; 25 } 26 int Artist::GetDeathYear() const 27 { return deathYear; 29 30 void Artist::printInfo() const 31 { cout << "Artist: " Β« artistName; if (deathYear != -1) cout << "1" << birthYear << "-" Β« deathYear << ")" << endl; else cout << ", born" << birthYear << endl; 37 } 32 33 34 35 36 Current file: Artwork. h - 1 #ifndef ARTWORKH #define ARTWORKH 4 #include "Artist. h" #include 6 using namespace std; class Artwork public: Artwork(); Artwork(string title, int yearCreated, Artist artist); string GetTitle(); int GetYearCreated(); void PrintInfo(); private: // TODO: Declare private data members - title, yearCreated // TODO: Declare private data member artist of type Artist string title; int yearCreated; Artist artist; 27 }; 28 29 #endif Current file: Artwork. cpp 1 #include "Artist. h" 3 // TODO: Define default constructor 4 // TODO: Define second constructor to initialize private fields (title, yearCreated, artist) 7 // TODO: Define get functions: GetTitle(), GetYearCreated() 9 // TODO: Define PrintInfo() function #include 11 #include 12 using namespace std; 13 Artwork:: Artwork 15 { title = "None"; yearCreated = 0; 14 Artwork::Artwork(string title, int yearCreated, Artist artist) 20 this->title = title; this->yearCreated = yearCreated; this->artist = artist; string Artwork::GetTitle) return title; 28 } int Artwork::GetYearCreated() 30 { 31 return yearCreated; 32 } void Artwork::printInfo() 34 { artist. printInfo(); 36 cout << "Title: " << title << ", " Β«< yearCreated << endl; 37 } 35

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 08:50
Write a program that will compute the volume of ice cream served in a cone. as you can see in the diagram below, the ice cream is served as a hemisphere of frozen deliciousness on top of a cone, which is also packed with frozen deliciousness. thus, the total volume of ice cream sold is the volume of the hemisphere plus the volume of the cone. the example shows an ice cream cone in which the hemisphere and cone have a radius of 10 inches and the cone has a height of 15 inches. your program must instead prompt for these two values, which are taken from the keyboard as integers: β€’ the hemisphere/cone radius in inches, and
Answers: 3
question
Computers and Technology, 24.06.2019 19:00
In python a floating-point number must be written using scientific notation?
Answers: 1
question
Computers and Technology, 25.06.2019 07:10
When you β€œlisten” to evaluate an online message, which question should you ask?
Answers: 1
question
Computers and Technology, 25.06.2019 17:00
Match each word to its correct meaning. 1. quick launch an area that displays icons representing open applications 2. shortcut an icon used to represent an application, a file, or a folder 3. start menu an area on the taskbar where icons representing programs that are always running are displayed 4. system tray a list of programs that can be opened by clicking on their names or icons 5. taskbar an area on the taskbar from which frequently used programs can be opened pls. will get brainlist
Answers: 1
You know the right answer?
Given main(), complete the Artist class (in files Artist. h and Artist. cpp) with constructors to in...
Questions
question
Mathematics, 01.04.2021 04:00
question
Mathematics, 01.04.2021 04:00
question
Mathematics, 01.04.2021 04:00
question
Computers and Technology, 01.04.2021 04:00
question
Mathematics, 01.04.2021 04:00
question
Mathematics, 01.04.2021 04:00
Questions on the website: 13722367