Question: use java code! and please solve all parts. student number: S025275 name: Derya Srek (50 Points) The Fourth Assignment - Question 2 Q2. Methods in


(50 Points) The Fourth Assignment - Question 2 Q2. Methods in Java a) Your coding stye 120 points\}. b) Prepare a method and cal in methotheparater. The methodSeparator should return a string array with a parametric separatoc between them. There should be no separator before the fint or aher the bast element. The methodseparator should have two input parameten. The first one is a strint arras, and the second input is a string walue which will be used as a separatoc. Please check to be sure that the input array and the separator are not empty. If any input value is empty, immediately teminute the mrehod (10 points) Sample output (50 Points) The Fourth Assignment - Question 2 Q2. Methods in Java d) Prepare another method and call it methodicae. The methodCase thould return a atring value and huve two iegot parameter. The first input parameter is a string variable, and the second is a boolean variable. The methodCase should change the case of the fint inout value according to the second ingut. When the second input is true, the method crse changes the case of the fint input to upperase, otherwise to lowercase (10 Points). Sample output (50 Points) The Fourth Assignment - Question 2 Q2. Methods in Java d) Prepare the last method and cal it methodseparatoricane. The purpose of this method is to create a combinition of methodSeparater and methodCase. The methodseparatorCase should return a strinc arrw with a parametric separator between items. There should be no separator before the firg or ather the inc element. in this method, thee should be throe input parometen. The frit one is a string array, and the seond input is a string value which will be used as a separator The third ingut is a boolean variable. When the third input is true, the methodseparatorose changes the case of the hems of the first input array to uppercase, otherwise to lowercase. Flease check to be sare that the inout array and the separator are not empty. If any input valoe is empty, then immediately terminute the method. Please do not write again the methodCase codes imbtad, call the methodCase for each arrav item in a loop in this methed (10 points). Sample output Q2. Methods in Java e) Prepare a test case and show the test result. The test case table columns are "Test Case", "Expected Result", "Explanation", and "Test Result". You should test the following cases, you can add more cases: - Lower and upper case of your name and surname. - Empty input value cases. - methodSeparator, methodCase, and methodSeparatorCase should be tested separately (10 points). Q2. Methods in Java a) Your coding style (10 points). b) Prepare a method and call it methodSeparator. The methodSeparator should return a string array with a parametric separator between them. There should be no separator before the first or after the last element. The methodSeparator should have two input parameters. The first one is a string array, and the second input is a string value which will be used as a separator. Please check to be sure that the input array and the separator are not empty. If any input value is empty, immediately terminate the method (10 points). Sample output (50 Points) The Fourth Assignment - Question 2 Q2. Methods in Java c) Prepare another method and call it methodCase. The methodCase should return a string value and have two input parameters. The first input parameter is a string variable, and the second is a boolean variable. The methodCase should change the case of the first input value according to the second input. When the second input is true, the methodCase changes the case of the first input to uppercase, otherwise to lowercase (10 Points). Sample output HN4,2,Cw Example for the First Input :THIS is A TEST for the NETHOOCASE methodcase with "true" input :THIS BS A TEST FOR THE NETHOOCASE methodcase with "false" input ithis is a test for the nethodcase Example for the First Input :everyting is lowercase methodcase with "true" input :EVERYTUNG IS LOWERCASE methodcase with "false" input :everyting is lowercase Q2. Methods in Java d) Prepare the last method and call it methodSeparatorCase. The purpose of this method is to create a combination of methodSeparator and methodCase. The methodSeparatorCase should return a string array with a parametric separator between items. There should be no separator before the first or after the last element. In this method, there should be three input parameters. The first one is a string array, and the second input is a string value which will be used as a separator. The third input is a boolean variable. When the third input is true, the methodSeparatorCase changes the case of the items of the first input array to uppercase, otherwise to lowercase. Please check to be sure that the input array and the separator are not empty. If any input value is empty, then immediately terminate the method. Please do not write again the methodCase codes. Instead, call the methodCase for each array item in a loop in this method (10 points). Sample output - Hath.2.d+o trample for the Pirst inpot : [M,1,5,1,0,3,0,2,1,1,2,0,2,2] sethoseseneratorche with (50 Points) The Fourth Assignment - Question 2 Q2. Methods in Java e) Prepare a test case and show the test result. The test case table columns are "Test Case", "Expected Result", "Explanation", and "Test Result". You should test the following cases, you can add more cases: - Lower and upper case of your name and surname. - Empty input value cases. - methodSeparator, methodCase, and methodSeparatorCase should be tested separately (10 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
