public class PrintLines
extends java.lang.Object
The provided code is incomplete. Modify it so that it works properly and passes the unit tests in
PrintLinesTest.java
.
Constructor | Description |
---|---|
PrintLines() |
Modifier and Type | Method | Description |
---|---|---|
static void |
main(java.lang.String[] unused) |
Solicits a single name from the user at the command line and searches for it in an excerpt
from Rent (Rent-Excerpt.txt).
|
static void |
printLinesFor(java.lang.String actress,
java.lang.String[] scriptLines) |
Prints lines from a script for a given actress (or actor).
|
public static void printLinesFor(java.lang.String actress, java.lang.String[] scriptLines)
Given a script formatted like "Rent-Excerpt.txt" and "Rent.txt", print all lines for a given actress in the following format. For example, if the search term is "Roger" or "roger":
ROGER --- This won't tune. --- Are you talking to me? --- I'm writing one great song -- ---
Etc. Here are the guidelines:
Complete the Javadoc comment and write this function.
actress
- the actress to print lines forscriptLines
- the array of script lines to search throughpublic static void main(java.lang.String[] unused)
You are free to review this function, but should not modify it. Note that this function is not tested by the test suite, as it is purely to aid your own interactive testing.
unused
- unused input arguments