Due: March 03, Thursday, 11:00 am.
Language: Java
Submission:
Add two new commands to your CLI: list and rename
Print error messages on the screen for these commands. Apart from error commands you are required to:
See the example given below for Task 1 and Task 2. Make sure that you cover all errors and warnings listed here.
buse@buse src $ java NoteCat.NoteCat
> help
noteCat 1.0.0 - 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
rename [note] Rename existing note
delete [note] Delete existing note
list [all ] List all notes taken so far.
help Prints this help menu
exit Terminates NoteCat
> list all
You have no taken notes yet.
> new red
Enter your note
red#ENDcrimson
> show red
red
> list all
red.ncat
> list red
red.ncat
> new pink
Enter your note
pink#END
> list all
red.ncat
pink.ncat
> list blue
File does not exist
> list red now
Invalid number of arguments
> lst red
Invalid note taking command
> list
Invalid menu control command
> rename red
Enter the new note name
crimson
> list red
File does not exist
> list all
crimson.ncat
pink.ncat
> show crimson
red
> list all
crimson.ncat
pink.ncat
> rename blue
Enter the new note name
azure
File does not exist
> rnme
Invalid menu control command
> rename orange yellow
Invalid number of arguments
> ren blue
Invalid note taking command
> list all
crimson.ncat
pink.ncat
> rename crimson
Enter the new note name
sca rlet
Invalid note name for renaming. It contains ' '.
scarlet
> show scarlet
red
> list all
scarlet.ncat
pink.ncat
> rename scarlet
Enter the new note name
pink
File already exists
> exit
buse@buse src $
Refactor your code. In addition to appropriate naming, clean and short and well-defined functions, apply what you have learnt from formatting lecture. Make sure that you don’t have any code smells in your code.
Penalties: