Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Main topics: Arrays ArrayLists Exercise This week we will be practicing writing a portion of a class, that emulates some of the features of

Java

Main topics:

Arrays

ArrayLists

Exercise

This week we will be practicing writing a portion of a class, that emulates some of the features of a Java ArrayList. You will be writing five of the methods from this weeks homework (Assignment 5).

Getting Started

To start this exercise, you should:

1. Open eclipse and start a new Java project named Lab05

2. Add a Class (named DynArray) to this project, and copy the contents of the DynArray.java file provided into it.

3. Add a Class (named DynArrayDriver) to this project, the contents of which you will be writting from scratch.

Requirements

DynArray.java

A very simple class which models some of the functionality of the Java ArrayList. This class is not complete and must be modified as such:

1. Write the method body for the default constructor

2. Write the method body for the method arraySize()

3. Write the method body for the method elements()

4. Write the method body for the method grow()

5. Write the method body for the method shrink()

DynArrayDriver.java

A simple driver class to test your DynArray class, you must write this class from scratch

--------------------------------------------------------------------------

DynArray Class

public class DynArray { private double[] array; private int size; private int nextIndex; public int arraySize() {

} public int elements() {

} public DynArray() {

} private void grow() {

} private void shrink() {

} }

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions