Answered step by step
Verified Expert Solution
Question
1 Approved Answer
StringArray In main: wolsd msigorq 9 dt reini 7 . I Create a Scanner to read input from the keyboard. Create an String Array reference
StringArray
In main:
wolsd msigorq dt reiniI
Create a Scanner to read input from the keyboard.
Create an String Array reference for Strings can call it myStrings
Call the method createStringArray with no parameters that returns a reference to an Strings Array that is placed into the mystrings reference variable.
Call populateArray with the String Array myStrings request and read in Strings readLine
Once back in main, print out the original String Array using the enhanced for loop. I
Call findAverageLength with the Array mystrings reference variable as the parameter.
Sum up the lengths of the strings and divide that by Return this value to main.
In main print the value retuned with a statement of what it is
createStringArray method that has no parameters
Creates and returns a reference to the String Array
populateArray method with a void return that accepts a reference to an Array called myArr
Request and read in Strings from the user readLine Add each String to the array
removeEvens method with a double return type, that accepts a reference to a String Array called myArr
I leave the logic to you: You must calculated the average length for all strings in the array
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