Question: Java please // Please help me fix the code that I have so it passes the requirements. I attached a photo of the errors I





Given main0. define the Artist class (in file Artist java) with constructors to initialize an artist's information, get methods, and a printinfo0 method. The default constructor should initialize the artist's name to "unknown' and the years of birth and death to - 1 . printinfo0 displays "Artist:" then a space, then the artist's name, then another space, then the birth and death dates in one of three formats: - (XXXX to YYYY ) if both the birth and death years are nonnegative - ( xxxx to present) if the birth year is nonnegative and the death year is negative - (unknown) otherwise Define the Artwork class (in file Artworkjava) with constructors to initialize an artwork's information, get methods, and a printinfo0 method. The default constructor should initialize the title to "unknown, the year created to -1. printinfo0 displays an artist's information by calling the printinfo0) method in Artist java, followed by the artwork's title and the year created. Declare a private field of type Art ist in the Artwork class. Ex. If the input is: Pablo Pleasso 1881 1973 Three Musioians 1921 the oulput is Aftiet: Pablo picasso (1881 to 1973) Tltle: Three Muolo1ana, 1921 Artist: Pablo Picasso (1881 to 1973) Fitle: Three Musicians, 1921 Ex. If the input is. Brice Marden 1938 1 Distant Musea 2000 the output is: Artist: Brice Marden (1938 to present) Title: Distant Muses, 2000 Ex. If the input is. the output is: Artiote Bankay (unknown) Title1 Hallocn Girl, 2002 Current file: Artwork.java - Load default template... Current file: Artist.java Load default template... marked as read only Current file: ArtworkLabel.java * import java.util. Scanner; public class ArtworkLabel \{ public static void main(String[] args) \{ Scanner scnr = new Scanner(System.in); String userTitle, userArtistName; int yearCreated, userBirthYear, userDeathYear; userArtistName = scnr , nextline(); userBirthYear =senr, nextint(); scnr, nextline(); userdeathYear = senr. nextInt(); scnr. nextline(); userTitle - scnr.nextline( ; year(reated =sscnr. nextint ; Artist userArtist = new Artist(userArtistName, userBirthYear, userDeathYear); Artwork newArtwork - new Artwork(userTitle, yearCreated, userArtist); b newartwork.printInfoO; LAB: Artwork label (classes/constructors) 3:Compare output Output differs. See highlights below. Special character legend \begin{tabular}{|l|l|} \hline & Banksy \\ \hline & 1 \\ Input & 1 \\ & Balloon Gir1 \\ & 2002 \\ \hline Your output & Artist:Banksy(-1to1)Title:BalloonGir1,2002 \\ \hline & \\ \hline Expected output & Artist: Banksy (unknown) \\ & Title: Balloon Girl, 2002 \\ \hline \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
