Answered step by step
Verified Expert Solution
Link Copied!

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 3, which required the use of a method to modularize the process of doubling the size of the array used to hold record data, Homework 5 requires that functionality be encapsulated within a class. This must be a fully formed class with two constructors (a no-argument constructor that starts at a default size of 10 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 3, which required the use of a simple class to hold data for each record/row, Homework 5 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 attributes/fields // necessary method to simplify the operations // toString method to print with comma } public class EVRecordArray{//final 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 initialSize){}//add 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 (e.g., using looping constructs), easy to understand (by treating similar data in similar ways), and helps to preserve data integrity (e.g., 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 source(s).

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago