Question: In this lab, you will demonstrate your understanding of basic class construction and object creation. There is 1 program to be completed. All files require

In this lab, you will demonstrate your understanding of basic class construction and object creation. There is 1 program to be completed. All files require Javadoc documentation comments at the top to include a description of the program, the @file tag, and an @author tag with your name. The class specification file developed requires complete Javadoc documentation comments for all public members. Note: Your output does not need to match the sample shown.
You will have one function for all of the behaviors listed below in the functions list in the "driver".
Program description
Define a class named ArtWork which will used to represent a work of art. The class should define attributes for the name of the artwork, the artist, the year that the work of art was created, and the type of work it is (painting, sculpture, etc).
The following methods are needed.
A default class constructor. No actions are needed for this constructor.
A class constructor that accepts a single string parameter containing the class attribute values separated by a comma. The constructor must parse the parameter string into individual data items in order to set the class attributes.
Accessor methods for the class attributes.
A utility method to display the class attribute values using cout in a readable format.
Mutator methods for all attributes.
A "driver" is required. The driver will have the following functions:
readFile Loads the vector with ArtWork objects. The data for each piece of art is read from the given data file which is in CSV format (comma delimited -1 line per record with fields separated by a comma.) The function should read each line from the file, pass the line read to the ArtWork class constructor and store the resulting object in the parameter vector.
displayAll - Displays a list of the ArtWork objects stored in the vector.
getRange Determines the latest and earliest years of the pieces. These values are returned to the caller via reference parameters.
getOldest - Returns the oldest piece of art - the entire object is returned here
displayByYear - requests of the user a year range, displays all artwork (by title only) created in that range
menu()- returns the menu option for the preceding options (display all, get range, get oldest)(loop around the menu - execute until exit is chosen)
Hints: Start small and build on working code. Implement ONE function at a time! Thoroughly test each function. Once you are satisfied with the result, move on to the next function.
Use this data file for the artwork: artwork.csv Download artwork.csv
In the overloaded constructor of the ArtWork class, consider using a stringstream object. The third parameter of the getline function provides an option to specify a delimiter, allowing the getline function to extract one field at a time from the stringstream object.
getline(iss,resultString,','); // iss is a istringstream object
Only strings are read from a string stream. For integer and floating point values, the data must be converted after reading.
Alternatively, the parameter string can be parsed using various methods of the string class. String class methods that you may find useful in parsing the data include find, erase, and substr.
Dont forget to include needed libraries! You may specify the std namespace either in the using clause or using scope resolution.
Full Javadoc documentation comments are required for all public members in the ArtWork
Deliverables:
ArtWork.h
ArtWork.cpp
main.cpp (or the name of the file where main() is)
artwork.csv

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!