Write a complete method to create a modified ArrayList. Method Specifications The method takes in an ArrayList of Strings as a parameter. The method creates and returns a new ArrayList of Strings that contains only the Strings from the parameter list that start with a letter or digit. Any Strings that do not start with a letter or digit (e.g., start with: & * ! \t etc.) should not be added to the new list. The list parameter should not be changed. Hint: Review the static methods of Character class! Test Cases Here are some lists I suggest using for testing. Parameter ArrayList ["hello!", "?what", "email@com", "#javarules", "3blindmice", "&more"] ["no!", "answers?", "found#here", "4sure"] ["$money", "^carrot", "(parens", ")parensclose", "\ttab"] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["\"a\"", "\'b\"", "c"] Returned ArrayList ["hello!", "email@com", "3blindmice"] ["no!", "answers?", "found#here", "4sure"] [] ["Apple!", "Ball?", "Carrot."] ["1", "2", "3", "4"] ["c"]
Q: IMAGE EDITING APP and AUTO-TUNE APP are two of the most used applications now a days. It helps…
A: The question is does the use of IMAGE EDITING APP and AUTO-TUNE APP is ethical or unethical.
Q: What are the roles of the approval committee during the different SDLC phases ?
A: answer is
Q: I need a C++ program that can write a program to show a greeting script the robot can use later. the…
A: cout is used to print on console cin is used to accept input \n is character literal used to print…
Q: Learn about the similarities and differences between an assembler, a compiler, and an interpreter.
A: Compiler :It is software that translates high-level language applications into machine language.…
Q: this is not in visual studio
A: Have this code in the visual studio below is the program and output in visual studio
Q: Which of the following functions can be invoked with two arguments? a. def lambda (): pass b. def…
A: Option a) This is a syntax error. lambda is a reserved keyword in python and cannot be used as a…
Q: Answer quickly The piece of hardware that TEMPORARILY holds data and programs is called: A.…
A: The question has been answered in step2
Q: This may be used to explain why some block cypher modes of operation rely solely on encryption,…
A: Intro An algorithm is utilized that makes use of a block cipher so that information security may be…
Q: A. The logic of an algorithm can be tested using a _____. Select one: a. desk checking b. all of the…
A:
Q: Which of the following can you do on the Internet? A. Send Emails B. Online Shopping C. All of…
A: The Internet is a vast network that connects various computers all over the world.
Q: There are only three basic constructs in Prolog: facts, rules, and queries. A collection of facts…
A:
Q: I need ideas for a Python programming project that includes the handling of an input file (data or…
A: Python programming for handling input file
Q: Let P and V are two atomic operations P represents wait and V represents signal operation. Counting…
A: I will explain it in details,
Q: Show the result of applying the following operators to the following image. Consider padding the…
A: So the matrix after padding is :- 0 0 0 0 0 0 95 100 105 0 0 105 100 110 0 0 85 95 105 0…
Q: In GSM, a "TDMA frame" is composed of eight distinct time slots. Each GSM time slot is 577 s…
A: Eight time slot's and 577 microsecond"s are available in each time's slots in a TDMA frameworks.…
Q: Develop an activity diagram of the following scenario The 2021 IEEE 23rd International Multitopic…
A: Activity diagram:⦁ It is one of the UML diagrams under behavioral category.⦁ It is used to explain…
Q: The teams is a sports competition are divided into six groups with five teams in each group. Each…
A: The complete program constraints(Assoc,Es,Ts) :- core_constraints(Assoc,Es,Ts),…
Q: tox. what the advantages and disadvantages of array representation g linked они диетво list…
A: Stack and queue is a type of container in which objects are inserted and removed by the different…
Q: Create a class Time which contains: ● Hours Minutes Seconds • Write a C++ program using operator…
A: The above question that is the c++ program using operator overloading is answered in the step 2 and…
Q: Write a program that initialises a vector with the following string values: "what" "book" "is"…
A: CODE in C++ : // include the required header files #include <iostream> #include <vector>…
Q: Is it beneficial for those with physical or mental disabilities to use the internet? What new…
A: Introduction Internet access improves the life of visually challenged individuals. The internet…
Q: Explain why computer keeping track of client needs is crucial for systems analysts.
A: Introduction: Identifying the particular criteria that the system must meet is the most challenging…
Q: Explain the differences between Abstract Classes and Interfaces in Java.
A: Explain the differences between Abstract Classes and Interfaces in Java.
Q: In GSM, a "TDMA frame" is composed of eight distinct time slots. Each GSM time slot is 577 s…
A: The answer is
Q: What is the difference between EPROM, EEPROM, and Flash Memory, and why should you care?
A: Introduction: Flash employs NAND memory, EEPROM NOR. Flash may be erased block-by-block, not EEPROM…
Q: Using examples, describe a real-time operating system. What sets it apart from other operating…
A: Intro Operating systems that are designed for real-time applications (RTOS) must handle data and…
Q: response page checks username and password against arrays of valid usernames and passwords (normally…
A: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8">…
Q: In the access network for remote PHY (R-PHY), what generates the DOCSIS downstream signal and…
A: According to the information given:- We have to choose the correct option to satisfied the…
Q: Please help... C++ Basic Arithmetic You are a cook in a restaurant. You need exactly 3 crabs to cook…
A: PROGRAM INTRODUCTION: Include the required header files. Start definition of the main function.…
Q: Write a sub that creates an array day of size 7 and then populates it with the days of the week…
A: The question is asking to solve in VBA code as we have to create sub. The complete VBA Code is…
Q: To distribute an inheritance to VB Question: Write a program in the language of two people in a 1:3…
A: I have given answered in the handwritten format in brief explanation.
Q: Describe the programmable keyboard/display interface IC 8279's operation.
A: 8279 programmable keyboard/display controller: Intel created the tool to link the keyboard interface…
Q: 01: The local Driver's License Office has asked you to write a program that grades the writ- ten…
A: Below is the complete solution with explanation in detail for the given question. Note:- Here, the…
Q: Why would you use an indexed search in EnCase?
A: answer is
Q: An attacker who adds commands to a database query has likely used A. SQL injection B. command…
A: According to the information given:- we have to choose the correct option to satisfy the statement.
Q: Consider a PUBLICATION COMPANY database in which data requirements are summarized as follows: Every…
A: Solution:- The entity list along with underlined primary keys are :- 1)…
Q: Write a complete method to create an expanded String array. Method Specifications The method takes…
A: public class Main { public static String[] expandArray(String[] original) { // length of…
Q: et is equal to 4C tart byte of pay sequence num
A:
Q: Kirana Hospital needs a program to compute and print a bill statement for each patient. The charges…
A: Program: #include <iostream>using namespace std;int main() { int n; char…
Q: This program will ask the user to input a number (suppose num). And that outputs the first num'th…
A: As no programming language is mentioned, it is solved using basic C++
Q: What are the three types of processors that may be found in embedded systems
A: Application Specific System Processor(ASSP): Application-dependent system processors, or ASSPs, are…
Q: Simple System Design for chat message app
A: A chat application fills various roles for various individuals. It is critical to make certain about…
Q: Consider the problem of the equivalence of the languages of two DFAs, formulate it as a language,…
A: Hello student I will explain this solution with my best of knowledge
Q: QUESTION 2: A Backup Script Write a script called: backup SWITCH FILES DEST MESSAGE Example:…
A: I will explain it in details,
Q: The InstantRide Management team founded a new team for car maintenance. The new team is responsible…
A: Hello student I am going to explain you about this question in next step
Q: program in the language of two people in a 1:3 ratio, if the heir is male, the share is…
A: Hello student :- I will provide the code refrence phtos And also give the output
Q: Describe general categories of unethical and illegal behaviour in computer science.
A: Introduction: Three broad forms of unethical activity are ignorance, accident, and purpose.
Q: Write a Custom Python Function Multiply Matrices
A: Introduction: Below python program to multiply matrices with custom function
Q: I have written some code however I am receiving error for task 1 and 2 as they are not completed for…
A: I will explain it in details,
Q: Example 1: Assume the following: nCode = 123456789 and nDigitInfo = 4113: The numbers found in…
A: In this, they have already given all the functions to be used, and we are not allowed to use any own…
Java
Step by step
Solved in 2 steps with 1 images
- Please Use java only. Inthisassignment,youwillimplementaclasscalledCustomIntegerArrayList. Thisclass represents a fancy ArrayList that stores integers and supports additional operations not included in Java's built-in ArrayList methods. For example, the CustomIntegerArrayList class has a “splice” method which removes a specified number of elements from the CustomIntegerArrayList, starting at a given index. For a CustomIntegerArrayList that includes: 1, 2, 3, 4, and 5, calling splice(1, 2) will remove 2 items starting at index 1. This will remove 2 and 3 (the 2nd and 3rd items). The Cu stomIntegerArrayList class has 2 different (overloaded) constructors. (Remember, an overloaded constructor is a constructor that has the same name, but a different number, type, or sequence of parameters, as another constructor in the class.) Having 2 different constructors means you can create an instance of the CustomIntegerArrayList class in 2 different ways, depending on which constructor you…Use the Iterator Pattern: Create a class called Exercise, and then, in its main method, create an ArrayList called stringArrayList. Add the following five strings to stringArrayList: “one”, “two”, ”three”, ”four”, ”five”. Then, use a for loop and the index of stringArrayList to print all these five strings out to the console. 2. For stringArrayList above, can you use an iterator to traverse the five strings inside, without using the index? 3. If change stringArrayList into a TreeSet, how do you traverse the five strings use an iterator? Implement an Iterator: 4. Create a class called StringArray that is able to store a number of String objects. Create an instance variable, String[] values, (internal data storage) of StringArray to store all the strings. 5. Create a constructor for StringArray, which is able to build an object of StringArray using the parameter. public StringArray(String[] values) 6. Make the class StringArray implements Iterable So that it…Write a Program in Java programming: Support you have an ArrayList containing random integers. These integers can be any number, and each integer can appear more than once. For example, [2, 19, 21, 19, 21, 1, 3, 3, 6, 21, .....] Your job is to write a method called findEvenFrequentNumbers(ArrayList<Integer> list) that returns an ArrayList which has all the numbers appears in even frequency and in increasing order. e.g. list = [2, 19, 21, 19, 21, 1, 3, 3, 6, 21], should return [3, 19] list = [3, 3, 3, 1, 2, 2, 2, 2, 2], should return [] list = [1, 1, 1, 1, 1], should return [1] Note that you need to provide a class with the main function and also the imports.
- Implement unique method that takes an ArrayList as input and returns an ArrayList withexactly a single occurrence of each element from the input list. For example, if the input listcontains 5, 6, 7, 6, 3, 5, 5, 4 then the output list should have 5, 6, 7, 3, 4.Note: (1) You may assume that the ArrayList has a specific type of elements in it. In the class, we assumedit to have String type values. (2) You may only work with ArrayList(s).Write a method manyStrings that takes an ArrayList of Strings and an integer n as parameters and that replaces every String in the original list with n of that String. For example, suppose that an ArrayList called "list" contains the following values: ("squid", "octopus") And you make the following call: manyStrings(list, 2); Then list should store the following values after the call: ("squid", "squid", "octopus", "octopus") As another example, suppose that list contains the following: ("a", "a", "b", "c") and you make the following call: manyStrings(list, 3); Then list should store the following values after the call: ("a", "a", "a", "a", "a", "a", "b", "b", "b", "c", "c", "c") You may assume that the ArrayList you are passed contains only Strings and that the integer n is greater than 0.Write a method markLength4 that takes an ArrayList of Strings as a parameter and that places a String of four asterisks ("****") in front of every String of length 4. For example, suppose that an ArrayList called "list" contains the following values: (this, is, lots, of, fun, for, every, Java, programmer) And you make the following call: markLength4(list); Then list should store the following values after the call: (****, this, is, ****, lots, of, fun, for, every, ****, Java, programmer) Notice that you leave the original Strings in the list (this, lots, Java) but include the four-asterisk String in front of each to mark it. You may assume that the ArrayList contains only String values, but it might be empty.
- In the existing CircularlyLinkedList class, Write a non-static method named getMax for finding the maximum element in a circularly linked list. Write the testing code in the main method of the class CircularlyLinkedList. For this purpose, you must only use and update the CircularlyLinkedList.java file provided in Lesson3Examples posted in the eCentennialmodule "Lesson Examples (from textbook)" package exercise3; public class CircularlyLinkedList<E> { private static class Node<E> { private E element; private Node<E> next; public Node(E e, Node<E> n) { element = e; next = n; } public E getElement() { return element; } public Node<E> getNext() { return next; } public void setNext(Node<E> n) { next = n; } } private Node<E> tail = null; private int size = 0; public CircularlyLinkedList() { } public int size() { return size; } public boolean isEmpty() { return size == 0; } public E first() { if (isEmpty()) return null; return…Please use java. In this assignment, you will implement a class calledCustomIntegerArrayList. This class represents a fancy ArrayList that stores integers and supports additional operations not included in Java's built-in ArrayList methods. For example, the CustomIntegerArrayList class has a “splice” method which removes a specified number of elements from the CustomIntegerArrayList, starting at a given index. For a CustomIntegerArrayList that includes: 1, 2, 3, 4, and 5, calling splice(1, 2) will remove 2 items starting at index 1. This will remove 2 and 3 (the 2nd and 3rd items). The Cu stomIntegerArrayList class has 2 different (overloaded) constructors. (Remember, an overloaded constructor is a constructor that has the same name, but a different number, type, or sequence of parameters, as another constructor in the class.) Having 2 different constructors means you can create an instance of the CustomIntegerArrayList class in 2 different ways, depending on which constructor…java Create a static method that: is called appendPosSum returns an ArrayList of Integers takes one parameter: an ArrayList of Integers This method should: Create a new ArrayList of Integers Add only the positive Integers to the new ArrayList Sum the positive Integers in the new ArrayList and add the Sum as the last element For example, if the incoming ArrayList contains the Integers (4,-6,3,-8,0,4,3), the ArrayList that gets returned should be (4,3,4,3,14), with 14 being the sum of (4,3,4,3). The original ArrayList should remain unchanged. public static void main(String[] args) { Scanner in = new Scanner(System.in); int size = in.nextInt(); ArrayList<Integer> list = new ArrayList<>(); for(int i=0; i < size; i++) { list.add(in.nextInt()); } System.out.println(appendPosSum(list)); } }
- Import the ArrayList and List classes from the java.util package to create a list of phone numbers and also import the HashSet and Set classes from the java.util package to create a set of unique prefixes. Create a class called PhoneNumberPrefix with a main method that will contain the code to find the unique prefixes. Create a List called phoneNumbers and use the add method to add several phone numbers to the list. List<String> phoneNumbers = new ArrayList<>(); phoneNumbers.add("555-555-1234"); phoneNumbers.add("555-555-2345"); phoneNumbers.add("555-555-3456"); phoneNumbers.add("444-444-1234"); phoneNumbers.add("333-333-1234"); Create a Set called prefixes and use a for-each loop to iterate over the phoneNumbers list. For each phone number, we use the substring method to extract the first 7 characters, which represent the prefix, and add it to the prefixes set using the add method. Finally, use the println method to print the prefixes set, which will contain all of…JAVA, PLEASE THE PROGRAM SHOULD USE THE INITIAL ARRAYLIST AND TO EDIT IT NOT TO CREATE A NEW ONE Create a class called OurArrayList and implement the following methods. Do NOT createany auxiliary memory.Include a main method and test all your methods with appropriate examples.a. Write a method called scaleByK() that takes an ArrayList of integers as aparameter and replaces every integer of value K with K copies of itself. Forexample, if the list stores the values (4, 1 , 2, 0 ,3) before the method is called, itshould store the values (4, 4, 4, 4, 1, 2, 2, 3, 3, 3) after the method finishesexecuting. Zeroes and negative numbers should be removed from the list by thismethodpublic class PokerAnalysis implements PokerAnalyzer { privateList<Card>cards; privateint[]rankCounts; privateint[]suitCounts; /** * The constructor has been partially implemented for you. cards is the * ArrayList where you'll be adding all the cards you're given. In addition, * there are two arrays. You don't necessarily need to use them, but using them * will be extremely helpful. * * The rankCounts array is of the same length as the number of Ranks. At * position i of the array, keep a count of the number of cards whose * rank.ordinal() equals i. Repeat the same with Suits for suitCounts. For * example, if your Cards are (Clubs 4, Clubs 10, Spades 2), your suitCounts * array would be {2, 0, 0, 1}. * * @param cards * the list of cards to be added */ publicPokerAnalysis(List<Card>cards){ this.cards=newArrayList<Card>(); this.rankCounts=newint[Rank.values().length]; this.suitCounts=newint[Suit.values().length];…