



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




The goal of this assignment is help you transition your C++ skills to Java programming skills on material that you should know from EECS 281. We will be using Java for application-level SQL programming in the course because a lot real-world programming for database applications is done in Java. However, we will be using C++ for implementing the Minirel2K database system (last two projects) because most systems programming is still done in C++. In this assignment you are to develop a “word locator” program written in Java, which will allow a user to check if a specified (re)occurrence of a specified query word appears in the input text file. The goal is to use efficient data structures for the task.
Your program code must be in a single file “WordLocator.java”. When started, your program will display a prompt “>” (printed on stdout ) and will then be ready to accept one of the following four (4) commands, each terminated by a newline, where
Your program should respond to incorrect commands in the following ways:
Given the following sample text file, sixpence.txt: (^1) The error handling component of this assignment has deliberately been simplified to ease the programming load. In a real application, one should print error messages that identify the specific error and help the user in correcting their input. You will get sufficient practice in such error handling methods when you work on the Minirel assignments.
The files for this assignment can be downloaded from CTools in archived form (P1.tar.gz). Using any of the campus Linux machines, you can decompress the files using the following commands:
gunzip P1.tar.gz tar – xvf P1.tar You should then have a directory P1/ containing the following files:
You are welcome to use any environment for your development, but you must provide us with a version that will work with /usr/bin/java on CAEN workstations that are reachable via ssh to loginlinux.engin.umich.edu. You can type in “java - version” to check the Java version. Please make sure that your code works with this version. If you use features in a newer version of Java, then you may fail our tests and your grade will be adversely affected.
This program must be written in Java. Your coding style should have intuitive, well-defined classes, clean interfaces, modular design, and informative variable names. The code should be
well-documented. Each file should start with a header describing the purpose of the file and should also contain your uniqname(s). Testing for correctness involves more than just seeing if a few test cases produce the correct output. You should test your program on some large files (e.g., 100K-10 MB in size) to see that it gives adequate performance and still works correctly. In addition to the test driver that we provide, your assignment will be tested against our (more comprehensive) test driver. You are encouraged to develop additional tests on your own. To compile the code, we will use the following command: % javac WordLocator.java To run it, we will use the following: % java WordLocator
To submit the assignment, we will use CTools. Please see the instructions on the course website. Important: Try to access CTools several days before the deadline to confirm that you can see “EECS 484 001 F08” and the instructions for the first assignment. If you try to access CTools for the first time right before the deadline, you may miss the deadline.
This assignment is worth 8% of your grade. Your score for the assignment is as follows: