Answer to Question #309280 in C++ for dark soul

Question #309280

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

1
Expert's answer
2022-03-10T11:16:23-0500

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);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog