CS 222 Spring 2016

Simple Note Taker, Part II

Due: February 25, Thursday, 11:00 am.

Language: Java

Submission:

  • Your file containing the main method WILL HAVE the name NoteCat.java
  • DO NOT include package names
  • Check your file encoding. It should be UTF-8
  • Commit your code to SVN

Task 1

Add two new commands to your CLI: append and delete.

  1. append command will append to an existing note.
  2. delete command will delete an existing note.
  3. Expand your help menu with these new commands.

Task 2

Print error messages on the screen for these commands. See the example given below for Task 1 and Task 2.

buse@buse src $ java NoteCat.NoteCat
> help
noteCat 0.0.1 - simple console notetaking program
USAGE: noteCat <COMMAND> [DATA]
OPTIONS:
new    [note] Create new note
append [note] Append to an existing note
show   [note] Display existing note
delete [note] Delete existing note
help          Prints this help menu
exit          Terminates NoteCat
> new note
Enter your note
your task is to app new commands: append and delete#END
> new note2
Enter your note
Also refactor your code according to what you have seen in the class today.#END
> show note
your task is to app new commands: append and delete
> show note2
Also refactor your code according to what you have seen in the class today.
> append note2
Enter your note
Remember to write short, well-defined methods, pay attention to naming.#END
> show note2
Also refactor your code according to what you have seen in the class today.
Remember to write short, well-defined methods, pay attention to naming.
> append note3
Enter your note
File to delete does not exist
> delete note
> delete note 
File to delete does not exist
> exit

Task 3

Refactor your code. In addition to appropriate naming, make your functions clean, short, and well-defined.

Grading

  • Functionality
    • Proper note taking commands: 7
    • Proper CLI: 5
    • Wrong command detection: 5
  • Coding style
    • Names: 10
    • Functions: 15

Penalties:

  • Absence of command line: -10 points
  • Keeping notes in an internal data structure instead of writing to file: -10 points