www.cs.wright.edu
/people/faculty/pmateti/
CS 340: Programming Language Workshop in Java
1 Credit Hour, Winter Qtr 1998, Wright State U
Instructor:
Dr Prabhaker Mateti,
Associate Professor
Office Hrs: TBA at 449 Russ, or by appointment
pmateti@cs.wright.edu
(937) 775 5114
Grading|
Projects |
Important Dates |
Java Bookmarks
This course is a self-directed study of Java. There are no
lectures. There are no exams. We officially meet only once during the
first week of the quarter. Please read your e-mail at least once a
day. Please visit this homepage
http://www.cs.wright.edu/people/faculty/pmateti/340.html
of the course on every Monday after 1:00PM. All
new items will be highlighted in this color.
Prerequisite: CS 400: Data Structures and Software Design.
Familiarity with C and C++.
Text Book
There are numerous books on Java. You are welcome to use whatever
book that appeals to you. Our recommendation is the following.
Programming Projects
All programs must be written in Java. There are three projects.
You may use either the Windows 95/NT or Unix environment of your choice.
If you wish to use Wright State facilities, please visit my
Java Bookmarks.
Here are the projects.
The overall layout of the GUI and other possible enhancements have
been left to your imagination.
1. Count the Words
We wish to count how many times each word of a text file appears in
that file. The name of this file is given as an argument to the application.
The program is then required to output a sequence of lines, one per word.
Each output line consists of the word followed by its count of how many
times it appeared in the file.
Use classes such as LineNumberReader, StreamTokenizer
in package java.io, and classes such as Vector, Hashtable
in package java.util.
2. Scroll Bars, Etc.
We now wish to add a simple Graphical User Interface to the above
application, to exercise a couple of primitives in java.awt
package. You may turn this into either an application, or an applet, or
more interestingly both.
- Add a menu bar (similar to, say, your Web browser) showing
File,...,Help.
- Use a FileDialog to get the file name. Assume that the
text files have a .txt extension.
- Add a scroll-barred window through which we can see the output lines.
- Add a scroll-barred window through which we can see the input file.
- Add one radio-button each that can turn-on or off line numbers
in each of the windows.
3. Drawing Shapes
Add a third window to the above, that shows a histogram of
the top ten words. Let the user control
- the width,
- the spacing, and
- the colors
of the histograms.
Grading
Each programming assignment will be graded on a scale of 10 points.
You will receive 3 points if your program appears complete and compiles
without errors, or zero otherwise. You will receive 4 additional
points if your program appears to function as required and runs without
errors, or zero otherwise. You will receive upto 3 additional points
if your program is written according to good Java style, and is well-documented.
You must hand-in both (1) hard-copies of your source code, and test
input/output files, and (2) send via e-mail attached copies of the source
code (not .class) files. I may require you to demonstrate
your program, if necessary.
Important Dates
The assignments must be submitted before 5 PM on the due date. There
is a late penalty of 1 point per day (Mon-Fri, Sat and Sun).
last updated by pmateti@cs.wright.edu
Jan 98