SlideShare a Scribd company logo
In C++ Plz
LAB: Artwork label (classes/constructors)
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 "unknown" and the years of birth and death to -1.
PrintInfo() displays "Artist:", then a space, then the artist's name, then another space, then the
birth and death dates in one of three formats:
(XXXX to YYYY) if both the birth and death years are nonnegative
(XXXX to present) if the birth year is nonnegative and the death year is negative
(unknown) 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 default
constructor should initialize the title to "unknown", the year created to -1. PrintInfo() displays an
artist's information by calling the PrintInfo() function in the Artist class, followed by the artwork's
title and the year created. Declare a private field of type Artist in the Artwork class.
Ex: If the input is:
1881 and 1973 being the birth and death years respectively, with 1921 being the year the work
was created, the output is:
Ex: If the input is:
the output is:
Ex: If the input is:
the output is:
main.cpp (Not able to be edited):
#include "Artist.h"
#include "Artwork.h"
#include <iostream>
#include <string>
using namespace std;
int main() {
string userTitle, userArtistName;
int yearCreated, userBirthYear, userDeathYear;
getline(cin, userArtistName);
getline(cin, userTitle);
cin >> userBirthYear;
cin >> userDeathYear;
cin >> yearCreated;
Artist userArtist = Artist(userArtistName, userBirthYear, userDeathYear);
Artwork newArtwork = Artwork(userTitle, yearCreated, userArtist);
newArtwork.PrintInfo();
}
Artist.h (Able to be edited):
#ifndef ARTISTH
#define ARTISTH
#include <string>
using namespace std;
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
};
#endif
Artist.cpp (Able to be edited):
#include "Artist.h"
#include <iostream>
#include <string>
using namespace std;
// TODO: Define default constructor
// TODO: Define second constructor to initialize
// private fields (artistName, birthYear, deathYear)
// TODO: Define get functions: GetName(), GetBirthYear(), GetDeathYear()
// TODO: Define PrintInfo() function
// If deathYear is entered as -1, only print birthYear
Artwork.h (Able to be edited):
#ifndef ARTWORKH
#define ARTWORKH
#include "Artist.h"
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
};
#endif
Artwork.cpp (Able to be edited):
#include "Artwork.h"
#include <iostream>
// TODO: Define default constructor
// TODO: Define second constructor to initialize
// private fields (title, yearCreated, artist)
// TODO: Define get functions: GetTitle(), GetYearCreated()
// TODO: Define PrintInfo() function
// Call the PrintInfo() function in the Artist class to print an artist's information

More Related Content

Similar to In C++ Plz LAB Artwork label classesconstructors Given m.pdf

Presentation
PresentationPresentation
Presentation
manogallery
 
Managing console input
Managing console inputManaging console input
Managing console input
rajshreemuthiah
 
PFB cpp code for the given problem#include iostream #include .pdf
PFB cpp code for the given problem#include iostream #include .pdfPFB cpp code for the given problem#include iostream #include .pdf
PFB cpp code for the given problem#include iostream #include .pdf
mailadmin1
 
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdfIn C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
shreeaadithyaacellso
 
1817 LAB Playlist output linked list Given main compl.pdf
1817 LAB Playlist output linked list Given main compl.pdf1817 LAB Playlist output linked list Given main compl.pdf
1817 LAB Playlist output linked list Given main compl.pdf
spshotham
 
introductiontoc-140704113737-phpapp01.pdf
introductiontoc-140704113737-phpapp01.pdfintroductiontoc-140704113737-phpapp01.pdf
introductiontoc-140704113737-phpapp01.pdf
SameerKhanPathan7
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
Himanshu Kaushik
 
Can someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdfCan someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdf
akshpatil4
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
stopgolook
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
info114
 
Console Io Operations
Console Io OperationsConsole Io Operations
Console Io Operations
archikabhatia
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
aathiauto
 
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdfIn C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
shreeaadithyaacellso
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
aathmaproducts
 
OOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptxOOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptx
SirRafiLectures
 
Program 02 Based on the previous problem you should impleme.pdf
Program 02 Based on the previous problem you should impleme.pdfProgram 02 Based on the previous problem you should impleme.pdf
Program 02 Based on the previous problem you should impleme.pdf
addtechglobalmarketi
 
Python crush course
Python crush coursePython crush course
Python crush course
Mohammed El Rafie Tarabay
 

Similar to In C++ Plz LAB Artwork label classesconstructors Given m.pdf (18)

Presentation
PresentationPresentation
Presentation
 
Managing console input
Managing console inputManaging console input
Managing console input
 
PFB cpp code for the given problem#include iostream #include .pdf
PFB cpp code for the given problem#include iostream #include .pdfPFB cpp code for the given problem#include iostream #include .pdf
PFB cpp code for the given problem#include iostream #include .pdf
 
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdfIn C++ Plz  LAB- Playlist (output linked list) Given main()- complete.pdf
In C++ Plz LAB- Playlist (output linked list) Given main()- complete.pdf
 
1817 LAB Playlist output linked list Given main compl.pdf
1817 LAB Playlist output linked list Given main compl.pdf1817 LAB Playlist output linked list Given main compl.pdf
1817 LAB Playlist output linked list Given main compl.pdf
 
introductiontoc-140704113737-phpapp01.pdf
introductiontoc-140704113737-phpapp01.pdfintroductiontoc-140704113737-phpapp01.pdf
introductiontoc-140704113737-phpapp01.pdf
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Can someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdfCan someone please help me implement the addSong function .pdf
Can someone please help me implement the addSong function .pdf
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
 
Console Io Operations
Console Io OperationsConsole Io Operations
Console Io Operations
 
Need to be done in C++ Please Sorted number list implementation wit.pdf
Need to be done in C++  Please   Sorted number list implementation wit.pdfNeed to be done in C++  Please   Sorted number list implementation wit.pdf
Need to be done in C++ Please Sorted number list implementation wit.pdf
 
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdfIn C++ Plz and In What Order Do I Put It In-  LAB- Playlist (output li.pdf
In C++ Plz and In What Order Do I Put It In- LAB- Playlist (output li.pdf
 
Need to be done in C Please Sorted number list implementation with.pdf
Need to be done in C  Please   Sorted number list implementation with.pdfNeed to be done in C  Please   Sorted number list implementation with.pdf
Need to be done in C Please Sorted number list implementation with.pdf
 
Files
FilesFiles
Files
 
OOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptxOOP-Lecture-05 (Constructor_Destructor).pptx
OOP-Lecture-05 (Constructor_Destructor).pptx
 
Program 02 Based on the previous problem you should impleme.pdf
Program 02 Based on the previous problem you should impleme.pdfProgram 02 Based on the previous problem you should impleme.pdf
Program 02 Based on the previous problem you should impleme.pdf
 
Python crush course
Python crush coursePython crush course
Python crush course
 

More from aarthitimesgd

Por qu es necesaria la alfabetizacin intercultural en el .pdf
Por qu es necesaria la alfabetizacin intercultural en el .pdfPor qu es necesaria la alfabetizacin intercultural en el .pdf
Por qu es necesaria la alfabetizacin intercultural en el .pdf
aarthitimesgd
 
Minerals Table This is pretty straightforward Fill in the b.pdf
Minerals Table This is pretty straightforward Fill in the b.pdfMinerals Table This is pretty straightforward Fill in the b.pdf
Minerals Table This is pretty straightforward Fill in the b.pdf
aarthitimesgd
 
In the past Netflixs superior library of titles allowed th.pdf
In the past Netflixs superior library of titles allowed th.pdfIn the past Netflixs superior library of titles allowed th.pdf
In the past Netflixs superior library of titles allowed th.pdf
aarthitimesgd
 
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdf
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdfLea atentamente el siguiente pasaje antes de elegir sus resp.pdf
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdf
aarthitimesgd
 
Jada levant la vista del monitor de su computadora para obs.pdf
Jada levant la vista del monitor de su computadora para obs.pdfJada levant la vista del monitor de su computadora para obs.pdf
Jada levant la vista del monitor de su computadora para obs.pdf
aarthitimesgd
 
Heres a menu Appetizer Roll V Spring egg V Sou.pdf
Heres a menu Appetizer   Roll V   Spring egg V   Sou.pdfHeres a menu Appetizer   Roll V   Spring egg V   Sou.pdf
Heres a menu Appetizer Roll V Spring egg V Sou.pdf
aarthitimesgd
 
I am interesting in finding the volume wetness of a 809 m2 .pdf
I am interesting in finding the volume wetness of a 809 m2 .pdfI am interesting in finding the volume wetness of a 809 m2 .pdf
I am interesting in finding the volume wetness of a 809 m2 .pdf
aarthitimesgd
 
George se registra previamente para los nuevos lanzamientos .pdf
George se registra previamente para los nuevos lanzamientos .pdfGeorge se registra previamente para los nuevos lanzamientos .pdf
George se registra previamente para los nuevos lanzamientos .pdf
aarthitimesgd
 
In 2022 Mason is working with his attorney and his CFP pro.pdf
In 2022 Mason is working with his attorney and his CFP pro.pdfIn 2022 Mason is working with his attorney and his CFP pro.pdf
In 2022 Mason is working with his attorney and his CFP pro.pdf
aarthitimesgd
 
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdfHola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
aarthitimesgd
 
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdfExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
aarthitimesgd
 
Estudio de caso empresas conjuntas de General Electric His.pdf
Estudio de caso empresas conjuntas de General Electric  His.pdfEstudio de caso empresas conjuntas de General Electric  His.pdf
Estudio de caso empresas conjuntas de General Electric His.pdf
aarthitimesgd
 
Hay 19 miembros en una junta directiva Si deben formar un s.pdf
Hay 19 miembros en una junta directiva Si deben formar un s.pdfHay 19 miembros en una junta directiva Si deben formar un s.pdf
Hay 19 miembros en una junta directiva Si deben formar un s.pdf
aarthitimesgd
 
Cul de los siguientes NO se considera un cambio en la pol.pdf
Cul de los siguientes NO se considera un cambio en la pol.pdfCul de los siguientes NO se considera un cambio en la pol.pdf
Cul de los siguientes NO se considera un cambio en la pol.pdf
aarthitimesgd
 
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdfEn 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
aarthitimesgd
 
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdfEn su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
aarthitimesgd
 
Course HCA621Nursing Home Administration Case Study The a.pdf
Course HCA621Nursing Home Administration Case Study The a.pdfCourse HCA621Nursing Home Administration Case Study The a.pdf
Course HCA621Nursing Home Administration Case Study The a.pdf
aarthitimesgd
 
Discuss the following topic in the forum with your classmate.pdf
Discuss the following topic in the forum with your classmate.pdfDiscuss the following topic in the forum with your classmate.pdf
Discuss the following topic in the forum with your classmate.pdf
aarthitimesgd
 
2 Kasm 2010da Griffey Companynin maliyeti 3000 olan mal.pdf
2 Kasm 2010da Griffey Companynin maliyeti 3000  olan mal.pdf2 Kasm 2010da Griffey Companynin maliyeti 3000  olan mal.pdf
2 Kasm 2010da Griffey Companynin maliyeti 3000 olan mal.pdf
aarthitimesgd
 
A trader buys a European call option and sells a European pu.pdf
A trader buys a European call option and sells a European pu.pdfA trader buys a European call option and sells a European pu.pdf
A trader buys a European call option and sells a European pu.pdf
aarthitimesgd
 

More from aarthitimesgd (20)

Por qu es necesaria la alfabetizacin intercultural en el .pdf
Por qu es necesaria la alfabetizacin intercultural en el .pdfPor qu es necesaria la alfabetizacin intercultural en el .pdf
Por qu es necesaria la alfabetizacin intercultural en el .pdf
 
Minerals Table This is pretty straightforward Fill in the b.pdf
Minerals Table This is pretty straightforward Fill in the b.pdfMinerals Table This is pretty straightforward Fill in the b.pdf
Minerals Table This is pretty straightforward Fill in the b.pdf
 
In the past Netflixs superior library of titles allowed th.pdf
In the past Netflixs superior library of titles allowed th.pdfIn the past Netflixs superior library of titles allowed th.pdf
In the past Netflixs superior library of titles allowed th.pdf
 
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdf
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdfLea atentamente el siguiente pasaje antes de elegir sus resp.pdf
Lea atentamente el siguiente pasaje antes de elegir sus resp.pdf
 
Jada levant la vista del monitor de su computadora para obs.pdf
Jada levant la vista del monitor de su computadora para obs.pdfJada levant la vista del monitor de su computadora para obs.pdf
Jada levant la vista del monitor de su computadora para obs.pdf
 
Heres a menu Appetizer Roll V Spring egg V Sou.pdf
Heres a menu Appetizer   Roll V   Spring egg V   Sou.pdfHeres a menu Appetizer   Roll V   Spring egg V   Sou.pdf
Heres a menu Appetizer Roll V Spring egg V Sou.pdf
 
I am interesting in finding the volume wetness of a 809 m2 .pdf
I am interesting in finding the volume wetness of a 809 m2 .pdfI am interesting in finding the volume wetness of a 809 m2 .pdf
I am interesting in finding the volume wetness of a 809 m2 .pdf
 
George se registra previamente para los nuevos lanzamientos .pdf
George se registra previamente para los nuevos lanzamientos .pdfGeorge se registra previamente para los nuevos lanzamientos .pdf
George se registra previamente para los nuevos lanzamientos .pdf
 
In 2022 Mason is working with his attorney and his CFP pro.pdf
In 2022 Mason is working with his attorney and his CFP pro.pdfIn 2022 Mason is working with his attorney and his CFP pro.pdf
In 2022 Mason is working with his attorney and his CFP pro.pdf
 
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdfHola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
Hola comunidad de Chegg Necesito ayuda con esta tarea par.pdf
 
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdfExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
ExxonMobil needs to analyze its Cash Flow from 2020 through .pdf
 
Estudio de caso empresas conjuntas de General Electric His.pdf
Estudio de caso empresas conjuntas de General Electric  His.pdfEstudio de caso empresas conjuntas de General Electric  His.pdf
Estudio de caso empresas conjuntas de General Electric His.pdf
 
Hay 19 miembros en una junta directiva Si deben formar un s.pdf
Hay 19 miembros en una junta directiva Si deben formar un s.pdfHay 19 miembros en una junta directiva Si deben formar un s.pdf
Hay 19 miembros en una junta directiva Si deben formar un s.pdf
 
Cul de los siguientes NO se considera un cambio en la pol.pdf
Cul de los siguientes NO se considera un cambio en la pol.pdfCul de los siguientes NO se considera un cambio en la pol.pdf
Cul de los siguientes NO se considera un cambio en la pol.pdf
 
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdfEn 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
En 2005 Irlanda comenz a cobrar impuestos a los residente.pdf
 
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdfEn su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
En su captulo sobre Nadouek Labelle afirma que la sociedad.pdf
 
Course HCA621Nursing Home Administration Case Study The a.pdf
Course HCA621Nursing Home Administration Case Study The a.pdfCourse HCA621Nursing Home Administration Case Study The a.pdf
Course HCA621Nursing Home Administration Case Study The a.pdf
 
Discuss the following topic in the forum with your classmate.pdf
Discuss the following topic in the forum with your classmate.pdfDiscuss the following topic in the forum with your classmate.pdf
Discuss the following topic in the forum with your classmate.pdf
 
2 Kasm 2010da Griffey Companynin maliyeti 3000 olan mal.pdf
2 Kasm 2010da Griffey Companynin maliyeti 3000  olan mal.pdf2 Kasm 2010da Griffey Companynin maliyeti 3000  olan mal.pdf
2 Kasm 2010da Griffey Companynin maliyeti 3000 olan mal.pdf
 
A trader buys a European call option and sells a European pu.pdf
A trader buys a European call option and sells a European pu.pdfA trader buys a European call option and sells a European pu.pdf
A trader buys a European call option and sells a European pu.pdf
 

Recently uploaded

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 

Recently uploaded (20)

A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 

In C++ Plz LAB Artwork label classesconstructors Given m.pdf

  • 1. In C++ Plz LAB: Artwork label (classes/constructors) 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 "unknown" and the years of birth and death to -1. PrintInfo() displays "Artist:", then a space, then the artist's name, then another space, then the birth and death dates in one of three formats: (XXXX to YYYY) if both the birth and death years are nonnegative (XXXX to present) if the birth year is nonnegative and the death year is negative (unknown) 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 default constructor should initialize the title to "unknown", the year created to -1. PrintInfo() displays an artist's information by calling the PrintInfo() function in the Artist class, followed by the artwork's title and the year created. Declare a private field of type Artist in the Artwork class. Ex: If the input is: 1881 and 1973 being the birth and death years respectively, with 1921 being the year the work was created, the output is: Ex: If the input is: the output is: Ex: If the input is: the output is: main.cpp (Not able to be edited): #include "Artist.h" #include "Artwork.h" #include <iostream> #include <string> using namespace std; int main() { string userTitle, userArtistName; int yearCreated, userBirthYear, userDeathYear; getline(cin, userArtistName); getline(cin, userTitle); cin >> userBirthYear; cin >> userDeathYear; cin >> yearCreated; Artist userArtist = Artist(userArtistName, userBirthYear, userDeathYear); Artwork newArtwork = Artwork(userTitle, yearCreated, userArtist); newArtwork.PrintInfo(); } Artist.h (Able to be edited): #ifndef ARTISTH
  • 2. #define ARTISTH #include <string> using namespace std; 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 }; #endif Artist.cpp (Able to be edited): #include "Artist.h" #include <iostream> #include <string> using namespace std; // TODO: Define default constructor // TODO: Define second constructor to initialize // private fields (artistName, birthYear, deathYear) // TODO: Define get functions: GetName(), GetBirthYear(), GetDeathYear() // TODO: Define PrintInfo() function // If deathYear is entered as -1, only print birthYear Artwork.h (Able to be edited): #ifndef ARTWORKH #define ARTWORKH #include "Artist.h" 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
  • 3. }; #endif Artwork.cpp (Able to be edited): #include "Artwork.h" #include <iostream> // TODO: Define default constructor // TODO: Define second constructor to initialize // private fields (title, yearCreated, artist) // TODO: Define get functions: GetTitle(), GetYearCreated() // TODO: Define PrintInfo() function // Call the PrintInfo() function in the Artist class to print an artist's information