Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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 - =HA4,2. bo = nethodseparator with = nethodseparator with " Example for the first input t[M4,i,5,1,e,3,f,a,1,1,2,0,2, 2) methodseparator with = n separator {MIs1d3Fa112e22 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,cm Example for the First Input :THIS is A TEST for the METHODCASE methodcase with "true" input :THIS BS A TEST FOR THE METHOOCASE methodcase with "false" input ithlis is a test for the methodcase Example for the First Input :everyting is lowercase methodcase with "true" input : EVERYTUNO ES LOWERCASE methodcase with "false" input ieveryting is lowercase 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 =1614,2,d= Example for the First Input t[y,a,v,u,z,s,z,1,1,m,h,1,n,d,1,s,t,a,n] nethedSeparatorCase with " separater and with "true" seM|I SIe3FALL2a22 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

IBM Db2 11 1 Certification Guide Explore Techniques To Master Database Programming And Administration Tasks In IBM Db2

Authors: Mohankumar Saraswatipura ,Robert Collins

1st Edition

1788626915, 978-1788626910

More Books

Students also viewed these Databases questions

Question

(3) Z (U + 2124), which is the set of all integers; Pg45

Answered: 1 week ago

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago