Design a class art that contain the details of artist, country and class info contain the details of year and art-type (fancy, historic or modern). Use a function for displaying the details by reading data from class art and info. The function used for displaying is not a member of any class
Here is the program:
class Art
{
public:
string year;
string arttype[3]{ "Fancy", "Historic" , "Modern" };
private:
};
void DisplayArt(string y, int at)
{
Art art;
art.year = y;
art.arttype[at];
cout << "Year - " << art.year << endl;
cout << "Art-type: " << art.arttype[at] << endl;
}
int main()
{
int i;
string str;
cout << "Enter year art: " << endl;
cin >> str;
cout << "Enter art-type: " << endl;
cout << "0) Fancy" << endl;
cout << "1) Historic" << endl;
cout << "2) Modern" << endl;
cin >> i;
DisplayArt(str,i);
}
Comments
Leave a comment