public class ScriptPrinter
extends java.lang.Object
The provided code is incomplete. Modify it so that it works properly and passes the unit tests in
ScriptPrinterTest.java
.
Constructor and Description |
---|
ScriptPrinter() |
Modifier and Type | Method and 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 exceprt
from Rent (Rent-Excerpt.txt).
|
static void |
printLinesFor(java.lang.String actress,
java.lang.String script)
Prints lines from a script for a given actress (or actor).
|
public static void printLinesFor(java.lang.String actress, java.lang.String script)
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:
(He turns the camera to ROGER)
Complete the Javadoc comment and write this function.
actress
- the actress to print lines forscript
- the multi-line stript to search throughpublic static void main(java.lang.String[] unused) throws java.io.FileNotFoundException
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 argumentsjava.io.FileNotFoundException
- exception if the text file cannot be located