Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An art gallery wants to manage its collection of paintings and painters more efficiently. They would like to create a Python program to help with

An art gallery wants to manage its collection of paintings and painters more efficiently. They would like to create a Python program to help with this task. The following requirements need to be implemented:
a. Create a Painter class with the following instance attributes:
i. name (the artist's name)
ii. dob (the author's date of birth)
iii. nationality (the author's nationality)
iv. paintings (a list to store all paintings created by the artist)
b. The Painter class must also have a list named all_painters that stores all Painter objects that get instantiated. Be sure to add the painter to this list when a new painter is created (in the __init__, method). This list will be used to add paintings to the gallery collection.
c. Create a method named paint() in the Painter class that takes the following parameters: litle (the title of the artwork)
i. year (the year the painting was created)
d. The paint() method in the Painter class must create a new Painting object (described below) with the Painter instance as its painter and add it to the painter's list of paintings.
e. Create a Painting class with the following instance atributes:
i. title (the title of the painting)
ii. painter (an instance of the Painter class)
iii. year (the year the painting was created)
f. The Painting class must also have a list named all_paintings that stores all Painting objects that get instantiated. Be sure to add the painting to this list when a new painting is created (in the q, init q, method). This list will be used to add paintings to the gallery collection.
g. The Painting class mustoverride the _ str_() method to return the painting's details in this format:
i. Title: , Artist: , year: .
h. finally create a gallery class with the following instance attributes:
i collection (a list to store all of the painting in the gallery)
Create a method named add_painting() in the gallery class that takes a painting object as a parameter and adds it to the gallerys collection ensure that duplicate paintings are not added to thw collection.
Display a message that indicates the painting (paintings title and artists name) was added to the gallery if it does not already have it in its collection or an alternative message if its already part of the collection
Create a method named list_paintings() in the gallery class that displays all of the paintings in the gallerys collection
If the gallery does not have any artworks in the collection it should state so
image text in transcribed

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

Step: 3

blur-text-image

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

Solve the equation. y + 7 = 9

Answered: 1 week ago

Question

A 300N F 30% d 2 m Answered: 1 week ago

Answered: 1 week ago