Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please it is very urgent, I need this in JAVA Create a class Movie with following attributes: private int id; private String title; private int

Please it is very urgent, I need this in JAVA

Create a class Movie with following attributes:

private int id;

private String title;

private int year;

private List genres;

private Director director;

Create two more classes:

Class Genre with following attributes:

private int id;

private String name;

Class Director with following attributes

private int id;

private String name;

Generate parametrized constructors and getters and setters for all classes

In the main method initialize list of movies with following example values:

Movie title: The Shawshank Redemption, Movie director: Frank Darabont, Year: 1994, Genres: [Drama]

Movie title: The Godfather, Movie director: Francis Ford Coppola, Year: 1972, Genres: [Drama, Crime]

Movie title: The Godfather: Part II, Movie director: Francis Ford Coppola, Year: 1974, Genres: [Drama, Crime]

Movie title: Pulp Fiction, Movie director: Quentin Tarantino, Year: 1994, Genres: [Crime, Drama]

Movie title: Whiplash, Movie director: Damien Chazelle, Year: 2014, Genres: [Drama, Music]

Movie title: Once Upon a Time in Hollywood, Movie director: Quentin Tarantino, Year: 2019, Genres: [Drama, Music]

Movie title: The Prestige, Movie director: Christopher Nolan, Year: 2006, Genres: [Drama, Mystery , Sci-Fi, Thriller]

For the Director id and Genre id you can use either random or hard coded number but the same genre/director should have the same id.

Using java stream create a program that will:

print the movie details as shown above

Print the list of all movie directors (without duplicates)

Print all movie titles from Quentin Tarantino (Only the move titles, not the whole objects)

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

Microsoft Office 365 For Beginners 2022 8 In 1

Authors: James Holler

1st Edition

B0B2WRC1RX, 979-8833565759

More Books

Students also viewed these Databases questions

Question

love of humour, often as a device to lighten the occasion;

Answered: 1 week ago

Question

orderliness, patience and seeing a task through;

Answered: 1 week ago

Question

well defined status and roles (class distinctions);

Answered: 1 week ago