I need a little help with this movie list assignment. I created a portion of it
ID: 3684936 • Letter: I
Question
I need a little help with this movie list assignment. I created a portion of it yet I am stuck.
Maintain a movie list
• In this assignment, you will use your skills for developing GUI applications and working with text file to enhance the Movie List application that we did in Home- work #2, chapter 12.
• You will build a GUI application that maintains a list of movies. Furthermore, the movies data will be stored in a text data file, instead of a Java class like Mov- ieIO.java in homework #2. Operation
• This application maintains a list of 100 movies which is stored in a text file named movies.txt
• If the user select one of the radio buttons and click the List movies button, the list of movies that match the selected category will be displayed in the text area.
• If the user enter a movie title and it’s category, and then click the Add movie button, the application will add the movie to the text file.
• If the user enter a movie title and it’s category, and then click the Delete movie button, the application will delete the movie from the text file. Specifications
• Each movie should be represented by an object of type Movie. The Movie class must provide two public fields: title and category. Both of these fields should be Strings. The class should also provide a constructor that accepts a title and cate- gory as parameters and uses the values passed to it to initialize its fields.
• You will be supplied with a text file named movies.txt that contains the list of 100 movies. In this file, each movie is listed in a separate line. Within each record (each movie), the fields (title and category) are separated by a tab.
• When the user selects a category, the program should create an ArrayList of Movie by reading the provided text file movies.txt. It then should read through all of the movies in this ArrayList and display a line for any movie whose category matches the category entered by the user in the text area.
• When the user chooses to add a movie, the program should add this new Movie object to the current ArrayList of the movie, and then write this new list to the same text file movies.txt.
• When the user chooses to delete a movie, the program should remove this Movie object from the current ArrayList of the movie, and then write this new list to the same text file movies.txt.
• When the user chooses to add or delete a movie, the two fields Movie title and Category are required. So if the user leaves any of these fields blank, a message must be displayed to inform the user of the requirement.
Hints
• Whether you choose to use the DAOFactory model as in the ProductMainte- nance application (chapter 18) or not, the methods of the ProductTextFile class in page 581and page 583 are good references.
• When using the methods of the ArrayList such as contains, remove, … make sure that your Movie class override the equals method of the Object class. It ensures correct behaviors of those methods. You can refer to the equals method of the Product class (page 265, example 3) of the Product Maintenance application as an example. Enhancements (this part is not required and will not be counted for any extra credit)
• When the user adds a movie, if the movie is already listed in the text file, display a message to let the user know and DONOT add the movie to the text file.
• When the user deletes a movie, if the movie does not exist in the text then display a message to let the user know and do nothing to alter the text file. Submission
• Once you are done (programming and testing), export your project to a zip file: Select the project in the Projects window. Select File menu, then Export Project, then To Zip. Name your zip file MovieMaintForm_YourInitials. More GUI demos
1. User enters the movie Cars of animated category: a. Before clicking the Add movie button: b. After clicking the Add movie button and then click the List movies but- ton:
2. User enters the movie Cars of animated category a. Before clicking the Delete movie button: b. After clicking the Delete button and then click the List movies button:
3. When the user try to add a movie that is already in the file:
4. When the user try to delete a movie that does not exist in the list:
5. When one or two required fields are missing when adding or deleting a movie:
Movies List SciFi Star Wars 2001: A Space Odyssey T. The extra-terresrial Drama Drama E ama A Clockwork Orange O Comedy O Musical Close Encounters Of The Third Kind Avatar Animated Movie title Category List movles Add movle Delete movle ExItExplanation / Answer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Add a Movie</title>
</head>
<body>
<h1>Add a Movie</h1>
<form method="post">
<fieldset>
<legend>Movie Information</legend>
<p><label for="Scifi">Scifi:</label>
<input type="text" name="Scifi" value="@Request.Form["Scifi"]" />
</p>
<p><label for="Drama">Drama:</label>
<input type="text" name="Drama" value="@Request.Form["Drama"]" />
</p>
<p><label for="comedy">comedy:</label>
<input type="text" name="comedy" value="@Request.Form["comedy"]" />
</p>
<p><label for="Musical">Musical:</label>
<input type="text" name="Musical" value="@Request.Form["Musical"]" />
</p>
<p><label for="Animated">Animated:</label>
<input type="text" name="Animated" value="@Request.Form["Animated"]" />
</p>
<p><label for="Movie Title">Movie Title:</label>
<input type="text" name="Movie title" value="@Request.Form["Movie Title"]" />
</p>
<p><label for="Category">Category:</label>
<input type="text" name="Category" value="@Request.Form["Category"]" />
</p>
Note:If we want to delete a movie use delete command in the database.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.