Creates a simple arraylist

Assignment Help Basic Computer Science
Reference no: EM13669426

The following code creates a simple ArrayList:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Ex01 {

public static void main(String[] args) throws IOException {

BufferedReader userInput = new BufferedReader
(new InputStreamReader(System.in));

ArrayList<String> myArr = new ArrayList<String>();
myArr.add("Zero");
myArr.add("One");
myArr.add("Two");
myArr.add("Three");

}
}

Starting with this provided code, add the following functionality:

Add items to the ArrayList, one at a time, based on user typed input. The user will be prompted for the String to be stored in the ArrayList and then hit enter. The user will be able to continue to add items to the ArrayList until they just hit enter without typing anything.

Once the user does this (hits enter without typing anything), the program will display all of the elements of the ArrayList, both the index and String values, in a table. It will do this via a single loop.

Compile, run, and check the results. Submit the following:

The source file for each of the classes created (If more than one file has been created, zip them into one .zip file for posting.)

 

Reference no: EM13669426

Questions Cloud

Determine voltage dropped across synchronous impedance : Draw the synchronous generator's per phase voltage and current phasor diagram and calculate the per phase output voltage and determine the voltage dropped across the synchronous impedance
What is an estimated return that shareholders of nab : What is an estimated return that shareholders of NAB expect to earn and what is weighted average cost of capital (WACC) - How the increase in liability will affect WACC of NAB.
Write a memorandum-developmnent of family-owned business : In a recent commentary on governance in family firms, a leading executive search consultancy argued, Corporate governance is a critical enabling factor for the developmnent of family-owned business.
Difference between the cooling rate and hardenability : What is the difference between the cooling rate and hardenability? How the sample sizes affect the cooling rate and hardenability and martensite can also be obtained through water quenching of alloy steels, why oil quenching is normally used in in..
Creates a simple arraylist : Creates a simple ArrayList
Find the rms current phase angle and rms voltage : Find the rms current, phase angle and rms voltage across R & L, in an RL circuit when a 58 Hertz 123 Volt rms ac voltage is applied, where R=1.80 kΩ and L=350 mH
What are search methods : What are search methods? Do you feel search methods are relevant to topics in artificial intelligence ? If yes, please explain why and how. Specifically, describe how search methods would be used for rule-based systems, expert systems, resolu..
Basic business skills play a role in your professional life : How will basic business skills play a role in your professional life?
Linear programming case study : Explain what the results mean - write a paragraph addressing the part of the problem pertaining to sensitivity analysis and shadow price.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd