B: Artwork label (modules) Ex: If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881 to 1973) Title: Three Musicians, 1921 Ex: If the input is: Brice Marden 1938 -1 Distant Muses 2000 the output is:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello, 

 I am needing help with this lab. The code is correct. I am having trouble with the spacing. Please see the lab

2.15 LAB: Artwork label (modules)

Ex: If the input is:

Pablo Picasso 1881 1973 Three Musicians 1921

the output is:

Artist: Pablo Picasso (1881 to 1973) Title: Three Musicians, 1921

Ex: If the input is:

Brice Marden 1938 -1 Distant Muses 2000

the output is:

Artist: Brice Marden (1938 to present) Title: Distant Muses, 2000

Ex: If the input is:

Banksy -1 -1 Balloon Girl 2002

the output is:

Artist: Banksy (unknown) Title: Balloon Girl, 2002

Please view current attachments:

The current code that I have, is currently uploaded to make it easier. As I stated before the code is correct, it is just the spacing that I need help with to correct the spacing errors. Please attach a screen shot of the code, like I have done. It helps with spacing and less errors. 

Please review the spacing errors as well. 

Thank you for all of your help. 

 

The image displays a comparison of code outputs for an art-related application and includes two sections where output discrepancies are highlighted.

**Section 2: Compare Output**

- **Input:**
  - Artist: Brice Marden
  - Year of Birth: 1938
  - Year of Death: -1
  - Title: Distant Muses
  - Year of Title: 2000

- **Your Output:**
  - Artist: Brice Marden, 1938
  - Title: Distant Muses, 2000

- **Expected Output:**
  - Artist: Brice Marden, 1938 – present
  - Title: Distant Muses, 2000

The difference highlighted is in the representation of the artist's lifespan; the expected output includes "present" after the birth year since the artist is still alive.

**Section 3: Compare Output**

- **Input:**
  - Artist: Banksy
  - Year of Birth: -1
  - Year of Death: -1
  - Title: Balloon Girl
  - Year of Title: 2002

- **Your Output:**
  - Artist: Banksy, -1
  - Title: Balloon Girl, 2002

- **Expected Output:**
  - Artist: Banksy (unknown)
  - Title: Balloon Girl, 2002

Here, the discrepancy is in the handling of the unknown birth and death years for Banksy. The expected output replaces "-1" with "(unknown)" to represent uncertainty about Banksy's birth and death years.

Both sections have an evaluation score of 0/1, indicating the output did not meet the expected requirements.
Transcribed Image Text:The image displays a comparison of code outputs for an art-related application and includes two sections where output discrepancies are highlighted. **Section 2: Compare Output** - **Input:** - Artist: Brice Marden - Year of Birth: 1938 - Year of Death: -1 - Title: Distant Muses - Year of Title: 2000 - **Your Output:** - Artist: Brice Marden, 1938 - Title: Distant Muses, 2000 - **Expected Output:** - Artist: Brice Marden, 1938 – present - Title: Distant Muses, 2000 The difference highlighted is in the representation of the artist's lifespan; the expected output includes "present" after the birth year since the artist is still alive. **Section 3: Compare Output** - **Input:** - Artist: Banksy - Year of Birth: -1 - Year of Death: -1 - Title: Balloon Girl - Year of Title: 2002 - **Your Output:** - Artist: Banksy, -1 - Title: Balloon Girl, 2002 - **Expected Output:** - Artist: Banksy (unknown) - Title: Balloon Girl, 2002 Here, the discrepancy is in the handling of the unknown birth and death years for Banksy. The expected output replaces "-1" with "(unknown)" to represent uncertainty about Banksy's birth and death years. Both sections have an evaluation score of 0/1, indicating the output did not meet the expected requirements.
This code is written in Python and demonstrates the use of classes to model an "Artist" and their "Artwork". Below is a detailed description and transcription of the code:

### Code Overview

The code defines two classes: `Artist` and `Artwork`. Instances of these classes represent artists and their respective artworks, including relevant information such as names, birth and death years, artwork titles, and the year the artworks were created. The code allows for user input to populate these classes and prints out the information.

### Classes and Methods

1. **Class: `Artist`**

   - **Method: `__init__`**
     - Parameters: `self`, `name='None'`, `birth_year=0`, `death_year=0`
     - Initializes an artist's name, birth year, and death year.
   
   - **Method: `print_info`**
     - Prints out the artist's name and birth/death years.
     - If `death_year` is not provided (equals -1), it prints only the birth year.
     - Otherwise, it prints the birth year followed by the death year.

2. **Class: `Artwork`**

   - **Method: `__init__`**
     - Parameters: `self`, `title='None'`, `year_created=0`, `artist=Artist()`
     - Initializes the artwork’s title, year created, and associated artist.
   
   - **Method: `print_info`**
     - Calls the artist's `print_info` method.
     - Prints the artwork's title and the year it was created.

### Main Functionality

- Takes user input to create an artist and an artwork.
- User inputs:
  - Artist's name, birth year, death year.
  - Artwork's title and year of creation.
  
- Constructs objects of the `Artist` and `Artwork` classes using the input data.
- Prints out the information using the `print_info` methods of both classes.

### Transcription of the Code

```python
class Artist:
    def __init__(self, name='None', birth_year=0, death_year=0):
        self.name = name
        self.birth_year = birth_year
        self.death_year = death_year

    def print_info(self):
        print('Artist: ' + self.name, end='')
        if self.death_year == -1:
            print(' (' + str(self.birth_year) + ')
Transcribed Image Text:This code is written in Python and demonstrates the use of classes to model an "Artist" and their "Artwork". Below is a detailed description and transcription of the code: ### Code Overview The code defines two classes: `Artist` and `Artwork`. Instances of these classes represent artists and their respective artworks, including relevant information such as names, birth and death years, artwork titles, and the year the artworks were created. The code allows for user input to populate these classes and prints out the information. ### Classes and Methods 1. **Class: `Artist`** - **Method: `__init__`** - Parameters: `self`, `name='None'`, `birth_year=0`, `death_year=0` - Initializes an artist's name, birth year, and death year. - **Method: `print_info`** - Prints out the artist's name and birth/death years. - If `death_year` is not provided (equals -1), it prints only the birth year. - Otherwise, it prints the birth year followed by the death year. 2. **Class: `Artwork`** - **Method: `__init__`** - Parameters: `self`, `title='None'`, `year_created=0`, `artist=Artist()` - Initializes the artwork’s title, year created, and associated artist. - **Method: `print_info`** - Calls the artist's `print_info` method. - Prints the artwork's title and the year it was created. ### Main Functionality - Takes user input to create an artist and an artwork. - User inputs: - Artist's name, birth year, death year. - Artwork's title and year of creation. - Constructs objects of the `Artist` and `Artwork` classes using the input data. - Prints out the information using the `print_info` methods of both classes. ### Transcription of the Code ```python class Artist: def __init__(self, name='None', birth_year=0, death_year=0): self.name = name self.birth_year = birth_year self.death_year = death_year def print_info(self): print('Artist: ' + self.name, end='') if self.death_year == -1: print(' (' + str(self.birth_year) + ')
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education