Question: JAVA CODING: (4) Polymorphic Movies listing For this exercise, you have a list of movies that you want to list it in a random order.
JAVA CODING:


(4) Polymorphic Movies listing For this exercise, you have a list of movies that you want to list it in a random order. This list consists of five movies. The purpose of this exercise is to demonstrate how you use the polymorphism technique to display the info of a selected movie. The selection is done using a random number generator. Each movie has a structure of (string movie name, string one-liner, string actor). The movie class also has methods that return the movie name, the one-liner and the key actor (see table below Your movie list is arranged in a specific number as show in the following table number name A one-liner actor 1 JawS We need a bigger boat No oops! A man with numerous passports Robert Shaw Independence 2 da Will Smith 3 Bourne Identit 4 Star Wars 5 12 Angry me Matt Damon Harrison Ford Henry Fonda Resistance is futile en and Shut Case (Sorry these movies are a bit outdated, you can replace them with your favorite movies) Your display should look similar to the following results. The order of display depends on the Random # number generator. Many of you may try to use the switch-case (or worst using "if then else") to select which movie to display based on the random number outcome. You are however, challenged to use the polymorphism approach to replace the switch-case (or if-then-else) method. The score is weighted as follow: polymorphism (100%), switch-case (80%) and if-then- else (60%)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
