View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Lab6 - Sp2000

Lab6 Implementing the Design

Last week you were given a problem and asked to work in groups of 2 to design a solution to that problem. This week we want you to work in those same groups to code that solution. Now we know that some of you may not have gotten the design correct. So we're going to give you a description of the design and let everyone code from a correct design.

What to turn in:

The due date for this lab is Wednesday March 15. We want only 1 group member to email the code. In the ArtGallery class we want you to put a class comment (the ? button in the System Browser) stating you and your partner's names, gt #'s, and sections. If you do not have this, we have no way of knowing who your partner is.

Design Solution:

This application requires 5 classes:

The ArtGallery will contain a collection of Paintings. These Paintings can be of the type: Masterpiece, Masterwork, or Other. Each type of Painting will know how to determine if it should be bought or not. If it should be bought then it should be added to the collection. If it should not be bought, then don't add it to the collection that the ArtGallery has. Please refer to last week's lab for the details that each will need.


You will need 2 files to go along with your program. They are being provided for you. Their names are: fashionability.txt and auctiondata.txt. Below are links to these files. When searching through the acutiondata.txt file just look for the artist's name.


Format of the auction data is as follows:
artist painting-title date-of-painting height width medium subject auction-date sale-price


The following is the code that we will use to test your program. The comments in the argument space tell you the type of argument that each method will take. Your program should be capable of dealing with anything that fits the given format. In testing your code, you should fill in the comments with something that fits the given format.

  | gallery |
gallery:= ArtGallery new.
gallery buyPaintingType: "string " artist: "string formatted: first name last name" height: "number" width: "number".

"After the above  lines have been executed, a message should appear on the Transcript, telling Osbert the maximum amount he should pay for the painting.  If he buys the painting, the following will be executed.  This will fill in the information about the painting."

gallery artistFirstName:  "string".
gallery artistLastName: "string:.
gallery paintingTitle: "string".
gallery paintingDate: "number formatted like:  yyyy".
gallery classification: "string".
gallery height: "number".
gallery width: "number".
gallery medium: "string".
gallery subject: "string".
gallery purchaseDate: "string formatted like: mm/dd/yyyy".
gallery sellerName: "string".
gallery sellerAddress: "string".
gallery actualPricePaid: "number".

"If a painting sells, the following will be executed:"
gallery paintingSold: "string: painting title" saleDate: "string:  mm/dd/yyyy" buyerName: "string" buyerAddress: "string" actualSellingPrice: "number".

"The following will display all of the paintings to the Transcript.  You should print all information about all of the paintings."
gallery showAllPaintings.

Link to this Page