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 17:00
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 22.06.2019 23:00
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
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, 01.12.2020 01:00
question
Mathematics, 01.12.2020 01:00
question
Mathematics, 01.12.2020 01:00
Questions on the website: 13722367