Limited access

Upgrade to access all content for this subject

Consider the following requirement.

A movie producer produces a variety of movies, each with a unique list of actors. A movie has only one producer and can be reviewed by several reviewers. A review consists of a reviewer name, rating, and the review.

Which of the following would be the BEST design to implement this relationship?

A
public class Producer 
{
    private ArrayList<Movie> movies;
    // other data and methods not shown
}

public class Movie 
{
    private ArrayList<String> actors;
    private String reviewer;
    private int rating;
    private String review;
    // other data and methods not shown
}
B
public class Producer 
{
    private ArrayList<Review> reviews;
    private ArrayList<String> actors;
    // other data and methods not shown
}

public class Review 
{
    private String reviewer;
    private int rating;
    private String review;
    // other data and methods not shown
}
C
public class Producer 
{
    private ArrayList<Movie> movies;
    private ArrayList<String> actors;
    // other data and methods not shown
}

public class Movie 
{
    private ArrayList<Review> reviews;
    // other data and methods not shown
}

public class Review 
{
    private String reviewer;
    private int rating;
    private String review;
    // other data and methods not shown
}
D
public class Producer 
{
    private ArrayList<Movie> movies;
    // other data and methods not shown
}

public class Movie 
{
    private ArrayList<Review> reviews;
    private ArrayList<String> actors;
    // other data and methods not shown
}

public class Review 
{
    private String reviewer;
    private int rating;
    private String review;
    // other data and methods not shown
}
E
public class Producer 
{
    private ArrayList<Movie> movies;
    // other data and methods not shown
}

public class Movie 
{
    private ArrayList<Producer> producers;
    private ArrayList<Review> reviews;
    private ArrayList<String> actors;
    // other data and methods not shown
}

public class Review 
{
    private String reviewer;
    private int rating;
    private String review;
    // other data and methods not shown
}
Select an assignment template