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

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

ID: 3827923 • Letter: A

Question

A gallery need to keep track of its paintings and photographs. It keeps at most 120 art works on its walls. Each one is described by the following information: enum Medium {oil, watercolor, pastel, acrylic, print, color photo, black and white photo}; Room where it is hung enum Room {main, green, blue, north, south, entry, balcony}; artist(string) title (string) medium(Medium) Size (struct) height(int) width(int) room (Room) price(float) 1. Write a a declaration for a struct that represents a piece of art, call it ArtWork 2. Write an additional declaration of a named array that holds the list of all the art works in the gallery. Call it currentList 3. Lastly, declare an int variable numPieces. The numPieces variable contains the number of pieces represented in the array.

Explanation / Answer

#include<iostream>
#include<stdio.h>
using namespace std;

enum Medium
{
oil,watercolor,pastel,acrcylic,print,colorphoto,black_white_photo
};
enum Room
{
main1,green,blue,north,south,entry,balcony  
};

struct ArtWork
{
char artist[30];
char title[30];
Medium medium;  
Room room;
int width;
int height;  
float price;  
};

int main()
{
ArtWork currentList[120];
int numpieces,i;
cout<<"enter no of pieces";  
cin>>numpieces;
scanf("%d",currentList[1].medium);
for(i=0;i<numpieces;i++)
{
   cin>>currentList[i].artist;
   cin>>currentList[i].title;
   cin>>currentList[i].price;
   cin>>currentList[i].width;
   cin>>currentList[i].height;
   scanf("%d",currentList[i].medium);
   scanf("%d",currentList[i].room);
  
  
  
}
}

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