注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
RPT – Command Processor
This exercise simulates a command line shell. It does not actually create any objects on the physical disk. Instead, it maintains objects and state within the context of running application.
While this application could be written procedurally, using OOP techniques (when appropriate) is preferred to separate functionality into more logical and maintainable pieces.
Input:
The main input mechanism of the application is the acceptance of text on the command line. Commands should be read and processed until the [quit] command is found.
If the entered command is not recognized, the Unrecognized command error should be returned. Or if the command has invalid parameters, or any parameter is missing, the Invalid Command error message should be returned.
Commands
Quit
Command Name: path (i.e., subdir1/subdir1-1/subdir3)
[cd] – The directory change should follow the path recursively. If any of the parts do not exist, the command should fail with a message of “Invalid path”.
[ls] –The listing should be of the final node of the supplied path.
The previous state of the application could be loaded from a file on disk. The contents of this file would be a serialized representation of the application context.
|