There are two parts to this assignment, due at different times:
memo.txt
and
Bank.java
electronically at
http://turnin.cs.umb.edu/
before the Healey Library labs close
on Tuesday, February 3. You can find out when that is by consulting
the page
http://www.cc.umb.edu/GULSite/labhours.htm.
You can find this assignment on the web by following the
hw1
link on the course web page www.cs.umb.edu/cs110.
Some words of warning and advice. Much of computer programming requires reading and writing in which you pay careful attention to details. That's not the way most people read and write most of the time, and most of the time that's OK. But if you're too casual in this course, and just skim, you will not do well.
Begin reading carefully with this assignment.
The Subject for the email should be CS110
and the body
should be just one line with entries, separated by commas, containg
your last name, your full name, your student id, your section number
and the email address we should use to contact you. For example, if
Tony Liu were in section 4 his email might contain the line
Liu, Anthony Liu, 1234567890, 4, tony_liu@umass-student.umb.edu
Follow these instructions exactly!
You may use any email account you read regularly. If you do not have an email account, UMass-Boston will provide you with a free one: the instructions at http://www.umb.edu/students/webmail.html tell you go to the Customer Service Center (Upper Level walkway between the bus stop and the Quinn Administration building) to set up your account.
Write a paragraph or two describing some interesting things you came across and where you found them.
You can find the instructions which follow illustrated in the on line XEmacs tutorial for CS110.
memo.txt
, where
File name:
is called for. Finally, click
on Open.
OR do it the quick and easy way. The mouse is slow, and moving
back and forth from the mouse to the keyboard is even slower. You can
do just about everything you want to do in XEmacs from the
keyboard if you know some good tricks. The first is that the control
key, abbreviated ctrl
, is like a shift key. So to
type
ctrl-x
you hold down the Control key while typing
x
.
Now you can open a file the easy way. Practice that now by leaving
XEmacs.
To leave XEmacs, type
ctrl-x ctrl-c(the easy way) or (the hard way), with more mouse work, by selecting Exit from the File pulldown.
Start XEmacs over again. This time just type
ctrl-x ctrl-fThe cursor will move to a special line (called the minibuffer) at the bottom of the XEmacs window. Use the backspace key to erase what's there after the
Find file:
prompt, replace it with
A:\memo.txtand press the
Enter
key.
memo.txt Tony Liu January 28, 2004 CS110, hw1 Part IThen type what you want to say in answer to the questions asked. The arrow keys and the delete key and the backspace key will all do just what you expect them to.
ctrl-x
ctrl-s
.
When you type past the end of a line, XEmacs will automatically
start a new line for you. If the formatting of any paragraph is wrong
because you have deleted or added words, you can tell XEmacs to fix it
up with another keyboard trick. This one uses the escape key,
marked ESC
in the upper left corner of the keyboard. It
is not like a shift key. To type ESC q
you first type
ESC
and then type q
.
To fix up the formatting of a paragraph, just
position the cursor anywhere in the paragraph, then
type ESC q
. (Sometimes XEmacs instructions call the
Escape key "Meta" and write ESC q
as M-q
.)
If you try this (or anything else) and don't like it, you can use the
Undo selection from the Edit pulldown. (Try that. And note that XEmacs
tells you that C-x u
(which is just ctrl-x u
)
will undo from the keyboard.
Separate paragraphs with blank lines.
After you are satisfied with what you have, save your work (again) and print hard copy to turn in. Use the print choice from the File pulldown.
Neither a handwritten version of the file nor hard copy from some other word processing program will (perhaps at home) will do. Part of the point of this exercise is to make sure you learn your way around our system.
Be sure your name is on your work - in the file itself, not added as an afterthought. If you are submitting more than one page, staple them together.
Remember that there will be a long queue at the printer just when the assignment is due. Don't wait until the last minute to print your memo.txt.
G:
disk in folder G:\Temp\My Documents
.
If you have no floppy to put in drive
A:
you can do your work there. But then you
cannot take it home with you. When you are done
G:
disk.
This part of the assignment will be collected electronically at http://turnin.cs.umb.edu/. We will not accept hard copy.
We have written programs to
compile and test the your
Java code, and prepare a package of your material for
for the grader. It is your responsibility to make sure that you submit
all the required files, with the right filenames -
spelled correctly. Our software is
case sensitive
the program will not find
Memo.txt
if memo.txt
was called for.
Note: This is a long assignment. It is better to do part of it well then all of it poorly.
If you can't finish, don't worry. You can redeem lots of partial credit by writing clearly about what you tried. (If you can't get started, do worry.)
Ctrl-x
Ctrl-f
and then just A:
at the prompt. You should
see a listing of all the files on your floppy.
ctrl-x ctrl-r
.
java Bank
memo.txt
. (You can add to the file that's already on your A:
disk.)
You may (but need not) include a partial record of an
actual Bank session in
your memo.txt. If you want to do that you will want to learn
how to copy text from one place in XEmacs and paste it in another: drag
the mouse over the text you want to copy, select Copy from the Edit
pulldown, move the cursor to where you want to paste, and select Paste
from the Edit pulldown. (And, yes, you can do all this with just the
keyboard. Find out by studying the XEmacs tutorial - go there by
typing ctrl-h
(for "help")and then t
(for
"tutorial").
memo.txt
. Tell us
what
things were easy; what things were hard; what problems you
encountered and how you solved them; what was interesting; what was
boring ...
This is essentially Exercise 1-1 in JOI. Every assignment for this course will require a memo.txt file like this one. This memo will count significantly in your grade. Do not wait to write it "until you get the answers right". Rather, write about your ongoing work as tool to help you master the material. Many find that writing the memo often helps them do a better job. Consider keeping part of your memo in the form of a diary, adding to it (with dated entries) each time you sit down to work on the computer.
But diary format is not always best. When an assignment asks you to answer a particular question in your memo, please make sure that answer is labelled so that the grader can easily find it.
The Java source code for the bank simulation on the JOI cd, and on the JOI web page in several forms.
In this assignment you will make some changes to
Bank.java
. Find that file on the CD or the web
page. Then copy it to your A: disk. (You can do
that by visiting it with the browser and selecting Save).
Edit the file in XEmacs: ctrl-x ctrl-f
, then type
Bank.java
at the prompt.
Tell XEmacs to compile the file: either ctrl-x ctrl-m
or
Compile from the Tools pulldown. The minibuffer will show the
Compile command:
prompt and the default entry
javac *java
, which means "compile all the .java
files in the current folder). Type enter.
Now run the Bank as before just to make sure it works as it always has.
You are about to work on your first Java program. Before you start, learn these style guidelines:
// @@@
"
so that the
graders can easily find the places that you worked on.
Engulf and Devour
to whatever name you choose.
This is JOI Exercise 1-3a.
Bank.java
with XEmacs, find the place
in the file
where the name is set, and change it.
Bank.java
and recompile. What happens if you try
to recompile without saving the file first? What happens if there's a
syntax error in your file?
memo.txt
.
Bank.java
to locate the places where you want to make
changes.
Bank.java
to make those changes. Be sure to
preserve the look of the code - in particular, the way the lines are
indented. Save your work.
memo.txt
. Include an annotated fragment of your run (pasted
from the XEmacs Shell buffer)
demonstrating that your code works as it should.