Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

in java Consider an ADT called String Series, which allows access to Strings in sequential order. StringSeries has a cursor which points to some String

image text in transcribed
image text in transcribed
in java
Consider an ADT called String Series, which allows access to Strings in sequential order. StringSeries has a cursor which points to some String in the Series. When a Series is instantiated, the cursor is set to the first String in the series. Put your work in a package named hw2. Series supports the following public operations: void add(String s): adds the String s to the end of the series String get(): return a reference to the String that the cursor currently points to void advance(): Advance the cursor to the String following the one it currently points to, or throw an Exception if the cursor already points to the last String (just use Exception with the error message "no element found"); void retreat(): Move the cursor back one String in the String Series, or throw an exception if it already points to the first String int size(): Return the number of Strings in the String Series Part A: 25 points Create the Java interface String Series, which includes all the methods shown above Part B: 50 points Create the class ArrayString Series, which implements String Series using an underlying array of 10 Strings. In other words, ArrayStringSeries has a private varaay of ten Strings. Note that ArrayStringSeries will need a constructor that creates an array of 10 Strings. you will need to keep track of how many Strings are in the String Series at any time, since it may be less than 10 this implementation will not be able to hold a StringSeries with more than 10 Strings Part C: 25 points Write a driver class that creates an ArrayString Series and runs the operations shown in the example above, printing the results. Also turn in a text file with file name extension .txt containing the output from a run of your driver. Make sure the return values are correct

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

Students explore these related Databases questions