pre 37 words > Write a complete method from the client perspective to create a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
pre 37 words </> > ⠀ Write a complete method from the client perspective to create a new ListInterface object that contains all Strings on a wordList that contain a given character. The method header is: public static ListInterface<String> createListInterfaceContainingChar(Lis tInterface<String> word List, char targetChar) For Full Credit: • The relative order of the names in the returned list should match the order of the names in the parameter list. • The wordList parameter should be unchanged when the method completes. ⚫ Consider case/capitalization. (In other words, 'c' is different from 'C!) • Do not invoke the toArray() method. • Do not use another data structure, such as ArrayList or an array. ⚫ Note: You can use local objects of type ListInterface (initialized as AList or LList). Question 4 Paste the complete createListInterfaceContainingChar method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Write a complete method from the client perspective to find the last position of an itern in a List. The method header is: public static int lastPosition (List<String> word List, String target) For Full Credit: ⚫ The wordList parameter should be unchanged when the method completes. ⚫ If the item appears more than once, return the position of the last appearance. ⚫ Decide what to do if the item is not on the list. Make sure your action is logical. ⚫ Do not use the lastIndexOf method from the ArrayList class. ⚫ This question is essentially asking you to re-write this method for yourself. ⚫ You will receive 0 points if your method invokes lastIndexOf. Question 5 Paste your complete lastPosition method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Optional Extra Credit (10 points) Find the maximum value in a List and move that value to the front of the list. The method header is: public static void prioritizeMaximumValue(List<Integer> numberList) Notes: • If there is more than one copy of the maximum, you can move any one of those copies to the front. ⚫ Because there is more than one right answer here, the driver program does not include tests for this. I suggest adding your own tests. • You are not swapping values- but performing a shift by moving the maximum value to the front of the list. For Full Credit: • Take advantage of the methods provided in List rather than rewriting code to do the same task. . Your code should not crash with empty lists or one-element lists. • Do not use another data structure, such as ArrayList or an array. Question 45 Paste your complete prioritizeMaximumValue method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 0 pts Also remember that when working from the client interface, you do not know what the implementing class is! You only know that an object is of type BagInterface or ListInterface. You don't know what the actual type is (e.g., it could be ArrayBag, LinkedBag, or some other implementing class). For Full Credit: • • • Do not use the toArray method. • The purpose of the coding questions are to practice with the BagInterface, ListInterface, and List interfaces, not to work directly with arrays. Do not use a different data structure from the one in the question. ⚫ For example, in a coding question that uses BagInterface, do not use a List, ListInterface, ArrayList, array, etc.. • Post any questions about what data structures or classes you should and should not use to the discussion board. ⚫ Again, the reason for this is that I want you to get practice with these specific interfaces. You will be graded both on syntax (the code compiles) and semantics (the code accomplishes the task). Write a complete method from the client perspective that determines if a bag contains any duplicate items. For full credit, the parameter bag should have the same contents before and after the method executes. The method header is: public static boolean contains Duplicates (BagInterface<String> wordBag) For Full Credit: • Do not use another data structure, such as ArrayList or an array. Write a complete method from the client perspective to determine if a ListInterface and List of numbers have equivalent contents- meaning the same numbers in the same order. The method header is: public static boolean equivalent Lists (ListInterface<Integer> numberListInter face, List<Integer> numberList) For Full Credit: ⚫ Neither parameter list should be changed when the method completes. • ⚫ In order to be considered equivalent, the two lists should be the same size. Be sure to account for special sizes (e.g., 0 and 1). • Do not convert either list to an array. • Do not use another data structure, such as ArrayList, AList, or an array. Question 6 Paste your complete equivalentLists method here. Edit View Insert Format Tools Table 12pt Paragraph BIU A > T² 15 pts pre 37 words </> > ⠀ Write a complete method from the client perspective to create a new ListInterface object that contains all Strings on a wordList that contain a given character. The method header is: public static ListInterface<String> createListInterfaceContainingChar(Lis tInterface<String> word List, char targetChar) For Full Credit: • The relative order of the names in the returned list should match the order of the names in the parameter list. • The wordList parameter should be unchanged when the method completes. ⚫ Consider case/capitalization. (In other words, 'c' is different from 'C!) • Do not invoke the toArray() method. • Do not use another data structure, such as ArrayList or an array. ⚫ Note: You can use local objects of type ListInterface (initialized as AList or LList). Question 4 Paste the complete createListInterfaceContainingChar method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts pre 37 words </> > ⠀ Write a complete method from the client perspective to create a new ListInterface object that contains all Strings on a wordList that contain a given character. The method header is: public static ListInterface<String> createListInterfaceContainingChar(Lis tInterface<String> word List, char targetChar) For Full Credit: • The relative order of the names in the returned list should match the order of the names in the parameter list. • The wordList parameter should be unchanged when the method completes. ⚫ Consider case/capitalization. (In other words, 'c' is different from 'C!) • Do not invoke the toArray() method. • Do not use another data structure, such as ArrayList or an array. ⚫ Note: You can use local objects of type ListInterface (initialized as AList or LList). Question 4 Paste the complete createListInterfaceContainingChar method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts pre 37 words </> > ⠀ Write a complete method from the client perspective to create a new ListInterface object that contains all Strings on a wordList that contain a given character. The method header is: public static ListInterface<String> createListInterfaceContainingChar(Lis tInterface<String> word List, char targetChar) For Full Credit: • The relative order of the names in the returned list should match the order of the names in the parameter list. • The wordList parameter should be unchanged when the method completes. ⚫ Consider case/capitalization. (In other words, 'c' is different from 'C!) • Do not invoke the toArray() method. • Do not use another data structure, such as ArrayList or an array. ⚫ Note: You can use local objects of type ListInterface (initialized as AList or LList). Question 4 Paste the complete createListInterfaceContainingChar method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Write a complete method from the client perspective to find the last position of an itern in a List. The method header is: public static int lastPosition (List<String> word List, String target) For Full Credit: ⚫ The wordList parameter should be unchanged when the method completes. ⚫ If the item appears more than once, return the position of the last appearance. ⚫ Decide what to do if the item is not on the list. Make sure your action is logical. ⚫ Do not use the lastIndexOf method from the ArrayList class. ⚫ This question is essentially asking you to re-write this method for yourself. ⚫ You will receive 0 points if your method invokes lastIndexOf. Question 5 Paste your complete lastPosition method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Write a complete method from the client perspective to find the last position of an itern in a List. The method header is: public static int lastPosition (List<String> word List, String target) For Full Credit: ⚫ The wordList parameter should be unchanged when the method completes. ⚫ If the item appears more than once, return the position of the last appearance. ⚫ Decide what to do if the item is not on the list. Make sure your action is logical. ⚫ Do not use the lastIndexOf method from the ArrayList class. ⚫ This question is essentially asking you to re-write this method for yourself. ⚫ You will receive 0 points if your method invokes lastIndexOf. Question 5 Paste your complete lastPosition method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Write a complete method from the client perspective to find the last position of an itern in a List. The method header is: public static int lastPosition (List<String> word List, String target) For Full Credit: ⚫ The wordList parameter should be unchanged when the method completes. ⚫ If the item appears more than once, return the position of the last appearance. ⚫ Decide what to do if the item is not on the list. Make sure your action is logical. ⚫ Do not use the lastIndexOf method from the ArrayList class. ⚫ This question is essentially asking you to re-write this method for yourself. ⚫ You will receive 0 points if your method invokes lastIndexOf. Question 5 Paste your complete lastPosition method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 10 pts Optional Extra Credit (10 points) Find the maximum value in a List and move that value to the front of the list. The method header is: public static void prioritizeMaximumValue(List<Integer> numberList) Notes: • If there is more than one copy of the maximum, you can move any one of those copies to the front. ⚫ Because there is more than one right answer here, the driver program does not include tests for this. I suggest adding your own tests. • You are not swapping values- but performing a shift by moving the maximum value to the front of the list. For Full Credit: • Take advantage of the methods provided in List rather than rewriting code to do the same task. . Your code should not crash with empty lists or one-element lists. • Do not use another data structure, such as ArrayList or an array. Question 45 Paste your complete prioritizeMaximumValue method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 0 pts Optional Extra Credit (10 points) Find the maximum value in a List and move that value to the front of the list. The method header is: public static void prioritizeMaximumValue(List<Integer> numberList) Notes: • If there is more than one copy of the maximum, you can move any one of those copies to the front. ⚫ Because there is more than one right answer here, the driver program does not include tests for this. I suggest adding your own tests. • You are not swapping values- but performing a shift by moving the maximum value to the front of the list. For Full Credit: • Take advantage of the methods provided in List rather than rewriting code to do the same task. . Your code should not crash with empty lists or one-element lists. • Do not use another data structure, such as ArrayList or an array. Question 45 Paste your complete prioritizeMaximumValue method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 0 pts Optional Extra Credit (10 points) Find the maximum value in a List and move that value to the front of the list. The method header is: public static void prioritizeMaximumValue(List<Integer> numberList) Notes: • If there is more than one copy of the maximum, you can move any one of those copies to the front. ⚫ Because there is more than one right answer here, the driver program does not include tests for this. I suggest adding your own tests. • You are not swapping values- but performing a shift by moving the maximum value to the front of the list. For Full Credit: • Take advantage of the methods provided in List rather than rewriting code to do the same task. . Your code should not crash with empty lists or one-element lists. • Do not use another data structure, such as ArrayList or an array. Question 45 Paste your complete prioritizeMaximumValue method here. Edit View Insert Format Tools Table 12pt Paragraph BIUA ✓ 0 pts Also remember that when working from the client interface, you do not know what the implementing class is! You only know that an object is of type BagInterface or ListInterface. You don't know what the actual type is (e.g., it could be ArrayBag, LinkedBag, or some other implementing class). For Full Credit: • • • Do not use the toArray method. • The purpose of the coding questions are to practice with the BagInterface, ListInterface, and List interfaces, not to work directly with arrays. Do not use a different data structure from the one in the question. ⚫ For example, in a coding question that uses BagInterface, do not use a List, ListInterface, ArrayList, array, etc.. • Post any questions about what data structures or classes you should and should not use to the discussion board. ⚫ Again, the reason for this is that I want you to get practice with these specific interfaces. You will be graded both on syntax (the code compiles) and semantics (the code accomplishes the task). Write a complete method from the client perspective that determines if a bag contains any duplicate items. For full credit, the parameter bag should have the same contents before and after the method executes. The method header is: public static boolean contains Duplicates (BagInterface<String> wordBag) For Full Credit: • Do not use another data structure, such as ArrayList or an array. Also remember that when working from the client interface, you do not know what the implementing class is! You only know that an object is of type BagInterface or ListInterface. You don't know what the actual type is (e.g., it could be ArrayBag, LinkedBag, or some other implementing class). For Full Credit: • • • Do not use the toArray method. • The purpose of the coding questions are to practice with the BagInterface, ListInterface, and List interfaces, not to work directly with arrays. Do not use a different data structure from the one in the question. ⚫ For example, in a coding question that uses BagInterface, do not use a List, ListInterface, ArrayList, array, etc.. • Post any questions about what data structures or classes you should and should not use to the discussion board. ⚫ Again, the reason for this is that I want you to get practice with these specific interfaces. You will be graded both on syntax (the code compiles) and semantics (the code accomplishes the task). Write a complete method from the client perspective that determines if a bag contains any duplicate items. For full credit, the parameter bag should have the same contents before and after the method executes. The method header is: public static boolean contains Duplicates (BagInterface<String> wordBag) For Full Credit: • Do not use another data structure, such as ArrayList or an array. Also remember that when working from the client interface, you do not know what the implementing class is! You only know that an object is of type BagInterface or ListInterface. You don't know what the actual type is (e.g., it could be ArrayBag, LinkedBag, or some other implementing class). For Full Credit: • • • Do not use the toArray method. • The purpose of the coding questions are to practice with the BagInterface, ListInterface, and List interfaces, not to work directly with arrays. Do not use a different data structure from the one in the question. ⚫ For example, in a coding question that uses BagInterface, do not use a List, ListInterface, ArrayList, array, etc.. • Post any questions about what data structures or classes you should and should not use to the discussion board. ⚫ Again, the reason for this is that I want you to get practice with these specific interfaces. You will be graded both on syntax (the code compiles) and semantics (the code accomplishes the task). Write a complete method from the client perspective that determines if a bag contains any duplicate items. For full credit, the parameter bag should have the same contents before and after the method executes. The method header is: public static boolean contains Duplicates (BagInterface<String> wordBag) For Full Credit: • Do not use another data structure, such as ArrayList or an array. Write a complete method from the client perspective to determine if a ListInterface and List of numbers have equivalent contents- meaning the same numbers in the same order. The method header is: public static boolean equivalent Lists (ListInterface<Integer> numberListInter face, List<Integer> numberList) For Full Credit: ⚫ Neither parameter list should be changed when the method completes. • ⚫ In order to be considered equivalent, the two lists should be the same size. Be sure to account for special sizes (e.g., 0 and 1). • Do not convert either list to an array. • Do not use another data structure, such as ArrayList, AList, or an array. Question 6 Paste your complete equivalentLists method here. Edit View Insert Format Tools Table 12pt Paragraph BIU A > T² 15 pts Write a complete method from the client perspective to determine if a ListInterface and List of numbers have equivalent contents- meaning the same numbers in the same order. The method header is: public static boolean equivalent Lists (ListInterface<Integer> numberListInter face, List<Integer> numberList) For Full Credit: ⚫ Neither parameter list should be changed when the method completes. • ⚫ In order to be considered equivalent, the two lists should be the same size. Be sure to account for special sizes (e.g., 0 and 1). • Do not convert either list to an array. • Do not use another data structure, such as ArrayList, AList, or an array. Question 6 Paste your complete equivalentLists method here. Edit View Insert Format Tools Table 12pt Paragraph BIU A > T² 15 pts Write a complete method from the client perspective to determine if a ListInterface and List of numbers have equivalent contents- meaning the same numbers in the same order. The method header is: public static boolean equivalent Lists (ListInterface<Integer> numberListInter face, List<Integer> numberList) For Full Credit: ⚫ Neither parameter list should be changed when the method completes. • ⚫ In order to be considered equivalent, the two lists should be the same size. Be sure to account for special sizes (e.g., 0 and 1). • Do not convert either list to an array. • Do not use another data structure, such as ArrayList, AList, or an array. Question 6 Paste your complete equivalentLists method here. Edit View Insert Format Tools Table 12pt Paragraph BIU A > T² 15 pts
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
Data set Theory Assume an informational record with one association parent including matches (a, b) where a can't try not to be a parent of b. (a) Write a Datalog demand which gives the graph of...
-
A random sample of 100 students was taken from a large university to study the relationship between GPA and the number of hours of study per week. The following linear regression equation was...
-
Gustave Orsen, an introductory accounting student, thinks that a double-entry accounting system means that each transaction is recorded twice. Is Gustave correct? Explain.
-
Reshier Company makes three types of rug shampooers. Model 1 is the basic model rented through hardware stores and supermarkets. Model 2 is a more advanced model with both dry and wet-vacuuming...
-
The stochastic process \(S_{t}\) is a GBM with drift coefficient 2 and volatility coefficient 3. Write the stochastic differential equation for the process = Y (St 10) e-2t_
-
Doorharmony Company makes doorbells. It has a weighted average cost of capital of 8% and total assets of $ 5,450,000. Doorharmony has current liabilities of $ 600,000. Its operating income for the...
-
1. How has the increase in patient cost sharing amounts changed the provider that a patient might select for care? 2. What other information beyond the price of a service must be known to determine...
-
On 19 January 2023 due to a Board of Directors' decision to concentrate on core activities, the group's board committed itself to sell its seafood operation (Division 4) Consisting of only trawlers...
-
y=x^(2)+5x-6 State the domain State the range Find the x-intercept Find the y-intercept Determine the vertex point
-
Dander Mifflin is a paper company in the process of identifying their mission and goals for the next few years, as well as conducting an internal and external analysis. Dander Mifflin is at which...
-
The side wall of the window is square in shape and its length is given as 1618 feet. Find the area of the side wall of the window.
-
Actual value is at the highest dotted line, right under is the earned value and at the lowest is the actual cost. a. At the time of the dotted line is the project over budget, on budget, or under...
-
Management: Principles and Applications , The management planning process can be simple or complex. It is very important to differentiate between the two. How are plans with incremental objectives...
-
Lanthanides and actinides. Are they metals or non-metals? Explain
-
Provide an example of an aggressive accounting practice. Why is this practice aggressive?
-
Is the following valid code? If so, what does it print? cout < < (int *) Home of the jolly bytes;
-
Write a statement that assigns the sum of the first and last elements of the array in Question 3 to the variable even. Data From Question 3 Declare an array of five ints and initialize it to the...
-
Begin with the following structure declaration: struct chaff { char dross[20]; int slag; }; Write a program that uses placement new to place an array of two such structures in a buffer.Then assign...
-
The following accounts and amounts (balances are normal balances) were taken from the records of Prider Manufacturers Ltd at 30 June 2019. Required (a) Prepare a cost of goods manufactured statement...
-
The following data were taken from the records of Manik Manufacturing Ltd for the year ended 30 June 2019. Required (a) Prepare the cost of goods manufactured schedule for the year ended 30 June...
-
The following demonstration problem illustrates the use of the general journal, the four special journals introduced here, and the general ledger with two subsidiary ledgers. Sidney Carton began...
Study smarter with the SolutionInn App