Question

In: Computer Science

Westward Art Gallery sells artwork that includes paintings, sculptures, and pottery. The gallery tracks the id,...

Westward Art Gallery sells artwork that includes paintings, sculptures, and pottery. The gallery tracks the id, title, and artist for each piece of art.

For paintings, the gallery records the media used to create the work. Paintings may be oil, watercolor, pastel, or mixed-media. The gallery also records the painting’s dimensions: length and width. Create an enum for the media. The user should be able to provide an int that will be converted.

For sculptures, the gallery records the material used to create the work. Material may be wood, metal, or plastic. Create an enum for the material. The user should be able to provide an int that will be converted.

For pottery, the gallery records the type of pottery: earthenware, stoneware, porcelain, or ceramic. The gallery also records the dimensions: length, width, and height. Create an enum for the pottery type. The user should be able to provide an int that will be converted.

Implement a print() function in every class that displays the data in the object.

Create a class called Dimensions to store the dimensions of the artworks. This class should be able to store the length, width, and height. Implement a function toString that returns the dimensions as a string one of the following formats:

//all 3 values set 5 X 4 X 2 
//no height set 5 X 4

Create an inheritance-based collection of classes to represent these different types of art. Remember to include error checking.

Sample Output:

Art: Artwork ID: 234

Title: Dahli at Work

Artist: Unknown

Painting:

Artwork ID: 123

Title: Man with Beer

Artist: Dietrick Buttler

Media: Pastel

Dimensions: 3 X 6

Pottery:

Artwork ID: 242

Title: Jade Head

Artist: Unknown

Type: Stoneware Dimensions: 2 X 3 X 1

Sculptures: Artwork ID: 24214

Title: Everlast Artist: Bernini

Material: Wood

You are given one Cpp(Artwork.cpp) file that must remain unchanged. Needed is a Art,Pottery,paintings,sculptures .cpp and .h files

Included code:

/**
* Do no edit this file
**/

#include "Paintings.h"
#include "Pottery.h"
#include "Sculptures.h"

#include <iostream>

using namespace std;

int main()
{

Art a(234, "Dahli at Work", "Unknown");
Paintings painting (123, "Man with Beer", "Dietrick Buttler", 2, 3, 6);
Pottery vase(242, "Jade Head", "Unknown", 1, 2, 3, 1);
Sculptures s (24214, "Everlast", "Bernini", 0);

  
cout << "Art: " << endl;
a.print();
  
  
cout << endl << endl << "Painting: " << endl;
painting.print();

cout << endl << endl << "Pottery: " << endl;
vase.print();

cout << endl << endl << "Sculptures: " << endl;
s.print();

return 0;
}

Hope the instructions are clear thank you

Solutions

Expert Solution

Art.h

#pragma once

#include <string>

#include <iostream>

using namespace std;

class Art

{

public:

int m_id;

string m_title;

string m_artist;

public:

Art(int id, string title, string artist)

{

m_id = id;

m_title = title;

m_artist = artist;

}

void print()

{

cout << "Artwork ID : " << m_id << endl;

cout << "Title : " << m_title << endl;

cout << "Artist : " << m_artist << endl;

}

~Art()

{

}

};

Artwork.cpp

#include "Paintings.h"

#include "Pottery.h"

#include "Sculptures.h"

#include <iostream>

#include "Art.h"

using namespace std;

int main()

{

Art a(234, "Dahli at Work", "Unknown");

cout << "Art: " << endl;

a.print();

Paintings painting(123, "Man with Beer", "Dietrick Buttler", 2, 3, 6);

Pottery vase(242, "Jade Head", "Unknown", 1, 2, 3, 1);

Sculptures s(24214, "Everlast", "Bernini", 0);

cout << endl << endl << "Painting: " << endl;

painting.print();

cout << endl << endl << "Pottery: " << endl;

vase.print();

cout << endl << endl << "Sculptures: " << endl;

s.print();

return 0;

}

Paintings.h

#pragma once

enum media{ oil, watercolor, pastel, mixed_media };

#include "Art.h"

#include "Dimensions.h"

#include <map>

#include <iostream>

using namespace std;

class Paintings : public Art,Dimensions

{

public:

map<int, string>m;

int m_media_type;

void init()

{

media med = oil;

m.insert({ med,"oil" });

med = watercolor;

m.insert({ med,"watercolor" });

med = pastel;

m.insert({ med,"pastel" });

med = mixed_media;

m.insert({ med,"mixed_media" });

}

Paintings(int id, string title, string artist,int media_type, int height, int width , int length ):Art(id,title,artist),Dimensions(height,width,length)

{

m_media_type = media_type;

init();

}

Paintings(int id, string title, string artist, int media_type, int width , int length) :Art(id, title, artist), Dimensions(0, width, length)

{

m_media_type = media_type;

init();

}

~Paintings()

{

}

void print()

{

Art::print();

cout << "Media: " << m[m_media_type] << endl;

cout << "D

Dimensions: "<< Dimensions::toString();

}

Pottery.h

#pragma once

enum pottery_type{ earthenware, stoneware, porcelain, ceramic };

#include <iostream>

using namespace std;

#include <string>

#include "Dimensions.h"

#include "Art.h"

#include <map>

class Pottery: public Art,Dimensions

{

public:

int m_pot_type;

map<int, string> m;

void init()

{

pottery_type p = earthenware;

m.insert({ p,"earthenware" });

p = stoneware;

m.insert({ p,"stoneware" });

p = porcelain;

m.insert({ p,"porcelain" });

p = ceramic;

m.insert({ p,"ceramic" });

}

Pottery(int id, string title, string artist, int pottery_type,int height, int width, int length) :Art(id, title, artist), Dimensions(height, width, length)

{

m_pot_type = pottery_type;

init();

}

Pottery(int id, string title, string artist, int pottery_type, int width, int length) :Art(id, title, artist), Dimensions(0, width, length)

{

m_pot_type = pottery_type;

init();

}

~Pottery()

{

}

void print()

{

Art::print();

cout << "Type: " << m[m_pot_type] << endl;

cout << "Dimensions: " << Dimensions::toString();

}

};

};

Sculpture.h

#pragma once

enum Material { wood, metal, plastic};

#include "Art.h"

#include <map>

class Sculptures: public Art

{

public:

int m_Material_type;

map<int, string>m;

void init()

{

Material med = wood;

m.insert({ med,"wood" });

med = metal;

m.insert({ med,"metal" });

med = plastic;

m.insert({ med,"plastic" });

}

Sculptures(int id, string title, string artist, int MaterialType) :Art(id, title, artist)

{

m_Material_type = MaterialType;

init();

}

~Sculptures()

{

}

void print()

{

Art::print();

cout << "Material: " << m[m_Material_type]<<endl;

}

};

Dimensions.cpp

#include "Dimensions.h"

Dimensions::Dimensions(int height,int width,int length)

{

m_height = height;

m_width = width;

m_length = length;

}

Dimensions::~Dimensions()

{

}

string Dimensions::toString()

{

string dimension = "";

if (m_height)

{

dimension += to_string(m_height);

}

if (m_width)

{

dimension += to_string(m_width);

}

if (m_length)

{

dimension += to_string(m_length);

}

return dimension;

}

Dimensions.h

#pragma once

#include <string>

using namespace std;

class Dimensions

{

private:

int m_height, m_width, m_length;

public:

Dimensions(int height, int width, int length);

~Dimensions();

string toString();

};


Related Solutions

Consider an offer to supply 5 paintings per year to an art gallery in Rome for...
Consider an offer to supply 5 paintings per year to an art gallery in Rome for the next five years. The contract is exclusive, meaning that, if you accept it, you cannot sell paintings to other galleries or other clients. The contract also offers a signing bonus of $100,000. If you were to refuse the contract, you estimate that you would be selling 7 paintings a year, at a price of $45,000 each, for the next 5 years. Assume that...
Business Law (20 marks) Thomas Crown sells a priceless Monet painting to the Prado Art Gallery...
Business Law Thomas Crown sells a priceless Monet painting to the Prado Art Gallery in Madrid. The gallery pays him a fortune for this masterpiece. A few months later, Monet’s great granddaughter produces a document proving without a doubt that she is the rightful owner of the artwork, and that it was stolen from her. She claims the painting back from the Prado Gallery. 1.1. Advise Prado Gallery on the relevant warranty that may assist them on a claim against...
Credit Card Sales Valderi’s Gallery sells quality art work, with prices for individual pieces ranging from...
Credit Card Sales Valderi’s Gallery sells quality art work, with prices for individual pieces ranging from $400 to $25,000. Sales are infrequent, typically only three to five pieces per week. The following transactions occurred during the first week of June 2015. Perpetual inventory is used. On June 1, sold an $800 framed print ($500 cost) to Kerwin Antiques on account, with 2/10, n/30 credit terms. On June 2, sold three framed etchings totaling $2,400 ($1,500 cost) to Maria Alvado, who...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT