Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Your next task is to implement the MovieList class that manages the details for a list of DVD Movies read from the specified data file. The constructor will include a parameter that is the name of this data file (you will most likely use movies.txt as you develop your code, however I will test it with a different file name). The constructor must create an UnorderedLinkedList, open the named file, read lines from it, and add Movie objects with the details read from the file to the end of the list.

You also need to include methods that perform the following searches:  list the first 20 movies, returning their details in a string.

  • search for the movie with the specified catalog number, and return it's details in a string.
  • search for all movies whose year of release is between the supplied start and end years, and return their details in a string.
  • search for all movies that match the specified title, and return their details in a string.

Initially you should just check whether the title of each movie examined is the same as the one you are searching for. For maximum marks, rather than just comparing the titles to see if they are the same, you should treat the supplied search title as a pattern that can include "wildcards" (ie match a range of characters at that place). Hint. research the String matches() method and the Pattern class.

All of the above methods require you to traverse the list, examining each Movie object in turn to see whether the desired aspects match what you are searching for. To do this you need to use an Iterator (as provided in the LinkedIterator class) to scan the list. You need to examine the code in this class, and read the text on how it is used.

Further, once you have the above search methods working, you should modify them so that the 1st Movie object found is removed from its current location in the list, and inserted at the head of the list.

You should also include in this class a test main() method that creates a MovieList object from the specified data file, and then tests the key methods you have written for this class. The last method tested should be the list of the first 20 movies. Please ensure that this test code does not generate excessive amounts of output. Your code will be run from the command-line with arguments supplied naming:

the movie data file, a catalog number to search for, start and end years, and a title; looking something like:

java MovieList moremovies.txt 1055 1964 1966 "Toy Story"

You can either assume some sensible defaults if a parameter is not provided, or simply not do the relevant search if that is reasonable.

Java, Programming

  • Category:- Java
  • Reference No.:- M9524982

Have any Question?


Related Questions in Java

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As