subject

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "StringSlicer" (without the quotation marks) that uses methods to:
1. Get a String from the user at the command line
2. Populate an ArrayList of Character data (the wrapper class), with each char in the String represented as a separate
Character element in the ArrayList
3. Output each Character to the command line, each on a separate line
NOTE: For this assignment and all future assignments that deal with methods, you should be calling the appropriate method to do the task indicated, rather than implementing the task logic in the main method itself.
One of the PA requirements is to use an ArrayList where each element is a char. There are several
implementation approaches. The notes below use an ArrayList and String variable locally declared in
main. The use of three methods is required for this PA.
Method 1: The first method has no parameters and returns a string. Within the method body, the user
should be prompted for a string and the string should be read into a local string variable using the next()
method. There’s no requirement for entering a multi-word phrase – so using the next() method is fine.
The user-entered string is then returned to main.
The header of the method should be similar to this:
public static String input()
Method 2: This method has two parameters, the string returned from the first method and the ArrayList
(which you are going to fill in). Use a for loop to go character by character through the string (use of the
charAt method works well). Store each of the characters of the input string into the ArrayList using the
add() method.
The header of the method should be similar to this where ‘aString’ is the returned string from Method 1,
and charArray is the ArrayList declared in main.
public static void process(String aString, ArrayList charArray)
Method 3 has the ArrayList as a parameter. The method uses a for loop to printout each of the elements
in the ArrayList using the get method.
The method header should look similar to this:
public static void output(ArrayList charArray)
An approach for implementing main, pseudocode:
Declare local ArrayList
Declare local String variable
Call ‘input’ method which no parameters and returns a String
Call ‘process’ method which has the String and the ArrayList as parameters
Call ‘output’ method which has the ArrayList as a parameter
An example run:
Enter a string:
rabbit
r
a
b
b
i
t

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
The word ‘play’ comes with many different interpretations and a variety of definitions. discuss some of the various meanings tied to the word play. why is the concept of play thought to be an important addition to the workplace? do some (brief) research online and give an example of how play in the workplace is being done right.
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Where would you click to edit the chart data?
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
You know the right answer?
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File...
Questions
question
Mathematics, 05.02.2022 04:20
Questions on the website: 13722363