Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Implement and test a parametrized class. Design specifications Create a Java project project2 and a package package2. Design the Sequence class with E the
Please Implement and test a parametrized class.
Design specifications Create a Java project project2 and a package package2. Design the Sequence class with E the type parameter. Define a driver class containing a main method that exercises the class Sequence as an application. The two classes should be saved in different files. Create Junit 5 tests based on the method specifications and stubs. Implement the SequenceTest class and save it in a separate file. Define the methods in the Sequence class. For the append () method, if the data array is full, its capacity must be increased before the new element can be appended The size () method returns the value of the private size instance variable. The size variable keeps the current number of elements and should be updated when appending elements. There is no need to create an input file to test the methods for the Sequence class. a. 1. Creation of project2. Package should include: Driver class.. b. Sequence class. 2. Compilation and execution a. Driver class and Sequence class compile without errors. b. Correct answers on test data..... 3. Defined Sequence class The class is generic.. b. Has two private instance variables: data [] and size.. c. Has default constructor....... a. d. Has constructor with one parameter (the capacity). e. Has size () method. f. Has append (E element) method. Has get (k) method, returning an E type object, where k is an index. h. Has set (k, E newElement) method, where k is an index.. 4. JUnit tests in the SequenceTest class Provides at least one test for each method in the Sequence class for one data type. b. Provides at least one test for each method in the Sequence class for a second data type. 5. Naming conventions, style and comments. 6. Coding efficiency...... a. Design specifications Create a Java project project2 and a package package2. Design the Sequence class with E the type parameter. Define a driver class containing a main method that exercises the class Sequence as an application. The two classes should be saved in different files. Create Junit 5 tests based on the method specifications and stubs. Implement the SequenceTest class and save it in a separate file. Define the methods in the Sequence class. For the append () method, if the data array is full, its capacity must be increased before the new element can be appended The size () method returns the value of the private size instance variable. The size variable keeps the current number of elements and should be updated when appending elements. There is no need to create an input file to test the methods for the Sequence class. a. 1. Creation of project2. Package should include: Driver class.. b. Sequence class. 2. Compilation and execution a. Driver class and Sequence class compile without errors. b. Correct answers on test data..... 3. Defined Sequence class The class is generic.. b. Has two private instance variables: data [] and size.. c. Has default constructor....... a. d. Has constructor with one parameter (the capacity). e. Has size () method. f. Has append (E element) method. Has get (k) method, returning an E type object, where k is an index. h. Has set (k, E newElement) method, where k is an index.. 4. JUnit tests in the SequenceTest class Provides at least one test for each method in the Sequence class for one data type. b. Provides at least one test for each method in the Sequence class for a second data type. 5. Naming conventions, style and comments. 6. Coding efficiency...... aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started