Question: How would I code the 100 point version so that it outputs the Expected output? Student Version of StringMethods: public class StringMethods { /* *

How would I code the 100 point version so that it outputs the Expected output?

How would I code the 100 point version so that it outputs

the Expected output? Student Version of StringMethods: public class StringMethods { /*

* method getFirst() returns all letters before the delimiter in line */

Student Version of StringMethods: public class StringMethods { /* * method getFirst() returns all letters before the delimiter in line */ public static String getFirst( String line, String delimiter ) { return ""; } /* * method getLast()returns all letters after the delimeter in line */ public static String getLast( String line, String delimiter ) { return ""; } /* * method removeComma() if there is a comma in parameter word, * returns word without the comma; else returns word */ public static String removeComma( String word ) { return ""; } /* * method getNumUpper() returns the number of uppercase letters in line. */ public static int getNumUpper( String line ) { return 0; } /* * method displayWords() displays the individual words, * one per line, in the parameter phrase */ public static void displayWords(String phrase) { } public static void main( String args[] ) { // test methods getFirst and getLast - 80 pt version System.out.println( getFirst("elephants@are@big", "@") ); System.out.println( getFirst("computer$science", "$") );

System.out.println( getFirst("dogs@are@not@smarter@than@cats", "@") ); System.out.println( getFirst("one#fish#blue#fish", "#") ); System.out.println( getLast("elephants@are@big", "@") ); System.out.println( getLast("computer$science", "$") ); System.out.println( getLast("dogs@are@not@smarter@than@cats", "@") ); System.out.println( getLast("one#fish#blue#fish", "#") ); System.out.println(" "); // test method getNumUpper - 90 pt version System.out.println(" Number of uppercase letters in: "); String line = "Computer Science"; System.out.println(line + " : " + getNumUpper(line)); line = "AP " + line; System.out.println(line + " : " + getNumUpper(line)); line = "The Cat in the Hat Comes Back by Dr. Suess"; System.out.println(line + " : " + getNumUpper(line)); // test remove comma - 100 pt version System.out.println(" Remove comma"); System.out.println( removeComma("Tweety,Bird")); System.out.println( removeComma("Sylvester")); System.out.println( removeComma(",YosemiteSam")); // display the words, one per line in the string - 110 pt version line = "I love unicorns"; System.out.printf(" \"%s\" contains the words: ", line ); displayWords(line); line = "Did I ever tell you that Mrs. McCave had twenty-three sons and she named them all Dave?"; System.out.printf(" \"%s\" contains the words: ", line ); displayWords(line); } }

Lab StringMethods 80, 90, 100, and 110 point versions Lab Goal This lab was designed to teach you more about the String class methods Lab Description: class You are provided with a StringMethods class. You are to complete the methods in the Student Version of StringMethods public class StringMethods method getFirst) returns all letters before the delimiter in line public static String getFirst( String line, String delimiter ) return" * method getlast ) returns all letters after the delimeter in line public static String getliast String line, String delimiter) return "" * method removeComma) if there is a comma in parameter word, returns word without the comma; else returns word public static String removeComma ( String word ) return "; * method getNumUpper ) returns the number of uppercase letters in line. public static int getNumUpper String line) return 0; * method displayWords ) displays the individual words, * one per line, in the parameter phrase public static void displayWords (String phrase) public static void main String args[ ) // test methods getFirst and getLast 80 pt version System.out.printin getFirst ("elephants@are@big", "a"); System.out.println getFirst ("computerSscience", "")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!