Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(50 points) Polymorphic Movies listing For this exercise, you want to use the polymorphic technique we have discussed in class to display a list of

  1. (50 points) Polymorphic Movies listing

For this exercise, you want to use the polymorphic technique we have discussed in class to display a list of movies in random order. The movies are listed in a fixed order as the following table. The selection of movies to display is in a random order. You need to display the entire movie list for at least twice to show that there is no repeats within a list. Each movie has a structure of movie name, actor, and an one-liner representation. For this question, you need to create a separate class (java file) for each movie in the list. You are not allowed to use if-then-else or switch cases for the movie selection. To illustrate the flexibility of polymorphic programming technique, demonstrate that you can simply add one more movie to the list by adding a new movie class and one new line in your movies listing program. Do not forget to provide an UML diagram of all classes. It should look similar to the one shown at the end of this question.

Table of movie listing (fixed order)

1

Jaws

We need a bigger boat.

Mr. Quint

2

Independence day

No Ooops.

Will Smith

3

Bourne Identity

A man with many passports.

Matt Damon

4

Star Wars

Resistance is futile

Harrison Ford

5

12 Angrymen

Open and Shut Case

Henry Fonda

(you can replaced the movies with your favorite ones, )

Your display should look similar to the following. Since the listing is based on a random order, the display would be different for each run, but the contents should be very similar.

---- run number: 1

Random number generated was: 3

Movie #1 : Independence Day

A One-Liner : No oops!

Actor : Will Smith

Random number generated was: 1

Movie #2 : Star Wars

A One-Liner : Resistance is futile

Actor : Harrison Ford

Random number generated was: 0

Movie #3 : Jaws

A One-Liner : We need a bigger boat

Actor : Robert Shaw

Random number generated was: 2

Movie #4 : 12 Angry Men

A One-Liner : Open and Shut Case

Actor : Henry Fonda

Random number generated was: 4

Movie #5 : Bourne Identity

A One-Liner : A man with many passports

Actor : Matt Damon

---- run number: 2

Random number generated was: 3

Movie #1 : Independence Day

A One-Liner : No oops!

Actor : Will Smith

Random number generated was: 4

Movie #2 : Bourne Identity

A One-Liner : A man with many passports

Actor : Matt Damon

Random number generated was: 2

Movie #3 : 12 Angry Men

A One-Liner : Open and Shut Case

Actor : Henry Fonda

Random number generated was: 0

Movie #4 : Jaws

A One-Liner : We need a bigger boat

Actor : Robert Shaw

Random number generated was: 1

Movie #5 : Star Wars

A One-Liner : Resistance is futile

Actor : Harrison Ford

image text in transcribed

UML diagram without showing some of the details.

Java Class GIndependenceDay > Bourneldentity > Movies > MovieList name: String o actor String Java Class CJaws > StarWars > GAngryMen

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

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

5. Structure your speech to make it easy to listen to

Answered: 1 week ago

Question

1. Describe the goals of informative speaking

Answered: 1 week ago