Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could you help me solve the qusetion? USing C++. Thanks! Create a class (named:

ID: 3702323 • Letter: C

Question

Could you help me solve the qusetion? USing C++. Thanks!

Create a class (named: Drawing) with a default constructor, a constructor with parameters for each data member, and the following private data members: Question 8 year, which is an integer value (initialize to 1800 in the default constructor). Not answered Mark 0.00 out of 10.00 title, which is a string (initialize to empty string in the default constructor). artist, which is a string (initialize to empty string in the default constructor). Your second constructor should take all data member variables as input in the order they are specified above. You only need to write the class definition and any code that is required for that class. Place all code within the class definition. Answer: (penalty regime: 0 %) Flag question

Explanation / Answer

#include<iostream>

using namespace std;

class Drawing

{

    int year;

    string title;

    string artist;

   

    public:

       

        // default constructor

        Drawing()

        {

            this->year = 1800;

            this->title = "";

          this->artist = "";

        }

       

        // constructor

        Drawing(int year, string title, string artist)

        {

            this->year = year;

            this->title = title;

            this->artist = artist;

        }

       

      // getter methods

        int getYear()

        {

            return this->year;

        }

       

        string getTitle()

        {

            return this->title;

        }

       

        string getArtist()

        {

            return this->artist;

        }

};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote