Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A gallery needs to track its paintings and photographs. It keeps at most 500 art works on its walls. Each one is described by the

A gallery needs to track its paintings and photographs. It keeps at most 500 art works on its walls. Each one is described by the following information: Art (struct) Artist(string) Title(string) Medium (oil, watercolor, pastel, acrylic, photo) Size (struct) Height (int) Width (int) Room where it is hung (main, green, blue, north, south, entry, balcony) Price (int) Create a struct or class for a piece of art called ArtWork. Use enumeration types (not strings) for the Medium and Room fields. Note that while there may be up to 500 pieces of art, there may not be that many actually stored at all times. You can assume the user will enter the name or title in the same case as the file fields. Your program should read the gallerys inventory from a file called art.dat and store it in an array of structs (or objects if you know how to create them). For the sake of class consistency, the file should have fields separated by blank(s) and should assume Artist, Title have no embedded blanks. In addition, the input file uses abbreviations for: Medium (a=acrylic, o=oil, p=pastel, f=photo, w=watercolor) Room (b=balcony, u=blue, e=entry, g=green, m=main, n=north, s=south) You can assume all fields are present for each entry and they are valid. Do not change either the file format or the file name! Entries in the art.dat file will be one per line and will have the following format as an example: TedSmith RedRock o 10 12 n 12500 Allow the user to search for a painting by the name of the artist or the name of the painting. Your program should search through the array to determine if the work/artist exists. If the selected work/artist exists, all works by that name or artist should be listed with each field properly formatted and labeled. If none exist, output an appropriate error message. The user should be able to continue looking up works until they select an exit option. Just help me as much as you can. Thanks!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago