Modify the program for Line Numbers from L09: In-Class Assignment. Mainly, you are changing the problem from
Question:
Modify the program for Line Numbers from L09: In-Class Assignment. Mainly, you are changing the problem from using arrays to Array Lists. There are some other modifications as well, so read the instructions carefully.
The program should do the following:
–Ask the user for how many lines of text they wish to enter
–Declare and initialize an **ArrayList** of Strings to hold the user’s input
–Use a do-while loop to prompt for and read the Strings (lines of text) from the user
at the command line until they enter a sentinel value
–After the Strings have been read, use a for loop to step through the ArrayList of
Strings and concatenate a number to the beginning of each line eg:
This is change to 1 This is
The first day change to 2 The first day
and so on…
–Finally, use a **for each** loop to output the Strings (numbered lines) to the command
line.
*/
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe