Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is advance java. please when writing the code separate the class from the main. CT 2613 Advanced Java Assignment: Arraylist and Two-Dimensional Array Part

image text in transcribed

this is advance java. please when writing the code separate the class from the main.

CT 2613 Advanced Java Assignment: Arraylist and Two-Dimensional Array Part A: ArrayList Assignment Write a program that allows you to enter a series of numbers (ints). Each time a new number is entered, add it to an ArrayList. Let the user stop the data entry by entering a -1 When data entry is done, display the contents of the list using your own for loop. (or for-each) Also, calculate and display the sum and the average of the elements in the list Remember that you can't store int values directly in an ArrayList -you have to use Integer (wrapper class) to declare your ArrayList. This won't work: ArrayList numbers.. Instead, you would either declare them like this: ArrayList numbers Or as an Arraylist of Strings and convert them to ints as needed. 1 don't recommend this.) Part B: two-dimensional array assignment. Write a program that will ask the user: For the number of rows in the array For the number of columns in the array Then the program should: . Declare and allocate an array of ints of that size . Fill the array (iterate thru every value with a nested loop) with random numbers between 1 and 9 . Display the two-d array appropriately

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

Discuss the difference between a cash market and a futures market.

Answered: 1 week ago