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: 66% (9 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...
-
Which assumed inventory cost flow method? (a) Usually parallels the actual physical flow of merchandise? (b) Assumes that goods available for sale during an accounting period are identical? (c)...
-
\(\left(\frac{2}{5} \times\left(\frac{7}{8}-\frac{2}{3} ight) ight)^{2} \div\left(\frac{4}{9}+\frac{5}{6} ight)+\frac{7}{12}\) Perform the indicated operations. Reduce to lowest terms.
-
Brisky Corporation had net sales of $2,400,000 and interest revenue of $31,000 during 2012. Expenses for 2012 were: cost of goods sold $1,450,000; administrative expenses $212,000; selling expenses...
-
Manning Company issued 10,000 shares of its $5 par value ordinary shares having a fair value of $25 per share and 15,000 shares of its $15 par value preference shares having a fair value of $20 per...
-
Allie has bought a new apple orchard. The orchard has a single file of trees, numbered from 1 to N. Each tree has a certail number of ripe apples. Allie has a rule she wants to follow. She wants to...
-
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...
-
Subtract in the indicated base. 3536 -2446
-
Rose is considering investing $5,500 dollars at the end of each year for the next 40 years. Assuming she anticipates receiving a rate of return of 6.2% compounded annually, what will be the value of...
-
32. [G1] Consider the three functions given parametrically by f:x=0.75t, y=t g:x=ty=f h:x=-f,y=t Consider also the five graphs below labelled I, II, III, IV, and V. Select all that apply and enter...
-
What are the key challenges in using advanced absorbents, like metal-organic frameworks (MOFs) or zeolites, in gas-phase absorption processes? Discuss their impact on capacity, selectivity, and...
-
A history professor at Hamline University in Minnesota has irritable bowel syndrome, obsessive-compulsive disorder, and generalized anxiety disorder and was unable, according to the professor's...
-
A dog training business began on December 1 . The following transactions occurred during its first month. December 1 Receives $ 3 0 , 0 0 0 cash as an owner investment in exchange for common stock....
-
A bear market in the stock market is defined as a condition in which the market declines by 20% or more over the course of at least two months. The following data represent the number of months and...
-
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.
-
1. Greyson Company wants to earn a 6% return on sales after taxes. The company's effective income tax rate is 40%, and its contribution margin is 30%. If Greyson has fixed costs of P240,000, what is...
-
step by step solution pls. ABC Inc. produces customized vans in a food carts order shop: [in November 1, the following balances appear in the inventory records: Finished goods P1?9,000 Work in...
-
Finish the problem... current operation is 100 cow calf operation wants to switch to 200 stocker steers, is using partial budgeting to see if it's a good choice. Information of current cow calf...
Study smarter with the SolutionInn App