java 命令行接口 程序求助
Write a CLI (Command Line Interface) program called TextBuddy using Java/C++ to manipulate text in a file. Here is a sample interaction with the program. Text in purple are commands entered by the user.c:> TextBuddy.exe mytextfile.txt (OR c:>java TextBuddy mytextfile.txt)
Welcome to TextBuddy. mytextfile.txt is ready for use
command: add little brown fox
added to mytextfile.txt: “little brown fox”
command: display
1. little brown fox
command: add jumped over the moon
added to mytextfile.txt: “jumped over the moon”
command: display
1. little brown fox
2. jumped over the moon
command: delete 2
deleted from mytextfile.txt: “jumped over the moon”
command: display
1. little brown fox
command: clear
all content deleted from mytextfile.txt
command: display
mytextfile.txt is empty
command: exit
c:>
Note that mytextfile.txt is a parameter given when running the program. i.e., The name of the file is not always mytextfile.txt.
想了很久不知从何下手。 求帮忙。