Starting from:
$35

$29

Lab 7: A Simple Database Solution

Introduction

As we discussed in lecture, les can be a very useful as a way to input data into a program and to store the output of program execution. Arrays can also be useful data structures in which to store and access information. In this lab, you will develop a simple application that utilizes object-oriented programming. Java arrays and a Java test le. The idea is as follows: You will implement a very primitive database of movies. Initially, the database will be read into the program from a text le. Then, through the program you will be able to search for a movie, add a movie, show the complete list of movies, or quit the program. When you quit the program, the list of movies will e saved back to the le.

We discussed in lecture how an ArrayList can be utilized to store/manipulate a collection of objects. In this lab, you will implement yourself some of what an ArrayList does for you. It is a good way to see how to implement these operations and also why having an ArrayList already implemented for us is a very useful thing.

Lab Exercise

Most of this lab has been written for you, with comments. Read over the code and the comments carefully, so that you understand what is being done. Note especially, how the Movie class and the MovieDB class have been set up. Note also the movieFile.txt data le, so you understand how the data is to be formatted. Your task is to complete the sections of code that have been omitted rom the main program so that it works correctly. Ask your TA if you need help.

Here are the pertinent    les (on CourseWeb):

Movie.java: Class to represent a Movie. This has already been completed for you, but read the comments carefully.

MovieDB.java: Class to represent a simple database of Movies. This also has been completed for you, but again read it carefully to see how it implements the various operations.

Lab07.java: Main program class. Much of this has also been implemented, but you must complete 3 sections to get it to work.

movieFile.txt: Example  le used for the program

output.txt: Demo runs to show how program should work

Grading

We will use the following grading criteria:

Code Segment 1: 4 points

Code Segment 2: 3 points

Code Segment 3: 3 points







CS/COE 0401 | Intermediate Programming with Java    Page 1
Lab 7: A Simple Database



Due Date and Submission

Once you completed the program, you must demonstrate your program for your Lab TA. Once your TA already checked you, DO NOT FORGET to submit your Lab07.java le to the CourseWeb under this lab by the due date.

If you do not complete the lab this week, you may nish it and submit your code to the CourseWeb before the due date. However, you need to demonstrate it to your TA at the beginning of next week’s lab.

No late submission will be accepted.






















































CS/COE 0401 | Intermediate Programming with Java    Page 2

More products