Question: Can someone please answer in Java? I have tried so hard on these three, and nothing is working. I would really appreciate it! Please indicate
Just make up your own input. Write as three separate codes, one for each problem. 1. stringMiddleEllipsis: Produce a (trimmed) string three dots are inserted I exactly in the middle of the string. If the string has an odd number of characters, then insert the dots after the middle character. For example, if the input is muffin, the output should be muf...fin. If the input is barbed- wire, the output should be barbed...-wire. Complete this task without using an if statement 2. stringAliButSecondToLastWord: Produce a (trimmed) string that is identical to the input, except that the next-to-last word (and the space that follows it) is removed. For example, if the input is I love chewy bubble gum, then the output should be I love chewy gum. 3. stringFirstThree Quarters: Produce a (trimmed) string that contains only the first 75% of the characters that are in the input. If the number of characters is not an exact multiple of 4, "round up to the whole number that is above 75%, but is as close as possible. For example, if the input is the 12-character string Jacob Marley, then the return value should be the_9-character string Jacob Mar. If the input is the 10-character string Jackhammer, then the return value should be the 8-character string Jackhamm. Complete this task without using an if statement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
