Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In contrast to the implementation requirements from Homework 3 , which required the use of a method to modularize the process of doubling the size
In contrast to the implementation requirements from Homework which required the use of a method to modularize the process of doubling the size of the array used to hold record data, Homework requires that functionality be encapsulated within a class. This must be a fully formed class with two constructors a noargument constructor that starts at a default size of and a constructor that takes a starting size as an argument accessor, and mutator methods. The mutator method must allow for an addition to the data stored which must automatically double the size of the allocated memory when necessary This class must be tested and shown to work correctly using unit testing JUnit as well as work in the final integrated program. In particular, you must be sure to test both constructors and the mutator that adds data, ensuring that this last method automatically doubles the size of the allocated memory, respectively. Also, in contrast with Homework which required the use of a simple class to hold data for each recordrow Homework requires the use of a class to encapsulate each record data and to display it using an overriding toString method. This class can have mutators and accessors. The headers of the classer are given below. Please use those as a starting for the homework. public class EVRecord necessary attributesfields necessary method to simplify the operations toString method to print with comma public class EVRecordArrayfinal static int for default size private int count; to hold how many elements are in the array private EVRecord data; to hold the records in an array public EVRecordArray public EVRecordArray int initialSizeadd method to add elements size method to return how many records in the array toString method for reverse other necessary method you think of In addition to these specific requirements, you must carefully consider how to organize the data such that it is easy to manipulate eg using looping constructs easy to understand by treating similar data in similar ways and helps to preserve data integrity eg by grouping related data together in structured ways You must use good programming style and documentation, including making your code modular, using explanatory comments for each section of code, using meaningful variable and method names, using consistent indentation, etc. You must follow Java conventions for compilation modules, including using an interface file for constant variables, prototypes, etc., and a source file for implementing methods, etc. You may write your program from scratch or may start from programs for which the source code is freely available on the web or through other sources such as friends or student organizations If you do not start from scratch, you must give a complete and accurate accounting of where your code came from and indicate which parts are original or changed and which you got from which other sources
Step 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