Needed Answer within 1 hour very urgent I will give 2 upvotesfor correct answer
Practice working with arrays and polymorphism with methodoverloading; pass-by-value and scope ofvariables by writing the following methods and statements.Methods:
Write a method basicArray that does not take any inputs. In thismethod, write statements todeclare an int array called nums with 50 elements. Write thestatements to store the values 1through 50 in the elements of nums, add 10 to each entry of thearray nums, then print everyelement of nums.2.Write a method printElements that accepts an array of Strings asthe input parameter argument.
The output of this function is that it will print elements ofthe array. Make sure that your functionverifies that each element is a string type and prints those arrayelements to String objects.3.Write another method printElemenccepts a two-dimensional array of ints as the inputparameter argument. The output of this function is that it willprint elements of the 2D array. Theoutput should be in a matrix form (thatand columns) with each element separatedby a white space. Use the printf() function to format the outputwith clean alignment.
Write a method printElements that accepts an array of TimeObjects as the parameter argument.The output of this function is that it will print elements of thearray. Make sure that your functionverifies that each element is a Time type and prints those arrayelements as strings.Statements in the main method:
5. Write the statements in the main method to declare an arrayof 10 Strings. Store the words "first",second", "third", "fourth", "fifth", etc. in the array, and callprintElements to print your array. Ishould print each element followed by the length of eachelement.6. Write the statements to declare an array of 3 Time objects,store a Time in each array element,and print the array.7 .
Write the statements to declare a two-dimensional array of intsnamed values with 10 rows and 20columns. Then write a statement that will print the number of rowsin the 2D array by using thecorrect property that can retrieve the array size. Write astatement which will print the number ofcolumns in a 2D array called values. Then finally write a statementthat will call printElementsand print the 2D array.
Needed Answer within 1 hour very urgent I will give 2 upvotes for correct answer Practice working with arrays and polymo
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am