Reference no: EM1317340
2. Before we developed a StringLog ADT. It represents a "log" that holds objects of class String. Suppose that instead of restricting ourselves to strings, we decided to create a "log" that holds objects of type Object. Describe the changes you would have to make to each of the following classes to implement such a change.
a. Change StringLogInterface to ObjectLogInterface
b. Change ArrayStringLog to ArrayObjectLog
c. Change ITDArrayStringLog to ITDArrayObjectLog
d. Change LLStringNode to LLObjectNode
e. Change LinkedStringLog to LinkedObjectLog
2. Write a class Array that encapsulates an array and provides bounds-checked access. The private instance variables should be int index and inarray[10]. The public members should be a default constructor and methods (signatures shown below) to provide read and write access to the array.
void insert(int location, int value);
void retrieve(int location);
If the location is within the correct range for the array, the insert method should set that location of the array to the value. Likewise, if the location is within the correct range for the array, the retrieve method should return the value at that location--the approach taken by the library before Java 5.0. In either case, if location is not within the correct range, the method should throw an exception of class ArrayOutOfBoundsException. Write an application that helps you test your implementation. Your application should assign values to the array by using the insert method, then use the retrieve method to read these values back from the array. It should also try calling both methods with illegal location values. Catch any exceptions thrown by placing the "illegal" calls in a try block with an appropriate catch. Share your code with classmates and compare and discuss the various implementations.
Research and writing
: Research and Writing: Brief Assignment, Review the fact pattern provided below. At this time, Mr. Kant stands convicted of either petit larceny or shoplifting, as dictated by your state statutes,
|
Measure the distance pa, pb, pc
: Measure the distance PA, PB, PC etc. from p to various point with chain or tape and plot them to scale along the co responding rays. Join the points a, b, c, etc. to give outline of survey.
|
Insert uml design diagrams, use case, classes
: Insert UML design diagrams here (use case, class, and sequence diagram).
|
Create your own date class
: You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:
|
Write a class array that encapsulates an array
: Write a class Array that encapsulates an array and provides bounds-checked access. The private instance variables should be int index and inarray[10]. The public members should be a default constructor and methods (signatures shown below) to provide ..
|
Uml exercise
: UML Exercise: Automated Teller Machine (ATM), 1. To allow authorized card holders to make transactions, Brief Summary of Requirements:
|
What is economics system
: What is economics system? What are the types of economics system? Briefly explain each type of economics system by giving examples of nations that are close to each type
|
A sewage treatment works stw
: A sewage treatment works (STW) with 4 single-stage trickling filters has become organically overloaded due to the discharge of a biodegradable industrial effluent to the STW. This is causing effluent to pond on the surface of the filters.
|
Use an article that simply explains
: use an article that simply explains or describes something (8 Steps to...; How to...; etc.). Find an article on this in a professional journal in your field and be sure that the author is making a case for something. Then:
|