Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Java language to implement Simple List Class SimpleList list : int[] count: int - + Simple List () + add (int): void + remove

Use Java language to implementimage text in transcribed

Simple List Class SimpleList list : int[] count: int - + Simple List () + add (int): void + remove (int): void + count (): int + toString (): String + search (): int Notice there is no main, no input and no output for this assignment. Method Descriptions SimpleList() - Create an array to hold 10 integers and set count to 0. add (int): void - Add the parameter to the list at the beginning (index=0). Move all the other integers in the list over so there is room. If the list was full, then the last element "falls off the list. Increment the count as needed. remove (int): void - If the parameter is in the list, then remove it. The other values in the list may need to be moved down. Adjust the count as needed. count (): int - Return the number of elements stored in the list. toString(): String - Return the list as a String. The elements must be separated by a space. This means there is not space after the last integer. search (int): int - Return the location of the parameter in the list. If the parameter is not in the list, then return -1

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

Step: 3

blur-text-image

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

Google Analytics 4 The Data Driven Marketing Revolution

Authors: Galen Poll

2024th Edition

B0CRK92F5F, 979-8873956234

More Books

Students also viewed these Databases questions