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

A gallery needs to keep track of its paintings and photographs. It keeps at most

ID: 3620960 • Letter: A

Question

A gallery needs to keep track of its paintings and photographs. It keeps at most 120 artworks on its walls. Each one is described by the following information:
1.) Artist(string)
2.) Title (string)
3.) Medium (oil, watercolor, pastel, acrylic, print, color photo, black-and-white photo) (enum)
4.) Size(struct)
a.) Height(int)
b.) Width(int)
5.) Room(main,green,blue,north,south,entry,balcony)
6.) Price(float)

Write a declaration for a struct that represents a piece of art. Declare struct and enumeration types as needed to make up the fields of the Artwork type. Write an additional declaration of a named array type that holds the list of all the artworks in the gallery. Lastly declare an array of this type called currentList and an int variable called numPieces. the numPieces variable contains the number of pieces represented in the array.

also write expressions to retrieve the following values from the array
a.) The 37th work of art.
b.) The title of the 12th work of art.
c.) The width of the 85th work of art.
d.) The room for the 120th work of art.
e.) The first letter of the artist name for the 78th work of art.

Explanation / Answer

"Write a declaration for a struct that represents a piece of art." It could look something like this struct ART { // Declare ART struct type string artist; // Declare member types string title; . . . etc } art_work; // Define object of type ART int main() { ART NewArt; NewArt.artist = "Paul Bryant"; // assign values to members NewArt.title = "Roll Tide"; .... and so on. } This would be a basic struct for setting it all up. "Write an additional declaration of a named array type that holds the list of all the artworks in the gallery." In your main() I would just declare you an array of 120 elements since thats the most it says you'll need. struct ART { // Declare ART struct type string artist; // Declare member types string title; . . . etc } art_work; // Define object of type ART int main() { ART NewArt; NewArt.artist = "Paul Bryant"; // assign values to members NewArt.title = "Roll Tide"; .... and so on. int artData[120]; //You could do int artData[120][5] if you wanted to store all art info using a multidimensional array. You may need to change the int to ART depending on what data type you plan to store in it. } Don't forget to fill the array with each ART type created by the user. And the part about currentList and numPieces is a basic declaration within your code. Make sure you have all that working before you attempt to move on to the a,b,c, etc at the bottom. But "a" might look something like this: int artLookup(int piece) { //piece being the number the user is looking for cout
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