Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is java Given a string str, you are to produce (and return) a string, built from str, such that all vowels are replaced by
This is java
Given a string str, you are to produce (and return) a string, built from str, such that all vowels are replaced by a character **'. The method you will design to solve this problem is named stars4Vowels (see method stub in the Week2Review.java file in Mimic). For instance, Given string 'absds", stars4Vowels will return string *ksd* Given string "Elementary, stars4Vowels will return string ***matr Given string asioux", stars4Vowels will return string Bonus (3 pts): Produce an alternative implementation. You method should be named stars4VowelsAlt. Given a 10 array of integers A, you are to produce (and return) a 2D array of integers that is as follows: B has as many rows as Alength. Bhas as many columns as Alength B contains only values O except for its diagonal elements: for all elements BOJDD, we have B[UD] = A[. The method you will design to solve this problem is named one2TwoD (see method stub in the Week2Review.java file in Mimic). For instance, Given array(1,3,2,4, one2TwoD will return the following 2D array: {{1, 0, 0, 0). {0,3,0,0). {0.0, 4.0). {0, 0, 0, 2) Given array (1,0.5:1), one2TwoD will return the following 2D array: {{1,0,0,0). {0,0,0,0). {0, 0,5, 0. {0,0,0.-1}} Bonus (3 pts): when you implement this method using only one for loop. Given a 1D array of integers A, you are to produce (and return) a 2D array B of positive integers that is as follows: B has as many rows as Alenath Each its row of Bis of length A[and contains only values AD The method you will design to solve this problem is named one2TwoDMulti (see method stub in the Week2Review.java file in Mimid. For instance, Given array(1,3,2,4), one2TwoD will return the following 2D array: {3,3,3). {4,4,4,4}, {2,2}} . Given array (1,2,5,3), one2TwoD will return the following 2D array: (2.2), (5,5,5,5,5), (3,3,3}} Given a string str, you are to produce (and return) a 10 array S of strings of length = the length of str, and where each element S[) = stesubstring(0,i+1). The method you will design to solve this problem is named string 2Array (see method stub in the Week2Review.java file in Mimit. For instance, Given string 'abse" string2Array will return ("a", "ab", "abs", "abcd", "abcde"). Given string "", string 2Array will return . Given string "a", string2Array will return ("a"}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started