Write a method beyondLastEntry(position) for the class OneWayNo-RepeatsList, as given in Listing 7.9, that returns true when
Question:
Write a method beyondLastEntry(position) for the class OneWayNo-RepeatsList, as given in Listing 7.9, that returns true when position is beyond the last entry on the list.
Listing 7.9
Transcribed Image Text:
/** An object of this class is a special kind of list of strings. You can write the list only from beginning to end. You can add only to the end of the list. You cannot change individual entries, but you can erase the entire list and start over. No entry may appear more than once on the list. You can use int variables as position markers into the list. Position markers are similar to array indices, but are numbered starting with 1. * / public class OneWayNoRepeatsList public static int START POSITION = 1; public static int DEFAULT SIZE = 50; //entry.length is the total number of items you have room //for on the list (its capacity); countofEntries is the number of //items currently on the list. private int countofEntries; //can be less than entry.length. private String[] entry; /** Creates an empty list with a given capacity. */ public OnewayNoRepeatsList (int maximumNumberofEntries) entry = new String [maximumNumberofEntries]; countofEntries = 0; /** Creates an empty list with a capacity of DEFAULT SIZE. */ public OneWayNoRepeatsList () entry = new String [DEFAULT SIZE]; = 0; countofEntries // or replace these two statements with this (DEFAULT SIZE); public boolean isFull ()
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (8 reviews)
ANSWER public boolean beyondLastEntry int position return p...View the full answer
Answered By
Churchil Mino
I have been a tutor for 2 years and have experience working with students of all ages and abilities. I am comfortable working with students one-on-one or in small groups, and am able to adapt my teaching style to meet the needs of each individual. I am patient and supportive, and my goal is to help my students succeed.
I have a strong background in math and science, and have tutored students in these subjects at all levels, from elementary school to college. I have also helped students prepare for standardized tests such as the SAT and ACT. In addition to academic tutoring, I have also worked as a swim coach and a camp counselor, and have experience working with children with special needs.
0.00
0 Reviews
10+ Question Solved
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Question Posted:
Students also viewed these Computer science questions
-
Add a method insertionSort to the class ArraySorter, as given in Listing 7.10, that performs an insertion sort of an array. To simplify this project, our insertion sort algorithm will use an...
-
Add a method bubbleSort to the class ArraySorter, as given in Listing 7.10, that performs a bubble sort of an array. The bubble sort algorithm examines all adjacent pairs of elements in the array...
-
Revise the class OneWayNoRepeatsList, as given in Listing 7.9, so that it allocates an extra element in the array entry and ignores entry[0], as suggested earlier near the end of the section entitled...
-
3. Questions A venture capitalist (VC) is willing to invest 100m for 20% ownership of a start-up that is looking to achieve scale. All existing shares are common shares, and this deal would result in...
-
Repeat Prob. 9-52E using constant specific heats at room temperature. Prob. 9-52E An air-standard Diesel cycle has a compression ratio of 18.2. Air is at 1208F and 14.7 psia at the beginning of the...
-
A $25,000, 91-day Province of Newfoundland Treasury bill was originally purchased at a price that would yield the investor a 1.438% rate of return if the T-bill is held until maturity. Thirty-four...
-
What characteristics are required in a safety PLC?
-
Thomas Company reports the following direct labor information for one of its products for April: Standard rate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . $21.00 per hour Actual rate...
-
Smith Electronic Company's chip-mounting production department had 300 units of unfinished product, each 50% completed on September 30. During October of the same year, this department put another...
-
The number of total vetoes exercised by the past 20 Presidents is listed below. Use the data to construct a grouped frequency distribution and a cumulative frequency distribution with 5 classes. What...
-
Create a GUI application that draws the following picture of a magic wand, using polygons and polylines:
-
Practice Program 2 used two arrays to implement a simple phone book. A more scalable solution is to make an array of an object that stores the name and corresponding phone number. Modify the program...
-
A local finance company quotes an interest rate of 17.1 percent on one-year loans. So, if you borrow $20,000, the interest for the year will be $3,420. Because you must repay a total of $23,420 in...
-
For a conceptual single-phase phase-shifting transformer, the primary voltage leads the secondary voltage by \(30^{\circ}\). A load connected to the secondary winding absorbs \(110 \mathrm{kVA}\) at...
-
A single-phase 100-kVA, 2400/240-volt, 60-Hz distribution transformer is used as a step-down transformer. The load, which is connected to the 240 -volt secondary winding, absorbs \(60 \mathrm{kVA}\)...
-
Consider a bank of three single-phase two-winding transformers whose high-voltage terminals are connected to a three-phase, \(13.8-\mathrm{kV}\) feeder. The low-voltage terminals are connected to a...
-
An S corporation has the following information: Compute the S$ corporation's taxable income for the year. Sales Dividend income Tax-exempt interest Long-term capital gain Short-term capital gain Cost...
-
For a completely transposed three-phase line identical conductors, each with GMR denoted \(\mathrm{D}_{\mathrm{S}}\) with conductor distance \(\mathrm{D}_{12}, \mathrm{D}_{23}\), and...
-
At most, how many bright fringes can be formed on either side of the central bright fringe when light of wavelength 625 nm falls on a double slit whose slit separation is 3.76 10-6 m?
-
In Problem use geometric formulas to find the unsigned area between the graph of y = f(x) and the x axis over the indicated interval. f(x) = x + 5; [0, 4]
-
Give an example set of denominations of coins so that a greedy change-making algorithm will not use the minimum number of coins.
-
Describe an efficient greedy algorithm for making change for a specified value using a minimum number of coins, assuming there are four denominations of coins (called quarters, dimes, nickels, and...
-
Give an efficient algorithm for deleting a string from a standard trie and analyze its running time.
-
Given the matrix A -3 0 -14 3 4 6 9115 7701 a) Determine all solutions of the homogeneous system Ax = 0. b) Determine if the columns of A span R.
-
Summarize each data source and include them for substance abuse and alcohol in the military. Analyze each data source for substance abuse and alcohol in the military for trustworthiness and accuracy....
-
On January 1, 2023, Holland Corporation paid $7 per share to a group of Zeeland Corporation shareholders to acquire 60,000 shares of Zeeland's outstanding voting stock, representing a 60 percent...
Study smarter with the SolutionInn App