Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Write a Java class DemoList, the class has:
a private attribute list1 as an ArrayList of Integer.
Zero argument constructor that create and initilaise list1 to an empty list.
A method fill(), which take no argument and return no values. The method should allow the user to read the list of integers: user should be prompted, to enter a series of integers one at a time, until the user enters 0. Those values are used to fill list1.
A method sortList() that return the sorted list1.
A method brint(): that print contents of list1.
A method maximum() that returns maximum of list1.
A method average that returns average of list1.
A method median() that return median of lsit1 as follows:
If the number of elements are odd then the median is the middle one in the sorted list
If the number of elements is even, the median is the average of the middle two elements.
For example: the median of 1, 2, 2, 3, 5 is 2, then middle element. The median of 1, 2, 2, 3, 4, 5, is 2.5 the average of the two middle values 2 and 3.
Write a Java class TestDemoList, that has a main method to do the followings:
Create an object of DemoList class call it dl.
Call a proper method to fill dl with data.
Call a proper method to print content of dl.
Call a proper method to print content of dl after sorting it.
Call a proper method to print the maximum in dl.
Call a proper method to print the average of dl.
Call a proper method to print the median of dl.

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education