Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
Write in Java please
Sample Output:
Welcome to the String Helper Tester!
Enter any two words:
harp fiddle
Meshing harp with fiddle
hfairdpdle
Enter a word:
burrito
Replacing vowels with oodle in the word burrito
Boodlerroodletoodle
Enter a word to determine its weight:
taco
The weight of the word taco is
11.8
expand button
Transcribed Image Text:Sample Output: Welcome to the String Helper Tester! Enter any two words: harp fiddle Meshing harp with fiddle hfairdpdle Enter a word: burrito Replacing vowels with oodle in the word burrito Boodlerroodletoodle Enter a word to determine its weight: taco The weight of the word taco is 11.8
Task:
Write a Java program that creates a helper class called StringHelper. This class has methods not already
built into strings, but should be because they are super useful.
First create a class called StringHelper which has the following static methods
mesh Strings: This method takes in two strings as parameters, meshes them together, and returns
the meshed strings. Meshing alternates the each character in the first string with every character
in the next string. If there are not enough characters to fully mesh then the rest will be appended
to the end. For instance if the two strings were "harp" and "fiddle" the returned string will be
"hfairdpdle".
●
replace Vowels WithOodle: This method takes in one string as a parameter, and returns the string
with every vowel (a,e,i,o,u) replaced by the phrase "oodle". For instance if the string is "burrito"
then the returned string would be "boodlerroodletoodle". Also, case does not matter.
weight: Much like length returns the number of characters in a string, the weight gives the weight
in kilograms. This method takes in a string and returns a double value corresponding to its weight.
Everyone knows that a word's weight is determined by
each vowel (a,e,i,o,u) counting as 2.5 kilograms and
each consonant as 3.4 kilograms.
Finally create a class called StringHelperTester
O
This class DOES HAVE a main method
Test each method multiple times to determine if they work.
expand button
Transcribed Image Text:Task: Write a Java program that creates a helper class called StringHelper. This class has methods not already built into strings, but should be because they are super useful. First create a class called StringHelper which has the following static methods mesh Strings: This method takes in two strings as parameters, meshes them together, and returns the meshed strings. Meshing alternates the each character in the first string with every character in the next string. If there are not enough characters to fully mesh then the rest will be appended to the end. For instance if the two strings were "harp" and "fiddle" the returned string will be "hfairdpdle". ● replace Vowels WithOodle: This method takes in one string as a parameter, and returns the string with every vowel (a,e,i,o,u) replaced by the phrase "oodle". For instance if the string is "burrito" then the returned string would be "boodlerroodletoodle". Also, case does not matter. weight: Much like length returns the number of characters in a string, the weight gives the weight in kilograms. This method takes in a string and returns a double value corresponding to its weight. Everyone knows that a word's weight is determined by each vowel (a,e,i,o,u) counting as 2.5 kilograms and each consonant as 3.4 kilograms. Finally create a class called StringHelperTester O This class DOES HAVE a main method Test each method multiple times to determine if they work.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education