COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods for "title", "author name", and "year published" Create a BookStore class that contains an instance variable for the BookStore's name (e.g. "Books-R- Us"). The BookStore constructor will not accept a name of "Amazon" (in any letter casing), however; if the name is "Amazon", change it to Chapters" instead. The BookStore contains a second instance variable that is an ArrayList of 109 Novel references. Due the night before next class Create a Lab3 class which implements the main(...) method and populates the BookStore ArrayList using the following code: store.addNovel(new Novel("The Adventures of Augie March", "Saul Bellow", 1953)); store.addNovel(new Novel("All the Kings Men", "Robert Penn Warren", 1946)); store.addNovel(new Novel("American Pastoral", "Philip Roth", 1997)); store.addNovel(new Novel("An American Tragedy", "Theodore Dreiser", 1925)); store.addNovel(new Novel("Animal Farm", "George Orwell", 1946)); store.addNovel(new Novel("Appointment in Samarra", "John O'Hara", 1934)); store.addNovel(new Novel(null, null, 1)); store.addNovel(new Novel(null, "author name 1", 2)); store.addNovel(new Novel("", null, 3)); store.addNovel(new Novel(null, ", 4)); store.addNovel(new Novel("title 1", null, 5)); store.addNovel(new Novel("", ""', 6)); store.addNovel(new Novel("", "author name 2", 7)); store.addNovel(new Novel("title", 9 8)); store.addNovel(new Novel("Are You There God? It's Me, Margaret.", "Judy Blume", 1970)); store.addNovel(new Novel("The Assistant", "Bernard Malamud", 1957)); store.addNovel(new Novel("At Swim-Two-Birds", "Flann O'Brien", 1938)); store.addNovel(new Novel("Atonement", "Ian McEwan", 2002)); store.addNovel(new Novel("Beloved", "Toni Morrison", 1987)); store.addNovel(new Novel("The Berlin Stories", "Christopher Isherwood", 1946)); store.addNovel(new Novel("The Big Sleep", "Raymond Chandler", 1939)); store.addNovel(new Novel("The Blind Assassin", "Margaret Atwood", 2000)); store.addNovel(new Novel("Blood Meridian", "Cormac McCarthy", 1986)); 11 store.addNovel(new Novel("Brideshead Revisited", "Evelyn Waugh", 1946)); store.addNovel(new Novel("The Bridge of San Luis Rey", "Thornton Wilder", 1927)); store.addNovel(new Novel("Call It Sleep", "Henry Roth", 1935)); store.addNovel(new Novel("Catch-22", "Joseph Heller", 1961)); store.addNovel(new Novel("The Catcher in the Rye", "J.D. Salinger", 1951)); store.addNovel(new Novel("A Clockwork Orange", "Anthony Burgess", 1963)); store.addNovel(new Novel("The Confessions of Nat Turner", "William Styron", 1967)); store.addNovel(new Novel("The Corrections", "Jonathan Franzen", 2001)); store.addNovel(new Novel("The Crying of Lot 49", "Thomas Pynchon", 1966)); store.addNovel(new Novel("A Dance to the Music of Time", "Anthony Powell", 1951)); store.addNovel(new Novel("The Day of the Locust", "Nathanael West", 1939)); store.addNovel(new Novel("Death Comes for the Archbishop", "Willa Cather", 1927)); store.addNovel(new Novel("A Death in the Family", "James Agee", 1958)); store.addNovel(new Novel("The Death of the Heart", "Elizabeth Bowen", 1958)); COMP2501 1 Lab 3 } Due the night before next class store.addNovel(new Novel("Deliverance", "James Dickey", 1970)); store.addNovel(new Novel("Dog Soldiers", "Robert Stone", 1974)); store.addNovel(new Novel("Falconer", "John Cheever", 1977)); store.addNovel(new Novel("The French Lieutenant's Woman", "John Fowles", 1969)); store.addNovel(new Novel("The Golden Notebook", "Doris Lessing", 1962)); store.addNovel(new Novel("Go Tell It on the Mountain", "James Baldwin", 1953)); store.addNovel(new Novel("Gone with the Wind", "Margaret Mitchell", 1936)); store.addNovel(new Novel("The Grapes of Wrath", "John Steinbeck", 1939)); store.addNovel(new Novel("Gravity's Rainbow", "Thomas Pynchon", 1973)); store.addNovel(new Novel("The Great Gatsby", "F. Scott Fitzgerald", 1925)); store.addNovel(new Novel("A Handful of Dust", "Evelyn Waugh", 1934)); store.addNovel(new Novel("The Heart Is a Lonely Hunter", "Carson McCullers", 1940)); store.addNovel(new Novel("The Heart of the Matter", "Graham Greene", 1948)); store.addNovel(new Novel("Herzog", "Saul Bellow", 1964)); store.addNovel(new Novel("Housekeeping", "Marilynne Robinson", 1981)); store.addNovel(new Novel("A House for Mr. Biswas", "V.S. Naipaul", 1962)); store.addNovel(new Novel("I, Claudius", "Robert Graves", 1934)); store.addNovel(new Novel("Infinite Jest", "David Foster Wallace", 1996)); store.addNovel(new Novel("Invisible Man", "Ralph Ellison", 1952)); store.addNovel(new Novel("Light in August", "William Faulkner", 1932)); store.addNovel(new Novel("The Lion, The Witch and the Wardrobe", "C.S. Lewis", 1950)); store.addNovel(new Novel("Lolita", "Vladimir Nabokov", 1955)); store.addNovel(new Novel("Lord of the Flies", "William Golding", 1954)); store.addNovel(new Novel("The Lord of the Rings", "J.R.R. Tolkien", 1954)); store.addNovel(new Novel("Loving", "Henry Green", 1945)); store.addNovel(new Novel("Lucky Jim", "Kingsley Amis", 1954)); store.addNovel(new Novel("The Man Who Loved Children", "Christina Stead", 1940)); store.addNovel(new Novel("Midnight's Children", "Salman Rushdie", 1981)); store.addNovel(new Novel("Money", "Martin Amis", 1984)); store.addNovel(new Novel("The Moviegoer", "Walker Percy", 1961)); store.addNovel(new Novel("Mrs. Dalloway", "Virginia Woolf", 1925)); store.addNovel(new Novel("Naked Lunch", "William Burroughs", 1959)); store.addNovel(new Novel("Native Son", "Richard Wright", 1940)); store.addNovel(new Novel("Neuromancer", "William Gibson", 1984)); store.addNovel(new Novel("Never Let Me Go", "Kazuo Ishiguro", 2005)); store.addNovel(new Novel("1984", "George Orwell", 1948)); store.addNovel(new Novel("On the Road", "Jack Kerouac", 1957)); store.addNovel(new Novel("One Flew Over the Cuckoo's Nest", "Ken Kesey", 1962)); store.addNovel(new Novel("The Painted Bird", "Jerzy Kosinski", 1965)); store.addNovel(new Novel("Pale Fire", "Vladimir Nabokov", 1962)); store.addNovel(new Novel("A Passage to India", "E.M. Forster", 1924)); store.addNovel(new Novel("Play It as It Lays", "Joan Didion", 1970)); store.addNovel(new Novel("Portnoy's Complaint", "Philip Roth", 1969)); store.addNovel(new Novel("Possession", "A.S. Byatt", 1990)); store.addNovel(new Novel("The Power and the Glory", "Graham Greene", 1939)); store.addNovel(new Novel("The Prime of Miss Jean Brodie", "Muriel Spark", 1961)); store.addNovel(new Novel("Rabbit, Run", "John Updike", 1960)); store.addNovel(new Novel("Ragtime", "E.L. Doctorow", 1975)); { 2 COMP2501 Lab 3 store.addNovel(new Novel("The Recognitions", "William Gaddis", 1955)); store.addNovel(new Novel("Red Harvest", "Dashiell Hammett", 1929)); store.addNovel(new Novel("Revolutionary Road", "Richard Yates", 1961)); store.addNovel(new Novel("The Sheltering Sky", "Paul Bowles", 1949)); store.addNovel(new Novel("Slaughterhouse-Five", "Kurt Vonnegut", 1969)); store.addNovel(new Novel("Snow Crash", "Neal Stephenson", 1992)); store.addNovel(new Novel("The Sot-Weed Factor", "John Barth", 1960)); store.addNovel(new Novel("The Sound and the Fury", "William Faulkner", 1929)); store.addNovel(new Novel("The Sportswriter", "Richard Ford", 1986)); store.addNovel(new Novel("The Spy Who Came in from the Cold", "John le Carre", 1964)); store.addNovel(new Novel("The Sun Also Rises", "Ernest Hemingway", 1926)); store.addNovel(new Novel("Their Eyes Were Watching God", "Zora Neale Hurston", 1937)); store.addNovel(new Novel("Things Fall Apart", "Chinua Achebe", 1959)); store.addNovel(new Novel("To Kill a Mockingbird", "Harper Lee", 1960)); store.addNovel(new Novel("To the Lighthouse", "Virginia Woolf", 1929)); store.addNovel(new Novel("Tropic of Cancer", "Henry Miller", 1934)); store.addNovel(new Novel("Ubik", "Philip K. Dick", 1969)); store.addNovel(new Novel("Under the Net", "Iris Murdoch", 1954)); store.addNovel(new Novel("Under the Volcano", "Malcolm Lowry", 1947)); store.addNovel(new Novel("Watchmen", "Alan Moore and Dave Gibbons", 1986)); store.addNovel(new Novel("White Noise", "Don DeLillo", 1985)); store.addNovel(new Novel("White Teeth", "Zadie Smith", 2000)); store.addNovel(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); Due the night before next class The main method also a commandline arguments, which will be the name of the BookStore; store the commandline argument as the name of the BookStore (unless it is "Amazon"...see above). Here is a snapshot of some of the code: print All Titles Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name none Parameters Resulting behavior Prints all titles in UPPERCASE Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name printAll Titles print TitlesContaining print TitlesOfLength COMP2501 printNameStartsEndsWith getLongest Parameters none String substring boolean caseSensitive int length (2) Lab 3 String substring String property Resulting behavior Prints all titles in UPPERCASE Prints all titles that contain the specified substring; if caseSensitive is false, then the match is in any letter casing (e.g. "The" is the same as "the"); if caseSensitive is true then the match must include letter casing (e.g. "The" is different than "the") Prints all titles that are of exactly the specified length Due the night before next class Prints all author names that either start or end with substring, in lowercase...the substring match is case insensitive (e.g. "aN" is the same as "An", etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loon) if the property getLongest main String property printAllTitles String[] args Sample correct output when the BookStore's methods are called from Lab3.main(...): BookStore method name AN AMERICAN TRAGEDY ANIMAL FARM Same as Al etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loop); if the property argument is "title" (in any letter casing) then return the longest title (by finding it using a foreach loop); if the property argument is something else then return null ATONEMENT BELOVED THE ADVENTURES OF AUGIE MARCH ALL THE KING'S MEN AMERICAN PASTORAL THE BERLIN STORIES THE BIG SLEEP THE BLIND ASSASSIN BLOOD MERIDIAN Creates BookStore object and passes args[0] to BookStore constructor as its name property Calls all of the BookStore methods listed above, in this table APPOINTMENT IN SAMARRA TITLE 1 TITLE ARE YOU THERE GOD? IT'S ME, MARGARET. THE ASSISTANT AT SWIM-TWO-BIRDS BRIDESHEAD REVISITED THE BRIDGE OF SAN LUIS REY CALL IT SLEEP CATCH-22 Expected Output 9 THE CATCHER IN THE RYE A CLOCKWORK ORANGE THE CONFESSIONS OF NAT TURNER THE CORRECTIONS THE CRYING OF LOT 49 A DANCE TO THE MUSIC OF TIME b.printAllTitlesContaining("the", false); COMP2501 Lab 3 THE POWER AND THE GLORY THE PRIME OF MISS JEAN BRODIE RABBIT, RUN RAGTIME THE RECOGNITIONS RED HARVEST REVOLUTIONARY ROAD THE SHELTERING SKY SLAUGHTERHOUSE-FIVE SNOW CRASH THE SOT-WEED FACTOR THE SOUND AND THE FURY THE SPORTSWRITER THE SPY WHO CAME IN FROM THE COLD THE SUN ALSO RISES THEIR EYES WERE WATCHING GOD THINGS FALL APART TO KILL A MOCKINGBIRD TO THE LIGHTHOUSE TROPIC OF CANCER UBIK UNDER THE NET UNDER THE VOLCANO WATCHMEN WHITE NOISE WHITE TEETH WIDE SARGASSO SEA The Adventures of Augie March All the King's Men Are You There God? It's Me, Margaret. The Assistant The Berlin Stories The Big Sleep The Blind Assassin The Bridge of San Luis Rey The Catcher in the Rye The Confessions of Nat Turner The Corrections The Crying of Lot 49 A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart The French Lieutenant's Woman The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath Due the night before next class COMP2501 b.printAllTitlesContaining("the", true); b.printAllTitles (13); printNameStartsEndsWith("aN") System.out.println(b.getLongest("xyz")); System.out.println(b.getLongest("AutHor")); System.out.println(b.getLongest("titlE")); Lab 3 The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath The Great Gatsby The Heart Is a Lonely Hunter The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings The Man Who Loved Children The Moviegoer On the Road One Flew Over the Cuckoo's Nest The Painted Bird The Power and the Glory The Prime of Miss Jean Brodie The Recognitions The Sheltering Sky The Sot-Weed Factor The Sound and the Fury The Sportswriter The Spy Who Came in from the Cold The Sun Also Rises Their Eyes Were Watching God To the Lighthouse Under the Net Under the Volcano All the King's Men The Catcher in the Rye A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart Due the night before next class Go Tell It on the Mountain Gone with the Wind The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings On the Road One Flew Over the Cuckoo's Nest The Power and the Glory The Sound and the Fury The Spy Who Came in from the Cold To the Lighthouse Under the Net Under the Volcano The Assistant The Big Sleep Call It Sleep Infinite Jest Invisible Man The Moviegoer Mrs. Dalloway Under the Net ianmcewan anthony burgess anthonypowell null Alan Moore and Dave Gibbons Are You There God? It's Me, Margaret. Work on this lab with a new partner: someone with whom you have not yet worked. Write the code for the lab below and each partner must upload the zipped src folder to the learning hub (learn.bcit.ca Activities Assignments Lab4) before the start of lesson 5. Include your full name and your partner's full name at the top of each file, using a Java Javadoc /** @author */ tag (for example: /** @author Bullwinkle Moose */). Re-do lab 3 but this time the following methods must throw the following Exceptions given the following conditions: Make sure your methods declare the Exceptions they throw (and Javadoc @throws too). For example: /** * @param parameter - some parameter @throws IllegalArgumentException if parameter is bigger than 100, or is null */ public void pretendMethod (String parameter) throws IllegalArgumentException { } // code goes here printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printNameStartsEndsWith(String substring) Must throw a checked Exception (YOU create the class) named IllegalNameException with the message "bad name" if the substring parameter is null or blank COMP2501 try { } { // code to try 1 printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message bad string") if the substring parameter is blank or null catch(Exception TypeOne e) Lab 4 NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: } Due before next class 2 of 2 COMP2501 try { } printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message "bad string") if the substring parameter is blank or null NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: catch(ExceptionTypeOne e) { } // code to try { catch(ExceptionTypeTwo e) } Etc... // handle exception type one here Automatic Zoom Lab 4 // handle exception type two here View as lext Download Due before next class getLongest(String property) Must throw an unchecked Exception (YOU create the class) named Illegal Novel PropertyException with the message "bad property" if its value is not "author" nor "title" (in any letter casing) main(String[] args) Must try/catch all of its methods now; in the event of an Exception being thrown, simply print the Exception object's getMessage() method output. COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods for "title", "author name", and "year published" Create a BookStore class that contains an instance variable for the BookStore's name (e.g. "Books-R- Us"). The BookStore constructor will not accept a name of "Amazon" (in any letter casing), however; if the name is "Amazon", change it to Chapters" instead. The BookStore contains a second instance variable that is an ArrayList of 109 Novel references. Due the night before next class Create a Lab3 class which implements the main(...) method and populates the BookStore ArrayList using the following code: store.addNovel(new Novel("The Adventures of Augie March", "Saul Bellow", 1953)); store.addNovel(new Novel("All the Kings Men", "Robert Penn Warren", 1946)); store.addNovel(new Novel("American Pastoral", "Philip Roth", 1997)); store.addNovel(new Novel("An American Tragedy", "Theodore Dreiser", 1925)); store.addNovel(new Novel("Animal Farm", "George Orwell", 1946)); store.addNovel(new Novel("Appointment in Samarra", "John O'Hara", 1934)); store.addNovel(new Novel(null, null, 1)); store.addNovel(new Novel(null, "author name 1", 2)); store.addNovel(new Novel("", null, 3)); store.addNovel(new Novel(null, ", 4)); store.addNovel(new Novel("title 1", null, 5)); store.addNovel(new Novel("", ""', 6)); store.addNovel(new Novel("", "author name 2", 7)); store.addNovel(new Novel("title", 9 8)); store.addNovel(new Novel("Are You There God? It's Me, Margaret.", "Judy Blume", 1970)); store.addNovel(new Novel("The Assistant", "Bernard Malamud", 1957)); store.addNovel(new Novel("At Swim-Two-Birds", "Flann O'Brien", 1938)); store.addNovel(new Novel("Atonement", "Ian McEwan", 2002)); store.addNovel(new Novel("Beloved", "Toni Morrison", 1987)); store.addNovel(new Novel("The Berlin Stories", "Christopher Isherwood", 1946)); store.addNovel(new Novel("The Big Sleep", "Raymond Chandler", 1939)); store.addNovel(new Novel("The Blind Assassin", "Margaret Atwood", 2000)); store.addNovel(new Novel("Blood Meridian", "Cormac McCarthy", 1986)); 11 store.addNovel(new Novel("Brideshead Revisited", "Evelyn Waugh", 1946)); store.addNovel(new Novel("The Bridge of San Luis Rey", "Thornton Wilder", 1927)); COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods for "title", "author name", and "year published" Create a BookStore class that contains an instance variable for the BookStore's name (e.g. "Books-R- Us"). The BookStore constructor will not accept a name of "Amazon" (in any letter casing), however; if the name is "Amazon", change it to Chapters" instead. The BookStore contains a second instance variable that is an ArrayList of 109 Novel references. Due the night before next class Create a Lab3 class which implements the main(...) method and populates the BookStore ArrayList using the following code: store.addNovel(new Novel("The Adventures of Augie March", "Saul Bellow", 1953)); store.addNovel(new Novel("All the Kings Men", "Robert Penn Warren", 1946)); store.addNovel(new Novel("American Pastoral", "Philip Roth", 1997)); store.addNovel(new Novel("An American Tragedy", "Theodore Dreiser", 1925)); store.addNovel(new Novel("Animal Farm", "George Orwell", 1946)); store.addNovel(new Novel("Appointment in Samarra", "John O'Hara", 1934)); store.addNovel(new Novel(null, null, 1)); store.addNovel(new Novel(null, "author name 1", 2)); store.addNovel(new Novel("", null, 3)); store.addNovel(new Novel(null, ", 4)); store.addNovel(new Novel("title 1", null, 5)); store.addNovel(new Novel("", ""', 6)); store.addNovel(new Novel("", "author name 2", 7)); store.addNovel(new Novel("title", 9 8)); store.addNovel(new Novel("Are You There God? It's Me, Margaret.", "Judy Blume", 1970)); store.addNovel(new Novel("The Assistant", "Bernard Malamud", 1957)); store.addNovel(new Novel("At Swim-Two-Birds", "Flann O'Brien", 1938)); store.addNovel(new Novel("Atonement", "Ian McEwan", 2002)); store.addNovel(new Novel("Beloved", "Toni Morrison", 1987)); store.addNovel(new Novel("The Berlin Stories", "Christopher Isherwood", 1946)); store.addNovel(new Novel("The Big Sleep", "Raymond Chandler", 1939)); store.addNovel(new Novel("The Blind Assassin", "Margaret Atwood", 2000)); store.addNovel(new Novel("Blood Meridian", "Cormac McCarthy", 1986)); 11 store.addNovel(new Novel("Brideshead Revisited", "Evelyn Waugh", 1946)); store.addNovel(new Novel("The Bridge of San Luis Rey", "Thornton Wilder", 1927)); COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods for "title", "author name", and "year published" Create a BookStore class that contains an instance variable for the BookStore's name (e.g. "Books-R- Us"). The BookStore constructor will not accept a name of "Amazon" (in any letter casing), however; if the name is "Amazon", change it to Chapters" instead. The BookStore contains a second instance variable that is an ArrayList of 109 Novel references. Due the night before next class Create a Lab3 class which implements the main(...) method and populates the BookStore ArrayList using the following code: store.addNovel(new Novel("The Adventures of Augie March", "Saul Bellow", 1953)); store.addNovel(new Novel("All the Kings Men", "Robert Penn Warren", 1946)); store.addNovel(new Novel("American Pastoral", "Philip Roth", 1997)); store.addNovel(new Novel("An American Tragedy", "Theodore Dreiser", 1925)); store.addNovel(new Novel("Animal Farm", "George Orwell", 1946)); store.addNovel(new Novel("Appointment in Samarra", "John O'Hara", 1934)); store.addNovel(new Novel(null, null, 1)); store.addNovel(new Novel(null, "author name 1", 2)); store.addNovel(new Novel("", null, 3)); store.addNovel(new Novel(null, ", 4)); store.addNovel(new Novel("title 1", null, 5)); store.addNovel(new Novel("", ""', 6)); store.addNovel(new Novel("", "author name 2", 7)); store.addNovel(new Novel("title", 9 8)); store.addNovel(new Novel("Are You There God? It's Me, Margaret.", "Judy Blume", 1970)); store.addNovel(new Novel("The Assistant", "Bernard Malamud", 1957)); store.addNovel(new Novel("At Swim-Two-Birds", "Flann O'Brien", 1938)); store.addNovel(new Novel("Atonement", "Ian McEwan", 2002)); store.addNovel(new Novel("Beloved", "Toni Morrison", 1987)); store.addNovel(new Novel("The Berlin Stories", "Christopher Isherwood", 1946)); store.addNovel(new Novel("The Big Sleep", "Raymond Chandler", 1939)); store.addNovel(new Novel("The Blind Assassin", "Margaret Atwood", 2000)); store.addNovel(new Novel("Blood Meridian", "Cormac McCarthy", 1986)); 11 store.addNovel(new Novel("Brideshead Revisited", "Evelyn Waugh", 1946)); store.addNovel(new Novel("The Bridge of San Luis Rey", "Thornton Wilder", 1927)); COMP2501 Lab 3 Create a Novel class with private instance variables, constructor parameters, and accessor methods for "title", "author name", and "year published" Create a BookStore class that contains an instance variable for the BookStore's name (e.g. "Books-R- Us"). The BookStore constructor will not accept a name of "Amazon" (in any letter casing), however; if the name is "Amazon", change it to Chapters" instead. The BookStore contains a second instance variable that is an ArrayList of 109 Novel references. Due the night before next class Create a Lab3 class which implements the main(...) method and populates the BookStore ArrayList using the following code: store.addNovel(new Novel("The Adventures of Augie March", "Saul Bellow", 1953)); store.addNovel(new Novel("All the Kings Men", "Robert Penn Warren", 1946)); store.addNovel(new Novel("American Pastoral", "Philip Roth", 1997)); store.addNovel(new Novel("An American Tragedy", "Theodore Dreiser", 1925)); store.addNovel(new Novel("Animal Farm", "George Orwell", 1946)); store.addNovel(new Novel("Appointment in Samarra", "John O'Hara", 1934)); store.addNovel(new Novel(null, null, 1)); store.addNovel(new Novel(null, "author name 1", 2)); store.addNovel(new Novel("", null, 3)); store.addNovel(new Novel(null, ", 4)); store.addNovel(new Novel("title 1", null, 5)); store.addNovel(new Novel("", ""', 6)); store.addNovel(new Novel("", "author name 2", 7)); store.addNovel(new Novel("title", 9 8)); store.addNovel(new Novel("Are You There God? It's Me, Margaret.", "Judy Blume", 1970)); store.addNovel(new Novel("The Assistant", "Bernard Malamud", 1957)); store.addNovel(new Novel("At Swim-Two-Birds", "Flann O'Brien", 1938)); store.addNovel(new Novel("Atonement", "Ian McEwan", 2002)); store.addNovel(new Novel("Beloved", "Toni Morrison", 1987)); store.addNovel(new Novel("The Berlin Stories", "Christopher Isherwood", 1946)); store.addNovel(new Novel("The Big Sleep", "Raymond Chandler", 1939)); store.addNovel(new Novel("The Blind Assassin", "Margaret Atwood", 2000)); store.addNovel(new Novel("Blood Meridian", "Cormac McCarthy", 1986)); 11 store.addNovel(new Novel("Brideshead Revisited", "Evelyn Waugh", 1946)); store.addNovel(new Novel("The Bridge of San Luis Rey", "Thornton Wilder", 1927)); store.addNovel(new Novel("Call It Sleep", "Henry Roth", 1935)); store.addNovel(new Novel("Catch-22", "Joseph Heller", 1961)); store.addNovel(new Novel("The Catcher in the Rye", "J.D. Salinger", 1951)); store.addNovel(new Novel("A Clockwork Orange", "Anthony Burgess", 1963)); store.addNovel(new Novel("The Confessions of Nat Turner", "William Styron", 1967)); store.addNovel(new Novel("The Corrections", "Jonathan Franzen", 2001)); store.addNovel(new Novel("The Crying of Lot 49", "Thomas Pynchon", 1966)); store.addNovel(new Novel("A Dance to the Music of Time", "Anthony Powell", 1951)); store.addNovel(new Novel("The Day of the Locust", "Nathanael West", 1939)); store.addNovel(new Novel("Death Comes for the Archbishop", "Willa Cather", 1927)); store.addNovel(new Novel("A Death in the Family", "James Agee", 1958)); store.addNovel(new Novel("The Death of the Heart", "Elizabeth Bowen", 1958)); COMP2501 1 Lab 3 } Due the night before next class store.addNovel(new Novel("Deliverance", "James Dickey", 1970)); store.addNovel(new Novel("Dog Soldiers", "Robert Stone", 1974)); store.addNovel(new Novel("Falconer", "John Cheever", 1977)); store.addNovel(new Novel("The French Lieutenant's Woman", "John Fowles", 1969)); store.addNovel(new Novel("The Golden Notebook", "Doris Lessing", 1962)); store.addNovel(new Novel("Go Tell It on the Mountain", "James Baldwin", 1953)); store.addNovel(new Novel("Gone with the Wind", "Margaret Mitchell", 1936)); store.addNovel(new Novel("The Grapes of Wrath", "John Steinbeck", 1939)); store.addNovel(new Novel("Gravity's Rainbow", "Thomas Pynchon", 1973)); store.addNovel(new Novel("The Great Gatsby", "F. Scott Fitzgerald", 1925)); store.addNovel(new Novel("A Handful of Dust", "Evelyn Waugh", 1934)); store.addNovel(new Novel("The Heart Is a Lonely Hunter", "Carson McCullers", 1940)); store.addNovel(new Novel("The Heart of the Matter", "Graham Greene", 1948)); store.addNovel(new Novel("Herzog", "Saul Bellow", 1964)); store.addNovel(new Novel("Housekeeping", "Marilynne Robinson", 1981)); store.addNovel(new Novel("Call It Sleep", "Henry Roth", 1935)); store.addNovel(new Novel("Catch-22", "Joseph Heller", 1961)); store.addNovel(new Novel("The Catcher in the Rye", "J.D. Salinger", 1951)); store.addNovel(new Novel("A Clockwork Orange", "Anthony Burgess", 1963)); store.addNovel(new Novel("The Confessions of Nat Turner", "William Styron", 1967)); store.addNovel(new Novel("The Corrections", "Jonathan Franzen", 2001)); store.addNovel(new Novel("The Crying of Lot 49", "Thomas Pynchon", 1966)); store.addNovel(new Novel("A Dance to the Music of Time", "Anthony Powell", 1951)); store.addNovel(new Novel("The Day of the Locust", "Nathanael West", 1939)); store.addNovel(new Novel("Death Comes for the Archbishop", "Willa Cather", 1927)); store.addNovel(new Novel("A Death in the Family", "James Agee", 1958)); store.addNovel(new Novel("The Death of the Heart", "Elizabeth Bowen", 1958)); COMP2501 1 Lab 3 } Due the night before next class store.addNovel(new Novel("Deliverance", "James Dickey", 1970)); store.addNovel(new Novel("Dog Soldiers", "Robert Stone", 1974)); store.addNovel(new Novel("Falconer", "John Cheever", 1977)); store.addNovel(new Novel("The French Lieutenant's Woman", "John Fowles", 1969)); store.addNovel(new Novel("The Golden Notebook", "Doris Lessing", 1962)); store.addNovel(new Novel("Go Tell It on the Mountain", "James Baldwin", 1953)); store.addNovel(new Novel("Gone with the Wind", "Margaret Mitchell", 1936)); store.addNovel(new Novel("The Grapes of Wrath", "John Steinbeck", 1939)); store.addNovel(new Novel("Gravity's Rainbow", "Thomas Pynchon", 1973)); store.addNovel(new Novel("The Great Gatsby", "F. Scott Fitzgerald", 1925)); store.addNovel(new Novel("A Handful of Dust", "Evelyn Waugh", 1934)); store.addNovel(new Novel("The Heart Is a Lonely Hunter", "Carson McCullers", 1940)); store.addNovel(new Novel("The Heart of the Matter", "Graham Greene", 1948)); store.addNovel(new Novel("Herzog", "Saul Bellow", 1964)); store.addNovel(new Novel("Housekeeping", "Marilynne Robinson", 1981)); store.addNovel(new Novel("Call It Sleep", "Henry Roth", 1935)); store.addNovel(new Novel("Catch-22", "Joseph Heller", 1961)); store.addNovel(new Novel("The Catcher in the Rye", "J.D. Salinger", 1951)); store.addNovel(new Novel("A Clockwork Orange", "Anthony Burgess", 1963)); store.addNovel(new Novel("The Confessions of Nat Turner", "William Styron", 1967)); store.addNovel(new Novel("The Corrections", "Jonathan Franzen", 2001)); store.addNovel(new Novel("The Crying of Lot 49", "Thomas Pynchon", 1966)); store.addNovel(new Novel("A Dance to the Music of Time", "Anthony Powell", 1951)); store.addNovel(new Novel("The Day of the Locust", "Nathanael West", 1939)); store.addNovel(new Novel("Death Comes for the Archbishop", "Willa Cather", 1927)); store.addNovel(new Novel("A Death in the Family", "James Agee", 1958)); store.addNovel(new Novel("The Death of the Heart", "Elizabeth Bowen", 1958)); COMP2501 1 Lab 3 } Due the night before next class store.addNovel(new Novel("Deliverance", "James Dickey", 1970)); store.addNovel(new Novel("Dog Soldiers", "Robert Stone", 1974)); store.addNovel(new Novel("Falconer", "John Cheever", 1977)); store.addNovel(new Novel("The French Lieutenant's Woman", "John Fowles", 1969)); store.addNovel(new Novel("The Golden Notebook", "Doris Lessing", 1962)); store.addNovel(new Novel("Go Tell It on the Mountain", "James Baldwin", 1953)); store.addNovel(new Novel("Gone with the Wind", "Margaret Mitchell", 1936)); store.addNovel(new Novel("The Grapes of Wrath", "John Steinbeck", 1939)); store.addNovel(new Novel("Gravity's Rainbow", "Thomas Pynchon", 1973)); store.addNovel(new Novel("The Great Gatsby", "F. Scott Fitzgerald", 1925)); store.addNovel(new Novel("A Handful of Dust", "Evelyn Waugh", 1934)); store.addNovel(new Novel("The Heart Is a Lonely Hunter", "Carson McCullers", 1940)); store.addNovel(new Novel("The Heart of the Matter", "Graham Greene", 1948)); store.addNovel(new Novel("Herzog", "Saul Bellow", 1964)); store.addNovel(new Novel("Housekeeping", "Marilynne Robinson", 1981)); store.addNovel(new Novel("Call It Sleep", "Henry Roth", 1935)); store.addNovel(new Novel("Catch-22", "Joseph Heller", 1961)); store.addNovel(new Novel("The Catcher in the Rye", "J.D. Salinger", 1951)); store.addNovel(new Novel("A Clockwork Orange", "Anthony Burgess", 1963)); store.addNovel(new Novel("The Confessions of Nat Turner", "William Styron", 1967)); store.addNovel(new Novel("The Corrections", "Jonathan Franzen", 2001)); store.addNovel(new Novel("The Crying of Lot 49", "Thomas Pynchon", 1966)); store.addNovel(new Novel("A Dance to the Music of Time", "Anthony Powell", 1951)); store.addNovel(new Novel("The Day of the Locust", "Nathanael West", 1939)); store.addNovel(new Novel("Death Comes for the Archbishop", "Willa Cather", 1927)); store.addNovel(new Novel("A Death in the Family", "James Agee", 1958)); store.addNovel(new Novel("The Death of the Heart", "Elizabeth Bowen", 1958)); COMP2501 1 Lab 3 } Due the night before next class store.addNovel(new Novel("Deliverance", "James Dickey", 1970)); store.addNovel(new Novel("Dog Soldiers", "Robert Stone", 1974)); store.addNovel(new Novel("Falconer", "John Cheever", 1977)); store.addNovel(new Novel("The French Lieutenant's Woman", "John Fowles", 1969)); store.addNovel(new Novel("The Golden Notebook", "Doris Lessing", 1962)); store.addNovel(new Novel("Go Tell It on the Mountain", "James Baldwin", 1953)); store.addNovel(new Novel("Gone with the Wind", "Margaret Mitchell", 1936)); store.addNovel(new Novel("The Grapes of Wrath", "John Steinbeck", 1939)); store.addNovel(new Novel("Gravity's Rainbow", "Thomas Pynchon", 1973)); store.addNovel(new Novel("The Great Gatsby", "F. Scott Fitzgerald", 1925)); store.addNovel(new Novel("A Handful of Dust", "Evelyn Waugh", 1934)); store.addNovel(new Novel("The Heart Is a Lonely Hunter", "Carson McCullers", 1940)); store.addNovel(new Novel("The Heart of the Matter", "Graham Greene", 1948)); store.addNovel(new Novel("Herzog", "Saul Bellow", 1964)); store.addNovel(new Novel("Housekeeping", "Marilynne Robinson", 1981)); store.addNovel(new Novel("A House for Mr. Biswas", "V.S. Naipaul", 1962)); store.addNovel(new Novel("I, Claudius", "Robert Graves", 1934)); store.addNovel(new Novel("Infinite Jest", "David Foster Wallace", 1996)); store.addNovel(new Novel("Invisible Man", "Ralph Ellison", 1952)); store.addNovel(new Novel("Light in August", "William Faulkner", 1932)); store.addNovel(new Novel("The Lion, The Witch and the Wardrobe", "C.S. Lewis", 1950)); store.addNovel(new Novel("Lolita", "Vladimir Nabokov", 1955)); store.addNovel(new Novel("Lord of the Flies", "William Golding", 1954)); store.addNovel(new Novel("The Lord of the Rings", "J.R.R. Tolkien", 1954)); store.addNovel(new Novel("Loving", "Henry Green", 1945)); store.addNovel(new Novel("Lucky Jim", "Kingsley Amis", 1954)); store.addNovel(new Novel("The Man Who Loved Children", "Christina Stead", 1940)); store.addNovel(new Novel("Midnight's Children", "Salman Rushdie", 1981)); store.addNovel(new Novel("Money", "Martin Amis", 1984)); store.addNovel(new Novel("The Moviegoer", "Walker Percy", 1961)); store.addNovel(new Novel("Mrs. Dalloway", "Virginia Woolf", 1925)); store.addNovel(new Novel("Naked Lunch", "William Burroughs", 1959)); store.addNovel(new Novel("Native Son", "Richard Wright", 1940)); store.addNovel(new Novel("Neuromancer", "William Gibson", 1984)); store.addNovel(new Novel("Never Let Me Go", "Kazuo Ishiguro", 2005)); store.addNovel(new Novel("1984", "George Orwell", 1948)); store.addNovel(new Novel("On the Road", "Jack Kerouac", 1957)); store.addNovel(new Novel("One Flew Over the Cuckoo's Nest", "Ken Kesey", 1962)); store.addNovel(new Novel("The Painted Bird", "Jerzy Kosinski", 1965)); store.addNovel(new Novel("Pale Fire", "Vladimir Nabokov", 1962)); store.addNovel(new Novel("A Passage to India", "E.M. Forster", 1924)); store.addNovel(new Novel("Play It as It Lays", "Joan Didion", 1970)); store.addNovel(new Novel("Portnoy's Complaint", "Philip Roth", 1969)); store.addNovel(new Novel("Possession", "A.S. Byatt", 1990)); store.addNovel(new Novel("The Power and the Glory", "Graham Greene", 1939)); store.addNovel(new Novel("The Prime of Miss Jean Brodie", "Muriel Spark", 1961)); store.addNovel(new Novel("Rabbit, Run", "John Updike", 1960)); store.addNovel(new Novel("Ragtime", "E.L. Doctorow", 1975)); { 2 store.addNovel(new Novel("A House for Mr. Biswas", "V.S. Naipaul", 1962)); store.addNovel(new Novel("I, Claudius", "Robert Graves", 1934)); store.addNovel(new Novel("Infinite Jest", "David Foster Wallace", 1996)); store.addNovel(new Novel("Invisible Man", "Ralph Ellison", 1952)); store.addNovel(new Novel("Light in August", "William Faulkner", 1932)); store.addNovel(new Novel("The Lion, The Witch and the Wardrobe", "C.S. Lewis", 1950)); store.addNovel(new Novel("Lolita", "Vladimir Nabokov", 1955)); store.addNovel(new Novel("Lord of the Flies", "William Golding", 1954)); store.addNovel(new Novel("The Lord of the Rings", "J.R.R. Tolkien", 1954)); store.addNovel(new Novel("Loving", "Henry Green", 1945)); store.addNovel(new Novel("Lucky Jim", "Kingsley Amis", 1954)); store.addNovel(new Novel("The Man Who Loved Children", "Christina Stead", 1940)); store.addNovel(new Novel("Midnight's Children", "Salman Rushdie", 1981)); store.addNovel(new Novel("Money", "Martin Amis", 1984)); store.addNovel(new Novel("The Moviegoer", "Walker Percy", 1961)); store.addNovel(new Novel("Mrs. Dalloway", "Virginia Woolf", 1925)); store.addNovel(new Novel("Naked Lunch", "William Burroughs", 1959)); store.addNovel(new Novel("Native Son", "Richard Wright", 1940)); store.addNovel(new Novel("Neuromancer", "William Gibson", 1984)); store.addNovel(new Novel("Never Let Me Go", "Kazuo Ishiguro", 2005)); store.addNovel(new Novel("1984", "George Orwell", 1948)); store.addNovel(new Novel("On the Road", "Jack Kerouac", 1957)); store.addNovel(new Novel("One Flew Over the Cuckoo's Nest", "Ken Kesey", 1962)); store.addNovel(new Novel("The Painted Bird", "Jerzy Kosinski", 1965)); store.addNovel(new Novel("Pale Fire", "Vladimir Nabokov", 1962)); store.addNovel(new Novel("A Passage to India", "E.M. Forster", 1924)); store.addNovel(new Novel("Play It as It Lays", "Joan Didion", 1970)); store.addNovel(new Novel("Portnoy's Complaint", "Philip Roth", 1969)); store.addNovel(new Novel("Possession", "A.S. Byatt", 1990)); store.addNovel(new Novel("The Power and the Glory", "Graham Greene", 1939)); store.addNovel(new Novel("The Prime of Miss Jean Brodie", "Muriel Spark", 1961)); store.addNovel(new Novel("Rabbit, Run", "John Updike", 1960)); store.addNovel(new Novel("Ragtime", "E.L. Doctorow", 1975)); { 2 store.addNovel(new Novel("A House for Mr. Biswas", "V.S. Naipaul", 1962)); store.addNovel(new Novel("I, Claudius", "Robert Graves", 1934)); store.addNovel(new Novel("Infinite Jest", "David Foster Wallace", 1996)); store.addNovel(new Novel("Invisible Man", "Ralph Ellison", 1952)); store.addNovel(new Novel("Light in August", "William Faulkner", 1932)); store.addNovel(new Novel("The Lion, The Witch and the Wardrobe", "C.S. Lewis", 1950)); store.addNovel(new Novel("Lolita", "Vladimir Nabokov", 1955)); store.addNovel(new Novel("Lord of the Flies", "William Golding", 1954)); store.addNovel(new Novel("The Lord of the Rings", "J.R.R. Tolkien", 1954)); store.addNovel(new Novel("Loving", "Henry Green", 1945)); store.addNovel(new Novel("Lucky Jim", "Kingsley Amis", 1954)); store.addNovel(new Novel("The Man Who Loved Children", "Christina Stead", 1940)); store.addNovel(new Novel("Midnight's Children", "Salman Rushdie", 1981)); store.addNovel(new Novel("Money", "Martin Amis", 1984)); store.addNovel(new Novel("The Moviegoer", "Walker Percy", 1961)); store.addNovel(new Novel("Mrs. Dalloway", "Virginia Woolf", 1925)); store.addNovel(new Novel("Naked Lunch", "William Burroughs", 1959)); store.addNovel(new Novel("Native Son", "Richard Wright", 1940)); store.addNovel(new Novel("Neuromancer", "William Gibson", 1984)); store.addNovel(new Novel("Never Let Me Go", "Kazuo Ishiguro", 2005)); store.addNovel(new Novel("1984", "George Orwell", 1948)); store.addNovel(new Novel("On the Road", "Jack Kerouac", 1957)); store.addNovel(new Novel("One Flew Over the Cuckoo's Nest", "Ken Kesey", 1962)); store.addNovel(new Novel("The Painted Bird", "Jerzy Kosinski", 1965)); store.addNovel(new Novel("Pale Fire", "Vladimir Nabokov", 1962)); store.addNovel(new Novel("A Passage to India", "E.M. Forster", 1924)); store.addNovel(new Novel("Play It as It Lays", "Joan Didion", 1970)); store.addNovel(new Novel("Portnoy's Complaint", "Philip Roth", 1969)); store.addNovel(new Novel("Possession", "A.S. Byatt", 1990)); store.addNovel(new Novel("The Power and the Glory", "Graham Greene", 1939)); store.addNovel(new Novel("The Prime of Miss Jean Brodie", "Muriel Spark", 1961)); store.addNovel(new Novel("Rabbit, Run", "John Updike", 1960)); store.addNovel(new Novel("Ragtime", "E.L. Doctorow", 1975)); { 2 store.addNovel(new Novel("A House for Mr. Biswas", "V.S. Naipaul", 1962)); store.addNovel(new Novel("I, Claudius", "Robert Graves", 1934)); store.addNovel(new Novel("Infinite Jest", "David Foster Wallace", 1996)); store.addNovel(new Novel("Invisible Man", "Ralph Ellison", 1952)); store.addNovel(new Novel("Light in August", "William Faulkner", 1932)); store.addNovel(new Novel("The Lion, The Witch and the Wardrobe", "C.S. Lewis", 1950)); store.addNovel(new Novel("Lolita", "Vladimir Nabokov", 1955)); store.addNovel(new Novel("Lord of the Flies", "William Golding", 1954)); store.addNovel(new Novel("The Lord of the Rings", "J.R.R. Tolkien", 1954)); store.addNovel(new Novel("Loving", "Henry Green", 1945)); store.addNovel(new Novel("Lucky Jim", "Kingsley Amis", 1954)); store.addNovel(new Novel("The Man Who Loved Children", "Christina Stead", 1940)); store.addNovel(new Novel("Midnight's Children", "Salman Rushdie", 1981)); store.addNovel(new Novel("Money", "Martin Amis", 1984)); store.addNovel(new Novel("The Moviegoer", "Walker Percy", 1961)); store.addNovel(new Novel("Mrs. Dalloway", "Virginia Woolf", 1925)); store.addNovel(new Novel("Naked Lunch", "William Burroughs", 1959)); store.addNovel(new Novel("Native Son", "Richard Wright", 1940)); store.addNovel(new Novel("Neuromancer", "William Gibson", 1984)); store.addNovel(new Novel("Never Let Me Go", "Kazuo Ishiguro", 2005)); store.addNovel(new Novel("1984", "George Orwell", 1948)); store.addNovel(new Novel("On the Road", "Jack Kerouac", 1957)); store.addNovel(new Novel("One Flew Over the Cuckoo's Nest", "Ken Kesey", 1962)); store.addNovel(new Novel("The Painted Bird", "Jerzy Kosinski", 1965)); store.addNovel(new Novel("Pale Fire", "Vladimir Nabokov", 1962)); store.addNovel(new Novel("A Passage to India", "E.M. Forster", 1924)); store.addNovel(new Novel("Play It as It Lays", "Joan Didion", 1970)); store.addNovel(new Novel("Portnoy's Complaint", "Philip Roth", 1969)); store.addNovel(new Novel("Possession", "A.S. Byatt", 1990)); store.addNovel(new Novel("The Power and the Glory", "Graham Greene", 1939)); store.addNovel(new Novel("The Prime of Miss Jean Brodie", "Muriel Spark", 1961)); store.addNovel(new Novel("Rabbit, Run", "John Updike", 1960)); store.addNovel(new Novel("Ragtime", "E.L. Doctorow", 1975)); { 2 COMP2501 Lab 3 store.addNovel(new Novel("The Recognitions", "William Gaddis", 1955)); store.addNovel(new Novel("Red Harvest", "Dashiell Hammett", 1929)); store.addNovel(new Novel("Revolutionary Road", "Richard Yates", 1961)); store.addNovel(new Novel("The Sheltering Sky", "Paul Bowles", 1949)); store.addNovel(new Novel("Slaughterhouse-Five", "Kurt Vonnegut", 1969)); store.addNovel(new Novel("Snow Crash", "Neal Stephenson", 1992)); store.addNovel(new Novel("The Sot-Weed Factor", "John Barth", 1960)); store.addNovel(new Novel("The Sound and the Fury", "William Faulkner", 1929)); store.addNovel(new Novel("The Sportswriter", "Richard Ford", 1986)); store.addNovel(new Novel("The Spy Who Came in from the Cold", "John le Carre", 1964)); store.addNovel(new Novel("The Sun Also Rises", "Ernest Hemingway", 1926)); store.addNovel(new Novel("Their Eyes Were Watching God", "Zora Neale Hurston", 1937)); store.addNovel(new Novel("Things Fall Apart", "Chinua Achebe", 1959)); store.addNovel(new Novel("To Kill a Mockingbird", "Harper Lee", 1960)); store.addNovel(new Novel("To the Lighthouse", "Virginia Woolf", 1929)); store.addNovel(new Novel("Tropic of Cancer", "Henry Miller", 1934)); store.addNovel(new Novel("Ubik", "Philip K. Dick", 1969)); store.addNovel(new Novel("Under the Net", "Iris Murdoch", 1954)); store.addNovel(new Novel("Under the Volcano", "Malcolm Lowry", 1947)); store.addNovel(new Novel("Watchmen", "Alan Moore and Dave Gibbons", 1986)); store.addNovel(new Novel("White Noise", "Don DeLillo", 1985)); store.addNovel(new Novel("White Teeth", "Zadie Smith", 2000)); store.addNovel(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); Due the night before next class The main method also a commandline arguments, which will be the name of the BookStore; store the commandline argument as the name of the BookStore (unless it is "Amazon"...see above). Here is a snapshot of some of the code: print All Titles Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name none Parameters Resulting behavior Prints all titles in UPPERCASE COMP2501 Lab 3 store.addNovel(new Novel("The Recognitions", "William Gaddis", 1955)); store.addNovel(new Novel("Red Harvest", "Dashiell Hammett", 1929)); store.addNovel(new Novel("Revolutionary Road", "Richard Yates", 1961)); store.addNovel(new Novel("The Sheltering Sky", "Paul Bowles", 1949)); store.addNovel(new Novel("Slaughterhouse-Five", "Kurt Vonnegut", 1969)); store.addNovel(new Novel("Snow Crash", "Neal Stephenson", 1992)); store.addNovel(new Novel("The Sot-Weed Factor", "John Barth", 1960)); store.addNovel(new Novel("The Sound and the Fury", "William Faulkner", 1929)); store.addNovel(new Novel("The Sportswriter", "Richard Ford", 1986)); store.addNovel(new Novel("The Spy Who Came in from the Cold", "John le Carre", 1964)); store.addNovel(new Novel("The Sun Also Rises", "Ernest Hemingway", 1926)); store.addNovel(new Novel("Their Eyes Were Watching God", "Zora Neale Hurston", 1937)); store.addNovel(new Novel("Things Fall Apart", "Chinua Achebe", 1959)); store.addNovel(new Novel("To Kill a Mockingbird", "Harper Lee", 1960)); store.addNovel(new Novel("To the Lighthouse", "Virginia Woolf", 1929)); store.addNovel(new Novel("Tropic of Cancer", "Henry Miller", 1934)); store.addNovel(new Novel("Ubik", "Philip K. Dick", 1969)); store.addNovel(new Novel("Under the Net", "Iris Murdoch", 1954)); store.addNovel(new Novel("Under the Volcano", "Malcolm Lowry", 1947)); store.addNovel(new Novel("Watchmen", "Alan Moore and Dave Gibbons", 1986)); store.addNovel(new Novel("White Noise", "Don DeLillo", 1985)); store.addNovel(new Novel("White Teeth", "Zadie Smith", 2000)); store.addNovel(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); Due the night before next class The main method also a commandline arguments, which will be the name of the BookStore; store the commandline argument as the name of the BookStore (unless it is "Amazon"...see above). Here is a snapshot of some of the code: print All Titles Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name none Parameters Resulting behavior Prints all titles in UPPERCASE COMP2501 Lab 3 store.addNovel(new Novel("The Recognitions", "William Gaddis", 1955)); store.addNovel(new Novel("Red Harvest", "Dashiell Hammett", 1929)); store.addNovel(new Novel("Revolutionary Road", "Richard Yates", 1961)); store.addNovel(new Novel("The Sheltering Sky", "Paul Bowles", 1949)); store.addNovel(new Novel("Slaughterhouse-Five", "Kurt Vonnegut", 1969)); store.addNovel(new Novel("Snow Crash", "Neal Stephenson", 1992)); store.addNovel(new Novel("The Sot-Weed Factor", "John Barth", 1960)); store.addNovel(new Novel("The Sound and the Fury", "William Faulkner", 1929)); store.addNovel(new Novel("The Sportswriter", "Richard Ford", 1986)); store.addNovel(new Novel("The Spy Who Came in from the Cold", "John le Carre", 1964)); store.addNovel(new Novel("The Sun Also Rises", "Ernest Hemingway", 1926)); store.addNovel(new Novel("Their Eyes Were Watching God", "Zora Neale Hurston", 1937)); store.addNovel(new Novel("Things Fall Apart", "Chinua Achebe", 1959)); store.addNovel(new Novel("To Kill a Mockingbird", "Harper Lee", 1960)); store.addNovel(new Novel("To the Lighthouse", "Virginia Woolf", 1929)); store.addNovel(new Novel("Tropic of Cancer", "Henry Miller", 1934)); store.addNovel(new Novel("Ubik", "Philip K. Dick", 1969)); store.addNovel(new Novel("Under the Net", "Iris Murdoch", 1954)); store.addNovel(new Novel("Under the Volcano", "Malcolm Lowry", 1947)); store.addNovel(new Novel("Watchmen", "Alan Moore and Dave Gibbons", 1986)); store.addNovel(new Novel("White Noise", "Don DeLillo", 1985)); store.addNovel(new Novel("White Teeth", "Zadie Smith", 2000)); store.addNovel(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); Due the night before next class The main method also a commandline arguments, which will be the name of the BookStore; store the commandline argument as the name of the BookStore (unless it is "Amazon"...see above). Here is a snapshot of some of the code: print All Titles Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name none Parameters Resulting behavior Prints all titles in UPPERCASE COMP2501 Lab 3 store.addNovel(new Novel("The Recognitions", "William Gaddis", 1955)); store.addNovel(new Novel("Red Harvest", "Dashiell Hammett", 1929)); store.addNovel(new Novel("Revolutionary Road", "Richard Yates", 1961)); store.addNovel(new Novel("The Sheltering Sky", "Paul Bowles", 1949)); store.addNovel(new Novel("Slaughterhouse-Five", "Kurt Vonnegut", 1969)); store.addNovel(new Novel("Snow Crash", "Neal Stephenson", 1992)); store.addNovel(new Novel("The Sot-Weed Factor", "John Barth", 1960)); store.addNovel(new Novel("The Sound and the Fury", "William Faulkner", 1929)); store.addNovel(new Novel("The Sportswriter", "Richard Ford", 1986)); store.addNovel(new Novel("The Spy Who Came in from the Cold", "John le Carre", 1964)); store.addNovel(new Novel("The Sun Also Rises", "Ernest Hemingway", 1926)); store.addNovel(new Novel("Their Eyes Were Watching God", "Zora Neale Hurston", 1937)); store.addNovel(new Novel("Things Fall Apart", "Chinua Achebe", 1959)); store.addNovel(new Novel("To Kill a Mockingbird", "Harper Lee", 1960)); store.addNovel(new Novel("To the Lighthouse", "Virginia Woolf", 1929)); store.addNovel(new Novel("Tropic of Cancer", "Henry Miller", 1934)); store.addNovel(new Novel("Ubik", "Philip K. Dick", 1969)); store.addNovel(new Novel("Under the Net", "Iris Murdoch", 1954)); store.addNovel(new Novel("Under the Volcano", "Malcolm Lowry", 1947)); store.addNovel(new Novel("Watchmen", "Alan Moore and Dave Gibbons", 1986)); store.addNovel(new Novel("White Noise", "Don DeLillo", 1985)); store.addNovel(new Novel("White Teeth", "Zadie Smith", 2000)); store.addNovel(new Novel("Wide Sargasso Sea", "Jean Rhys", 1966)); Due the night before next class The main method also a commandline arguments, which will be the name of the BookStore; store the commandline argument as the name of the BookStore (unless it is "Amazon"...see above). Here is a snapshot of some of the code: print All Titles Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name none Parameters Resulting behavior Prints all titles in UPPERCASE Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name printAll Titles print TitlesContaining print TitlesOfLength COMP2501 printNameStartsEndsWith getLongest Parameters none String substring boolean caseSensitive int length (2) Lab 3 String substring String property Resulting behavior Prints all titles in UPPERCASE Prints all titles that contain the specified substring; if caseSensitive is false, then the match is in any letter casing (e.g. "The" is the same as "the"); if caseSensitive is true then the match must include letter casing (e.g. "The" is different than "the") Prints all titles that are of exactly the specified length Due the night before next class Prints all author names that either start or end with substring, in lowercase...the substring match is case insensitive (e.g. "aN" is the same as "An", etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loon) if the property Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name printAll Titles print TitlesContaining print TitlesOfLength COMP2501 printNameStartsEndsWith getLongest Parameters none String substring boolean caseSensitive int length (2) Lab 3 String substring String property Resulting behavior Prints all titles in UPPERCASE Prints all titles that contain the specified substring; if caseSensitive is false, then the match is in any letter casing (e.g. "The" is the same as "the"); if caseSensitive is true then the match must include letter casing (e.g. "The" is different than "the") Prints all titles that are of exactly the specified length Due the night before next class Prints all author names that either start or end with substring, in lowercase...the substring match is case insensitive (e.g. "aN" is the same as "An", etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loon) if the property Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name printAll Titles print TitlesContaining print TitlesOfLength COMP2501 printNameStartsEndsWith getLongest Parameters none String substring boolean caseSensitive int length (2) Lab 3 String substring String property Resulting behavior Prints all titles in UPPERCASE Prints all titles that contain the specified substring; if caseSensitive is false, then the match is in any letter casing (e.g. "The" is the same as "the"); if caseSensitive is true then the match must include letter casing (e.g. "The" is different than "the") Prints all titles that are of exactly the specified length Due the night before next class Prints all author names that either start or end with substring, in lowercase...the substring match is case insensitive (e.g. "aN" is the same as "An", etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loon) if the property Create the following BookStore methods. Do proper null and blank checking so that no crashes occur and no empty/blank strings appear: Method name printAll Titles print TitlesContaining print TitlesOfLength COMP2501 printNameStartsEndsWith getLongest Parameters none String substring boolean caseSensitive int length (2) Lab 3 String substring String property Resulting behavior Prints all titles in UPPERCASE Prints all titles that contain the specified substring; if caseSensitive is false, then the match is in any letter casing (e.g. "The" is the same as "the"); if caseSensitive is true then the match must include letter casing (e.g. "The" is different than "the") Prints all titles that are of exactly the specified length Due the night before next class Prints all author names that either start or end with substring, in lowercase...the substring match is case insensitive (e.g. "aN" is the same as "An", etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loon) if the property getLongest main String property printAllTitles String[] args Sample correct output when the BookStore's methods are called from Lab3.main(...): BookStore method name AN AMERICAN TRAGEDY ANIMAL FARM Same as Al etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loop); if the property argument is "title" (in any letter casing) then return the longest title (by finding it using a foreach loop); if the property argument is something else then return null ATONEMENT BELOVED THE ADVENTURES OF AUGIE MARCH ALL THE KING'S MEN AMERICAN PASTORAL THE BERLIN STORIES THE BIG SLEEP THE BLIND ASSASSIN BLOOD MERIDIAN Creates BookStore object and passes args[0] to BookStore constructor as its name property Calls all of the BookStore methods listed above, in this table APPOINTMENT IN SAMARRA TITLE 1 TITLE ARE YOU THERE GOD? IT'S ME, MARGARET. THE ASSISTANT AT SWIM-TWO-BIRDS BRIDESHEAD REVISITED THE BRIDGE OF SAN LUIS REY CALL IT SLEEP CATCH-22 Expected Output 9 THE CATCHER IN THE RYE A CLOCKWORK ORANGE THE CONFESSIONS OF NAT TURNER THE CORRECTIONS THE CRYING OF LOT 49 A DANCE TO THE MUSIC OF TIME getLongest main String property printAllTitles String[] args Sample correct output when the BookStore's methods are called from Lab3.main(...): BookStore method name AN AMERICAN TRAGEDY ANIMAL FARM Same as Al etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loop); if the property argument is "title" (in any letter casing) then return the longest title (by finding it using a foreach loop); if the property argument is something else then return null ATONEMENT BELOVED THE ADVENTURES OF AUGIE MARCH ALL THE KING'S MEN AMERICAN PASTORAL THE BERLIN STORIES THE BIG SLEEP THE BLIND ASSASSIN BLOOD MERIDIAN Creates BookStore object and passes args[0] to BookStore constructor as its name property Calls all of the BookStore methods listed above, in this table APPOINTMENT IN SAMARRA TITLE 1 TITLE ARE YOU THERE GOD? IT'S ME, MARGARET. THE ASSISTANT AT SWIM-TWO-BIRDS BRIDESHEAD REVISITED THE BRIDGE OF SAN LUIS REY CALL IT SLEEP CATCH-22 Expected Output 9 THE CATCHER IN THE RYE A CLOCKWORK ORANGE THE CONFESSIONS OF NAT TURNER THE CORRECTIONS THE CRYING OF LOT 49 A DANCE TO THE MUSIC OF TIME getLongest main String property printAllTitles String[] args Sample correct output when the BookStore's methods are called from Lab3.main(...): BookStore method name AN AMERICAN TRAGEDY ANIMAL FARM Same as Al etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loop); if the property argument is "title" (in any letter casing) then return the longest title (by finding it using a foreach loop); if the property argument is something else then return null ATONEMENT BELOVED THE ADVENTURES OF AUGIE MARCH ALL THE KING'S MEN AMERICAN PASTORAL THE BERLIN STORIES THE BIG SLEEP THE BLIND ASSASSIN BLOOD MERIDIAN Creates BookStore object and passes args[0] to BookStore constructor as its name property Calls all of the BookStore methods listed above, in this table APPOINTMENT IN SAMARRA TITLE 1 TITLE ARE YOU THERE GOD? IT'S ME, MARGARET. THE ASSISTANT AT SWIM-TWO-BIRDS BRIDESHEAD REVISITED THE BRIDGE OF SAN LUIS REY CALL IT SLEEP CATCH-22 Expected Output 9 THE CATCHER IN THE RYE A CLOCKWORK ORANGE THE CONFESSIONS OF NAT TURNER THE CORRECTIONS THE CRYING OF LOT 49 A DANCE TO THE MUSIC OF TIME getLongest main String property printAllTitles String[] args Sample correct output when the BookStore's methods are called from Lab3.main(...): BookStore method name AN AMERICAN TRAGEDY ANIMAL FARM Same as Al etc) If the property argument is "author" (in any letter casing) then return the longest author name (by finding it using a foreach loop); if the property argument is "title" (in any letter casing) then return the longest title (by finding it using a foreach loop); if the property argument is something else then return null ATONEMENT BELOVED THE ADVENTURES OF AUGIE MARCH ALL THE KING'S MEN AMERICAN PASTORAL THE BERLIN STORIES THE BIG SLEEP THE BLIND ASSASSIN BLOOD MERIDIAN Creates BookStore object and passes args[0] to BookStore constructor as its name property Calls all of the BookStore methods listed above, in this table APPOINTMENT IN SAMARRA TITLE 1 TITLE ARE YOU THERE GOD? IT'S ME, MARGARET. THE ASSISTANT AT SWIM-TWO-BIRDS BRIDESHEAD REVISITED THE BRIDGE OF SAN LUIS REY CALL IT SLEEP CATCH-22 Expected Output 9 THE CATCHER IN THE RYE A CLOCKWORK ORANGE THE CONFESSIONS OF NAT TURNER THE CORRECTIONS THE CRYING OF LOT 49 A DANCE TO THE MUSIC OF TIME b.printAllTitlesContaining("the", false); COMP2501 Lab 3 THE POWER AND THE GLORY THE PRIME OF MISS JEAN BRODIE RABBIT, RUN RAGTIME THE RECOGNITIONS RED HARVEST REVOLUTIONARY ROAD THE SHELTERING SKY SLAUGHTERHOUSE-FIVE SNOW CRASH THE SOT-WEED FACTOR THE SOUND AND THE FURY THE SPORTSWRITER THE SPY WHO CAME IN FROM THE COLD THE SUN ALSO RISES THEIR EYES WERE WATCHING GOD THINGS FALL APART TO KILL A MOCKINGBIRD TO THE LIGHTHOUSE TROPIC OF CANCER UBIK UNDER THE NET UNDER THE VOLCANO WATCHMEN WHITE NOISE WHITE TEETH WIDE SARGASSO SEA The Adventures of Augie March All the King's Men Are You There God? It's Me, Margaret. The Assistant The Berlin Stories The Big Sleep The Blind Assassin The Bridge of San Luis Rey The Catcher in the Rye The Confessions of Nat Turner The Corrections The Crying of Lot 49 A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart The French Lieutenant's Woman The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath Due the night before next class b.printAllTitlesContaining("the", false); COMP2501 Lab 3 THE POWER AND THE GLORY THE PRIME OF MISS JEAN BRODIE RABBIT, RUN RAGTIME THE RECOGNITIONS RED HARVEST REVOLUTIONARY ROAD THE SHELTERING SKY SLAUGHTERHOUSE-FIVE SNOW CRASH THE SOT-WEED FACTOR THE SOUND AND THE FURY THE SPORTSWRITER THE SPY WHO CAME IN FROM THE COLD THE SUN ALSO RISES THEIR EYES WERE WATCHING GOD THINGS FALL APART TO KILL A MOCKINGBIRD TO THE LIGHTHOUSE TROPIC OF CANCER UBIK UNDER THE NET UNDER THE VOLCANO WATCHMEN WHITE NOISE WHITE TEETH WIDE SARGASSO SEA The Adventures of Augie March All the King's Men Are You There God? It's Me, Margaret. The Assistant The Berlin Stories The Big Sleep The Blind Assassin The Bridge of San Luis Rey The Catcher in the Rye The Confessions of Nat Turner The Corrections The Crying of Lot 49 A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart The French Lieutenant's Woman The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath Due the night before next class b.printAllTitlesContaining("the", false); COMP2501 Lab 3 THE POWER AND THE GLORY THE PRIME OF MISS JEAN BRODIE RABBIT, RUN RAGTIME THE RECOGNITIONS RED HARVEST REVOLUTIONARY ROAD THE SHELTERING SKY SLAUGHTERHOUSE-FIVE SNOW CRASH THE SOT-WEED FACTOR THE SOUND AND THE FURY THE SPORTSWRITER THE SPY WHO CAME IN FROM THE COLD THE SUN ALSO RISES THEIR EYES WERE WATCHING GOD THINGS FALL APART TO KILL A MOCKINGBIRD TO THE LIGHTHOUSE TROPIC OF CANCER UBIK UNDER THE NET UNDER THE VOLCANO WATCHMEN WHITE NOISE WHITE TEETH WIDE SARGASSO SEA The Adventures of Augie March All the King's Men Are You There God? It's Me, Margaret. The Assistant The Berlin Stories The Big Sleep The Blind Assassin The Bridge of San Luis Rey The Catcher in the Rye The Confessions of Nat Turner The Corrections The Crying of Lot 49 A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart The French Lieutenant's Woman The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath Due the night before next class b.printAllTitlesContaining("the", false); COMP2501 Lab 3 THE POWER AND THE GLORY THE PRIME OF MISS JEAN BRODIE RABBIT, RUN RAGTIME THE RECOGNITIONS RED HARVEST REVOLUTIONARY ROAD THE SHELTERING SKY SLAUGHTERHOUSE-FIVE SNOW CRASH THE SOT-WEED FACTOR THE SOUND AND THE FURY THE SPORTSWRITER THE SPY WHO CAME IN FROM THE COLD THE SUN ALSO RISES THEIR EYES WERE WATCHING GOD THINGS FALL APART TO KILL A MOCKINGBIRD TO THE LIGHTHOUSE TROPIC OF CANCER UBIK UNDER THE NET UNDER THE VOLCANO WATCHMEN WHITE NOISE WHITE TEETH WIDE SARGASSO SEA The Adventures of Augie March All the King's Men Are You There God? It's Me, Margaret. The Assistant The Berlin Stories The Big Sleep The Blind Assassin The Bridge of San Luis Rey The Catcher in the Rye The Confessions of Nat Turner The Corrections The Crying of Lot 49 A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart The French Lieutenant's Woman The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath Due the night before next class COMP2501 b.printAllTitlesContaining("the", true); b.printAllTitles (13); printNameStartsEndsWith("aN") System.out.println(b.getLongest("xyz")); System.out.println(b.getLongest("AutHor")); System.out.println(b.getLongest("titlE")); Lab 3 The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath The Great Gatsby The Heart Is a Lonely Hunter The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings The Man Who Loved Children The Moviegoer On the Road One Flew Over the Cuckoo's Nest The Painted Bird The Power and the Glory The Prime of Miss Jean Brodie The Recognitions The Sheltering Sky The Sot-Weed Factor The Sound and the Fury The Sportswriter The Spy Who Came in from the Cold The Sun Also Rises Their Eyes Were Watching God To the Lighthouse Under the Net Under the Volcano All the King's Men The Catcher in the Rye A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart Due the night before next class Go Tell It on the Mountain Gone with the Wind The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings On the Road One Flew Over the Cuckoo's Nest The Power and the Glory The Sound and the Fury The Spy Who Came in from the Cold To the Lighthouse Under the Net Under the Volcano The Assistant The Big Sleep Call It Sleep Infinite Jest Invisible Man The Moviegoer Mrs. Dalloway Under the Net ianmcewan anthony burgess anthonypowell null Alan Moore and Dave Gibbons Are You There God? It's Me, Margaret. COMP2501 b.printAllTitlesContaining("the", true); b.printAllTitles (13); printNameStartsEndsWith("aN") System.out.println(b.getLongest("xyz")); System.out.println(b.getLongest("AutHor")); System.out.println(b.getLongest("titlE")); Lab 3 The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath The Great Gatsby The Heart Is a Lonely Hunter The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings The Man Who Loved Children The Moviegoer On the Road One Flew Over the Cuckoo's Nest The Painted Bird The Power and the Glory The Prime of Miss Jean Brodie The Recognitions The Sheltering Sky The Sot-Weed Factor The Sound and the Fury The Sportswriter The Spy Who Came in from the Cold The Sun Also Rises Their Eyes Were Watching God To the Lighthouse Under the Net Under the Volcano All the King's Men The Catcher in the Rye A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart Due the night before next class Go Tell It on the Mountain Gone with the Wind The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings On the Road One Flew Over the Cuckoo's Nest The Power and the Glory The Sound and the Fury The Spy Who Came in from the Cold To the Lighthouse Under the Net Under the Volcano The Assistant The Big Sleep Call It Sleep Infinite Jest Invisible Man The Moviegoer Mrs. Dalloway Under the Net ianmcewan anthony burgess anthonypowell null Alan Moore and Dave Gibbons Are You There God? It's Me, Margaret. COMP2501 b.printAllTitlesContaining("the", true); b.printAllTitles (13); printNameStartsEndsWith("aN") System.out.println(b.getLongest("xyz")); System.out.println(b.getLongest("AutHor")); System.out.println(b.getLongest("titlE")); Lab 3 The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath The Great Gatsby The Heart Is a Lonely Hunter The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings The Man Who Loved Children The Moviegoer On the Road One Flew Over the Cuckoo's Nest The Painted Bird The Power and the Glory The Prime of Miss Jean Brodie The Recognitions The Sheltering Sky The Sot-Weed Factor The Sound and the Fury The Sportswriter The Spy Who Came in from the Cold The Sun Also Rises Their Eyes Were Watching God To the Lighthouse Under the Net Under the Volcano All the King's Men The Catcher in the Rye A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart Due the night before next class Go Tell It on the Mountain Gone with the Wind The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings On the Road One Flew Over the Cuckoo's Nest The Power and the Glory The Sound and the Fury The Spy Who Came in from the Cold To the Lighthouse Under the Net Under the Volcano The Assistant The Big Sleep Call It Sleep Infinite Jest Invisible Man The Moviegoer Mrs. Dalloway Under the Net ianmcewan anthony burgess anthonypowell null Alan Moore and Dave Gibbons Are You There God? It's Me, Margaret. COMP2501 b.printAllTitlesContaining("the", true); b.printAllTitles (13); printNameStartsEndsWith("aN") System.out.println(b.getLongest("xyz")); System.out.println(b.getLongest("AutHor")); System.out.println(b.getLongest("titlE")); Lab 3 The Golden Notebook Go Tell It on the Mountain Gone with the Wind The Grapes of Wrath The Great Gatsby The Heart Is a Lonely Hunter The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings The Man Who Loved Children The Moviegoer On the Road One Flew Over the Cuckoo's Nest The Painted Bird The Power and the Glory The Prime of Miss Jean Brodie The Recognitions The Sheltering Sky The Sot-Weed Factor The Sound and the Fury The Sportswriter The Spy Who Came in from the Cold The Sun Also Rises Their Eyes Were Watching God To the Lighthouse Under the Net Under the Volcano All the King's Men The Catcher in the Rye A Dance to the Music of Time The Day of the Locust Death Comes for the Archbishop A Death in the Family The Death of the Heart Due the night before next class Go Tell It on the Mountain Gone with the Wind The Heart of the Matter The Lion, The Witch and the Wardrobe Lord of the Flies The Lord of the Rings On the Road One Flew Over the Cuckoo's Nest The Power and the Glory The Sound and the Fury The Spy Who Came in from the Cold To the Lighthouse Under the Net Under the Volcano The Assistant The Big Sleep Call It Sleep Infinite Jest Invisible Man The Moviegoer Mrs. Dalloway Under the Net ianmcewan anthony burgess anthonypowell null Alan Moore and Dave Gibbons Are You There God? It's Me, Margaret. Work on this lab with a new partner: someone with whom you have not yet worked. Write the code for the lab below and each partner must upload the zipped src folder to the learning hub (learn.bcit.ca Activities Assignments Lab4) before the start of lesson 5. Include your full name and your partner's full name at the top of each file, using a Java Javadoc /** @author */ tag (for example: /** @author Bullwinkle Moose */). Re-do lab 3 but this time the following methods must throw the following Exceptions given the following conditions: Make sure your methods declare the Exceptions they throw (and Javadoc @throws too). For example: /** * @param parameter - some parameter @throws IllegalArgumentException if parameter is bigger than 100, or is null */ public void pretendMethod (String parameter) throws IllegalArgumentException { } // code goes here printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" Work on this lab with a new partner: someone with whom you have not yet worked. Write the code for the lab below and each partner must upload the zipped src folder to the learning hub (learn.bcit.ca Activities Assignments Lab4) before the start of lesson 5. Include your full name and your partner's full name at the top of each file, using a Java Javadoc /** @author */ tag (for example: /** @author Bullwinkle Moose */). Re-do lab 3 but this time the following methods must throw the following Exceptions given the following conditions: Make sure your methods declare the Exceptions they throw (and Javadoc @throws too). For example: /** * @param parameter - some parameter @throws IllegalArgumentException if parameter is bigger than 100, or is null */ public void pretendMethod (String parameter) throws IllegalArgumentException { } // code goes here printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" Work on this lab with a new partner: someone with whom you have not yet worked. Write the code for the lab below and each partner must upload the zipped src folder to the learning hub (learn.bcit.ca Activities Assignments Lab4) before the start of lesson 5. Include your full name and your partner's full name at the top of each file, using a Java Javadoc /** @author */ tag (for example: /** @author Bullwinkle Moose */). Re-do lab 3 but this time the following methods must throw the following Exceptions given the following conditions: Make sure your methods declare the Exceptions they throw (and Javadoc @throws too). For example: /** * @param parameter - some parameter @throws IllegalArgumentException if parameter is bigger than 100, or is null */ public void pretendMethod (String parameter) throws IllegalArgumentException { } // code goes here printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" Work on this lab with a new partner: someone with whom you have not yet worked. Write the code for the lab below and each partner must upload the zipped src folder to the learning hub (learn.bcit.ca Activities Assignments Lab4) before the start of lesson 5. Include your full name and your partner's full name at the top of each file, using a Java Javadoc /** @author */ tag (for example: /** @author Bullwinkle Moose */). Re-do lab 3 but this time the following methods must throw the following Exceptions given the following conditions: Make sure your methods declare the Exceptions they throw (and Javadoc @throws too). For example: /** * @param parameter - some parameter @throws IllegalArgumentException if parameter is bigger than 100, or is null */ public void pretendMethod (String parameter) throws IllegalArgumentException { } // code goes here printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printNameStartsEndsWith(String substring) Must throw a checked Exception (YOU create the class) named IllegalNameException with the message "bad name" if the substring parameter is null or blank COMP2501 try { } { // code to try 1 printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message bad string") if the substring parameter is blank or null catch(Exception TypeOne e) Lab 4 NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: } Due before next class printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printNameStartsEndsWith(String substring) Must throw a checked Exception (YOU create the class) named IllegalNameException with the message "bad name" if the substring parameter is null or blank COMP2501 try { } { // code to try 1 printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message bad string") if the substring parameter is blank or null catch(Exception TypeOne e) Lab 4 NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: } Due before next class printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printNameStartsEndsWith(String substring) Must throw a checked Exception (YOU create the class) named IllegalNameException with the message "bad name" if the substring parameter is null or blank COMP2501 try { } { // code to try 1 printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message bad string") if the substring parameter is blank or null catch(Exception TypeOne e) Lab 4 NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: } Due before next class printTitlesOfLength(int length) Must throw an IllegalArgumentException if length is O or negative with the message "bad length" printNameStartsEndsWith(String substring) Must throw a checked Exception (YOU create the class) named IllegalNameException with the message "bad name" if the substring parameter is null or blank COMP2501 try { } { // code to try 1 printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message bad string") if the substring parameter is blank or null catch(Exception TypeOne e) Lab 4 NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: } Due before next class 2 of 2 COMP2501 try { } printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message "bad string") if the substring parameter is blank or null NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: catch(ExceptionTypeOne e) { } // code to try { catch(ExceptionTypeTwo e) } Etc... // handle exception type one here Automatic Zoom Lab 4 // handle exception type two here View as lext Download Due before next class getLongest(String property) Must throw an unchecked Exception (YOU create the class) named Illegal Novel PropertyException with the message "bad property" if its value is not "author" nor "title" (in any letter casing) main(String[] args) Must try/catch all of its methods now; in the event of an Exception being thrown, simply print the Exception object's getMessage() method output. 2 of 2 COMP2501 try { } printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message "bad string") if the substring parameter is blank or null NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: catch(ExceptionTypeOne e) { } // code to try { catch(ExceptionTypeTwo e) } Etc... // handle exception type one here Automatic Zoom Lab 4 // handle exception type two here View as lext Download Due before next class getLongest(String property) Must throw an unchecked Exception (YOU create the class) named Illegal Novel PropertyException with the message "bad property" if its value is not "author" nor "title" (in any letter casing) main(String[] args) Must try/catch all of its methods now; in the event of an Exception being thrown, simply print the Exception object's getMessage() method output. 2 of 2 COMP2501 try { } printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message "bad string") if the substring parameter is blank or null NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: catch(ExceptionTypeOne e) { } // code to try { catch(ExceptionTypeTwo e) } Etc... // handle exception type one here Automatic Zoom Lab 4 // handle exception type two here View as lext Download Due before next class getLongest(String property) Must throw an unchecked Exception (YOU create the class) named Illegal Novel PropertyException with the message "bad property" if its value is not "author" nor "title" (in any letter casing) main(String[] args) Must try/catch all of its methods now; in the event of an Exception being thrown, simply print the Exception object's getMessage() method output. 2 of 2 COMP2501 try { } printTitlesContaining (String substring, boolean caseSensitive) Must throw an IllegalArgumentException (with message "bad string") if the substring parameter is blank or null NOTE: when a method or constructor throws one of several different methods, the try/catch block is extended as follows: catch(ExceptionTypeOne e) { } // code to try { catch(ExceptionTypeTwo e) } Etc... // handle exception type one here Automatic Zoom Lab 4 // handle exception type two here View as lext Download Due before next class getLongest(String property) Must throw an unchecked Exception (YOU create the class) named Illegal Novel PropertyException with the message "bad property" if its value is not "author" nor "title" (in any letter casing) main(String[] args) Must try/catch all of its methods now; in the event of an Exception being thrown, simply print the Exception object's getMessage() method output.
Expert Answer:
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
The yield curve is flat at 8% for all maturities.Consider a 2-year bond with a coupon rate of 10% per year.The face value is $100 and the coupons are paid annually. (a) (5 points) What is the price...
-
Discuss the following topical questions. Be thorough in your response. Relative to supply chain location decisions, there are a number of dominant factors to consider when choosing a facility...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
What is the relationship between group norms and group cohesiveness? What roles do both cohesiveness and norms plan in shaping group performance?
-
Let T: R2 R2 be the linear operator given by the formula T(x, y) = (2x - y, -8x + 4y) Which of the following vectors are in R(T)? (a) (1, -4) (b) (5, 0)
-
In Exercises 3 and 4, compute x 3 in two ways: by computing x 1 and x 2 , and by computing P 3 . P .6 .5 = [$_$], x= [6] .4 .5
-
Which of the following is least likely to be a purpose of a yearly staff appraisal meeting conducted between an information systems auditor and his/her manager? a. To determine the interpersonal...
-
Stone Sour Corp. issued 20-year bonds two years ago at a coupon rate of 7.1 percent. The bonds make semiannual payments. If these bonds currently sell for 105 percent of par value, what is the YTM?
-
Ethical Reasoning 2 Janice is an audit manager in a large public accounting firm with 35 offices on the East Coast. Janice has been dating Keith, a CFO of a company that is not a client of Janice's...
-
Ken (birthdate July 1, 1987) and Amy (birthdate July 4, 1989) Booth have brought you the following information regarding their income, expenses, and withholding for the year. They are unsure which of...
-
5. [3 Marks] Convert the following decimal numbers to binary using the two's complement format, using 16 bits: a. 3276010 b. -3276010 6. [2 Marks] Briefly explain why two's complement is the best...
-
(i) Find derivative of y=eco (j) Find slope of tangent to curve y=x-x at x=2
-
You have been hired to run the wheat futures desk. For simplicity, assume interest rates are 0%. We are in March 2021(month3), and the price of wheat is currently $5 per bushel. Consider two wheat...
-
You throw a ball for your dog to fetch. The ball leaves your hand with a speed of 2 m/s, at an angle of 30 to the horizontal, and from a height of 1.5 m above the ground. The mass of the ball is 0.5...
-
Now it is time to think about marketing for the business that you created in the first part of this course. If you are new to the course, choose a specific business that interests you and imagine...
-
A pry bar is often used as a first class lever, where you apply your input force on one end of the lever, the output force is taken at the other end of the lever and the fulcrum (the pivot point) is...
-
A proton is moving in a uniform magnetic field. When is the magnetic force on the proton oriented in the same direction as the proton's velocity? Explain.
-
Is times interest earned meaningful for utilities? Why or why not?
-
A bank charges a base fee of $10 per month, plus the following check fees for a commercial checking account: $.10 each for less than 20 checks $.08 each for 2039 checks $.06 each for 4059 checks $.04...
-
What does it mean to let the user control a loop?
-
You want to write a for loop that displays I love to program 50 times. Assume that you will use a control variable named count. a) What initialization expression will you use? b) What test expression...
-
Where do the following accounts (and their balances) appear in the balance sheet? a. Dividends Payable-Common Stock b. Stock Dividend Distributable
-
What are the different sources of paid-in capital?
-
Bleaker Company declares and pays its annual dividend near the end of its fiscal year. For the current year, Bleaker's dividend payout ratio was 40 percent, its earnings per common share were \(\$...
Study smarter with the SolutionInn App