adding command examples
This commit is contained in:
@@ -37,6 +37,13 @@ The first argument is the name of an input file which contains a playlist. The s
|
|||||||
./nyplaylists.exe playlist.txt library.txt output.txt add title
|
./nyplaylists.exe playlist.txt library.txt output.txt add title
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This command will add a music track (specified by the title) to the end of a playlist.
|
||||||
|
|
||||||
|
For example, the following command will add the song Umbrella to the end of the playlist.
|
||||||
|
```console
|
||||||
|
./nyplaylists.exe playlist_tiny1.txt library.txt output.txt add "Umbrella"
|
||||||
|
```
|
||||||
|
|
||||||
### Command 2: remove a music track to a playlist
|
### Command 2: remove a music track to a playlist
|
||||||
The first argument is the name of an input file which contains a playlist. The second argument is the name of another input file which contains all available music tracks. The third argument is the output file. The fourth argument is the action, which in this case is "remove". The fifth argument is the title of the music track.
|
The first argument is the name of an input file which contains a playlist. The second argument is the name of another input file which contains all available music tracks. The third argument is the output file. The fourth argument is the action, which in this case is "remove". The fifth argument is the title of the music track.
|
||||||
|
|
||||||
@@ -44,6 +51,11 @@ The first argument is the name of an input file which contains a playlist. The s
|
|||||||
./nyplaylists.exe playlist.txt library.txt output.txt remove title
|
./nyplaylists.exe playlist.txt library.txt output.txt remove title
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For example, the following command will remove the song "Always Remember Us This Way" from the playlist.
|
||||||
|
```console
|
||||||
|
./nyplaylists.exe playlist_tiny1.txt library.txt output.txt remove "Always Remember Us This Way"
|
||||||
|
```
|
||||||
|
|
||||||
### Command 3: move a music track to a new position on the playlist
|
### Command 3: move a music track to a new position on the playlist
|
||||||
The first argument is the name of an input file which contains a playlist. The second argument is the name of another input file which contains all available music tracks. The third argument is the output file. The fourth argument is the action, which in this case is "move". The fifth argument is the title of the music track. The sixth argument is the new position - where this user wants the music track to be located on the playlist. Note that, unliked array indexing in C/C++, positioning in Spotify starts at 1, as opposed to 0. This can be seen in the above Spotify screenshot: the first position is position 1.
|
The first argument is the name of an input file which contains a playlist. The second argument is the name of another input file which contains all available music tracks. The third argument is the output file. The fourth argument is the action, which in this case is "move". The fifth argument is the title of the music track. The sixth argument is the new position - where this user wants the music track to be located on the playlist. Note that, unliked array indexing in C/C++, positioning in Spotify starts at 1, as opposed to 0. This can be seen in the above Spotify screenshot: the first position is position 1.
|
||||||
|
|
||||||
@@ -51,6 +63,11 @@ The first argument is the name of an input file which contains a playlist. The s
|
|||||||
./nyplaylists.exe playlist.txt library.txt output.txt move title [new_position]
|
./nyplaylists.exe playlist.txt library.txt output.txt move title [new_position]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
For example, the following command will move the song "I Will Never Love Again - Film Version" to position 1.
|
||||||
|
```console
|
||||||
|
./nyplaylists.exe playlist_tiny1.txt library.txt output.txt move "I Will Never Love Again - Film Version" 1
|
||||||
|
```
|
||||||
|
|
||||||
For all 3 commands, the output.txt contains the updated playlist. We have provided sample input & output files. Examples of using command line arguments can be found on the course webpage: [Programming Information](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/programming_information.php).
|
For all 3 commands, the output.txt contains the updated playlist. We have provided sample input & output files. Examples of using command line arguments can be found on the course webpage: [Programming Information](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/programming_information.php).
|
||||||
|
|
||||||
## Handling Music Tracks with the Same Title
|
## Handling Music Tracks with the Same Title
|
||||||
@@ -109,6 +126,8 @@ To deal with this problem, you need to remove double quotes from the arguments.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that the above double quote removal logic wouldn't do anything if the argument doesn't contain a double quote. This means including the double quote removal logic in your code should not affect how you run your program locally on your own computer.
|
||||||
|
|
||||||
## Submission Details
|
## Submission Details
|
||||||
|
|
||||||
Use good coding style when you design and implement your program. Organize your program into functions: don’t put all the code in main! Be sure to read the [Homework Policies](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/homework_policies.php) as you put the finishing touches on your solution. Be sure to make up new test cases to fully debug your program and don’t forget to comment your code! Complete the provided template [README.txt](./README.txt). You must do this assignment on your own, as described in the [Collaboration Policy & Academic Integrity](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/academic_integrity.php) page. If you did discuss the problem or error messages, etc. with anyone, please list their names in your README.txt file. Prepare and submit your assignment as instructed on the course webpage. Please ask a TA if you need help preparing your assignment for submission.
|
Use good coding style when you design and implement your program. Organize your program into functions: don’t put all the code in main! Be sure to read the [Homework Policies](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/homework_policies.php) as you put the finishing touches on your solution. Be sure to make up new test cases to fully debug your program and don’t forget to comment your code! Complete the provided template [README.txt](./README.txt). You must do this assignment on your own, as described in the [Collaboration Policy & Academic Integrity](https://www.cs.rpi.edu/academics/courses/spring24/csci1200/academic_integrity.php) page. If you did discuss the problem or error messages, etc. with anyone, please list their names in your README.txt file. Prepare and submit your assignment as instructed on the course webpage. Please ask a TA if you need help preparing your assignment for submission.
|
||||||
|
|||||||
Reference in New Issue
Block a user