Question: In Java please and I dont need a main method just the methods 4. Write a method, getMiddle Chars, the method receives a String and

In Java please and I dont need a main method just the methods
4. Write a method, getMiddle Chars, the method receives a String and returns a String containing the middle character (as a String) or the middle 2 characters(as a String) found in the received String. If an empty String is received, returns an empty String. characters in the received string ignoring leading/trailing spaces. method signature: public static String getFirstLast(String aString) Example values: getMiddleChars("hello") should return "I" getMiddleChars("hi") should return "hi" getMiddleChars(") should return getMiddleChars("K") should return "K" getMiddleChars("I Love CS") should return "V" getMiddleChars("Silly String work") should return "I" 5. Write a method mixlt, that receives 2 strings and returns a string containing the first char of string1, the first char of string2, the second character of string1, the second character of string2 etc. Any leftover chars go at the end of the returned string Example values: mixit("abc", "xyz")returns "axbycz" mixit("Hi", "There") returns "HTihere" mixit("xxxx", "There") returns "xTxhxexre" 6. Write a method doubleChars, that returns a String containing all chars in the received String two times in the returned String. method signature: public static String doubleChars(String str) doubleChars("The") returns "TThhee" // TT for T, hh for h, ee for e doubleChars("AAbb") returns "AAAAbbbb" doubleChars("Hi-There") returns "HHii--TThheerree" doubleChars("") returns doubleChars("") returns"" 7. Write a method, computeTicketPrice, that receives a location code (String), and returns the cost of an entrance ticket based on the location code received(NOT case sensitive). method signature: public static double computeTicketPrice(String venue Code) venueCode price: "floor" 150.00 "level1" 120.00 "level2" 100.00 "balcony" 85.00 any other 0.00 Activate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
