Write an application that accepts up to 20 Strings, or fewer if the user enters a terminating value. Store each String in one of two lists (arrays) — one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, your application should print the list of short Strings.
Q: Write a program called a2_q1.py that asks the user (business owner) for their product information…
A: class a2_p1(object): def validateAndDisplayMenu(self,num): #function to prompt user…
Q: Given a list of integers, you required to create a new list such that all the odd index elements…
A: In this problem we will bring all odd index nodes and all even index nodes together and then will…
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: 2. Write a program that search a letter in a list. Save it as searchLet.py. a) Create a list named…
A: The program is written in python that accomplishes the points mentioned.
Q: Write a function in Ocaml summax2 : int list -> int = that takes an int list and returns the sum of…
A: (* Write a function max3 of type int * int * int -> int that returns the largest of three…
Q: Again, we initialize two arrays to the same String values: var arri = Array ("one", "two", "three")…
A: In this question there are two MCQs. MCQs are related to JavaScript
Q: Write the following method that merges two sorted listsinto a new sorted list:public static int[]…
A: Program: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: what does the following code do? public int function(T e) Node temp = head; int var = 0; while (temp…
A: answer is d. Find and return the position of the given element in the list if element found it…
Q: Write a Python application that accepts a string from the user and checks it against the list below…
A: python programming: The Python developed by Python language software. Python Is an High-Level…
Q: The following is useful as part of a program to play Minesweeper. Suppose you have a 5×5 list that…
A: Python program for above : def Count( M_swap , i, j): count = 0 if( i-1 >= 0 and…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: The below given C++ program will obey the following rubrics:Importing essential header…
Q: listAverage() returns the average number in a list
A: Correct Answer The function listAverage() accepts a list as the argument and initialized the…
Q: L1, L2 are two integer lists, to insert an integer X at the end of the list that has less number of…
A: Given :- Two lists L1 and L2. First there is need to calculate the size of both the lists in order…
Q: Implement a Polynomial ADT using Linked Lists, Please Implement the Multiplication, Addition, and…
A: What is polynomial: A polynomial p(x) is the expression in variable x which is in the form (axn +…
Q: Two functions you need to implement: generateRandomList( list size, maximum integer value) [returns…
A: import random def generateRandomList(size,maxInt): lst = [] for i in range(size):…
Q: Write in Python: A contact list is a place where you can store a specific contact with other…
A: User want to enter list of name and contact. Enter space after completing name and contact number.…
Q: Write the following function that returns true if the list is already sorted in increasing order:def…
A: In the given problem we will use python 3 code, def isSorted(list): for x in range(len(ll)-1):…
Q: Write a function evens (numbers) that returns a new list containing just the even elements from…
A: #Creating Functiondef evens(numbers): #Creating list to hold all even numbers list = []…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: Pseudocode:- Declare the member function String GetPhoneNumber with a parameter of vector type to…
Q: 2. Write a program that search a letter in a list. Save it as searchLet.py. a) Create a list named…
A: Programming instructions: Create a list. Take input from the user. If the user enters only one…
Q: Write a function that takes two lists as input, a list L1 containing characters and a list L2…
A: Note: The programming language is not mentioned so python is used for the solution. Algorithm:…
Q: Create a function that compares two lists of integer values to determine if they are identical (i.e.…
A: Here is the Python script that fulfils the aforementioned criteria: The definition of nub(d,x) List…
Q: Write a program called a2_q1.py that asks the user (business owner) for their product information…
A: Answer: Here we have to determine python code for business owners program. Python programming…
Q: Exercise 2: Write a program that reads n values from an input screen and stores them in a list T1,…
A: Here programming language is not given so using C++. First of all let's understand the algorithm: 1.…
Q: This is Java Programming Linked List Basics ( insertFront, insertBack, deleteFront & deleteBack)…
A: Actually, above given program is: public static void main(String[] args) {LinkedList list = new…
Q: Implement a Polynomial ADT using Linked Lists, Please Implement the Multiplication, Addition, and…
A: Here is the solution to the above problem: - CODE: #include<math.h> #include<stdio.h>…
Q: *in java* A contact list is a place where you can store a specific contact with other associated…
A: Answer is given below .
Q: 2. Write a program that will take a string from the user. The program needs to store all of the…
A: Python program for above : # get the string from user str = input("Enter a string: ") # store…
Q: Machine Problem: Write a Java program that will display the given menu: Note: Must accept a…
A: CODE: import java.util.*; public class Main { public static void main(String[] args) { Scanner…
Q: Write a Java method that merges two sorted lists into a new sorted list. public static int []…
A: As per the given question, we have to design a java program that merges two sorted lists. Algorithm…
Q: Write a Java program that will display the given menu: NOTE: adding a string must accept a…
A: import java.util.Scanner; public class Tester{ public static void main(String[] args) {…
Q: In pyton: In this lab, you will be building a software application that removes duplicate values…
A: Step 1:- Program Approach:- Declare the user-defined function whose name is…
Q: The program requires me to remove all item for a list, but when doing the test case for it, it only…
A: Solution: I have analyzed you code and we found some mistake
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: Objective: This program reads a maximum of 20 Strings until the user inputs the sentinel value ZZZ.…
Q: Write a function that concatenates all the strings in a list. The concatenation of all the strings…
A: let join separator = function | [] -> "" | [str] -> str | str::strs -> let buf =…
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: import java.util.ArrayList;import java.util.Scanner; public class CategorizeStrings { public…
Q: Write a Python application that accepts a string from the user and checks it against the list below…
A: Python is a quality programming language that helps in managing the programming patterns like that…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: Please find the answer below :
Q: a list, iterate it, and display numbers divisible by five, and if you find a number greater than…
A: list1 = [12, 15, 32, 42, 55, 75, 122, 132, 150, 180, 200]for item in list1: if (item > 150):…
Q: Python write a program in python that plays the game of Hangman. When the user plays Hangman, the…
A: Python Code for word guessing game Hangman
Q: What happens when your program attempts to access a list element with an invalid index?
A: GIVEN: What happens when your program attempts to access a list element with an invalid index?…
Q: A contact list is a place where you can store a specific contact with other associated information…
A: using namespace std; #include <iostream> #include <vector> #include <string>…
Q: In this problem you will process two lists of numbers and return the difference. The difference are…
A: Algorithm : 1. Input n. Enter n elements of list1. Store in arr1. 2. Input m. Enter m elements of…
Q: Write applications that perform the following: 2.1 Write a program that merges two ordered-list…
A: since you have posted multiple question but as per guidelines we are allowed to solve only one…
Write an application that accepts up to 20
Strings, or fewer if the user enters
a terminating value. Store each
String in one of two lists (arrays) — one list for short
Strings that are 10 characters or fewer and another list for long Strings
that are 11 characters or more. After data entry is complete, your application should
print the list of short Strings.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Create a program that removes duplicate integer values from a list. For example if a list has these valuesList = [5, 7, 8, 10, 8, 5, 12, 15, 12]. After applying the removal function, you should have List = [5, 7, 8,10, 12, 15]. In your case you will get the numbers of list from the user.This is Java Programming Linked List Basics ( insertFront, insertBack, deleteFront & deleteBack)Question: Given the following code in main and output, please write the Java program which allows main to work: public static void main(String[] args) {LinkedList list = new LinkedList(); // Try to delete from an empty listlist.deleteFront();list.displayLL();list.deleteBack();list.displayLL();// insert 3 nodeslist.insert(18);list.insert(45);list.insert(12);list.displayLL(); // Here are the main “new” lines, not included in code I gave youlist.insertFront(1);list.displayLL();list.insertBack(999);list.displayLL();list.deleteFront();list.displayLL();list.deleteBack();list.displayLL();} // end of main This is Java programming pleaseA student writes a program that for any two lists L1 and L2, computes a list L3 that contains only the elements that are common between the two lists *without duplicates*. Which following statement makes the following portion of code that computes L3 correct: L3 = [] # line 1 for elem in L1: # line 2 if elem in L2: # line 3 L3.append(elem) # line 4
- JAVA: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists: one list for short Strings that are 10 characters or fewer, and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String list to display, either S for short or L for long and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered to quit the program. An example of the program is shown below: Enter a string or ZZZ to quit >> Green Enter a string or ZZZ to quit >> Green eggs Enter a string or ZZZ to quit >> Green eggs and ham Enter a string or ZZZ to quit >> I do not like green eggs and ham Enter…write a function that add any item in a linked list after the item X, if the item X is not found in the linked list don't add the item. data structre please solve it fast less than 30 minutejava Write a program that implements the methods of a list using LINKED LISTS. Send source code END(L) PRINT_LIST(L) INSERT(x,p,L) LOCATE(x, L) RECOVER(p,L) DELETE(p, L) NEXT(p,L) PREVIOUS(p,L) DESTROY(L) FIRST(L) EMPTY(L ) * This is a function that returns true if the list is empty and false if the list is not empty. Create a menu with an option for each of the list methods. Validate p(position) between 1 and the size of the list.
- *in java* A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings), separated by a comma. That list is followed by a name, and your program should output the phone number associated with that name. Assume that the list will always contain less than 20 word pairs. Ex: If the input is: 3 Joe,123-5432 Linda,983-4123 Frank,867-5309 Frank the output is: 867-5309 Your program must define and call the following method. The return value of getPhoneNumber() is the phone number associated with the specific contact name.public static String getPhoneNumber(String[] nameArr, String[] phoneNumberArr, String contactName, int arraySize) Hint: Use two arrays: One for the string names, and the other for the string phone numbers.…In PYTHON, write a program that reads elements from a list, where each element from the list is a list with three values. Call the function defined in part 1 with the 3 values as arguments in order and print the returning value.Test your code with the list:"numbers=[[3, 5, 4], [7, 4, 3], [2, 3, 1]]" The functions defined in part 1 were: def greatest(a,b,c): if a>b: return c ifnot a>b and a>c: return b ifnot a>b andnot a>c: return a print(greatest(2,3,1))In C++, you are going to write a program that implements a doubly linked list. The data must be read from the files and you can put the file names in your program. Letters.txt contains 26 English Letters: Copy the following exactly as it is into own .txt file to test: ABCDEFGHIJKLMNOPQRSTUVWXYZ Sequence.txt contains a list of numbers. Copy the following exactly as is into another .txt file3,-3,19,-19,18,1,-2,3,-18,17,1,-3,-13,14 You need to 1. Create a doubly linked list by reading the 26 letters from Letters.txt. 2. Sequence.txt file contains a sequence of relative letter positions. The initial position is at the beginning of the list which is ‘A’. The first number in the sequence is ‘3’. So the current position will move forward for three steps. Then the first letter to output is ‘D’ and now the current position is at ‘D’ as well. The second number in the sequence is ‘-3’. Then the second letter to output is the third element backward from the current position which is ‘A’. You…
- In Python: Write a function that takes in two lists (A and B) as parameters, and an integer (sum). Both lists have the same size. The function returns True if there are two numbers: a in A, and b in B, where a + b = sum. The function must run in O(nlogn), where n is the size of any of the two listsWrite the following method that merges two sorted listsinto a new sorted list:public static int[] merge(int[] list1, int[] list2)Implement the method in a way that takes at most list1.length + list2.length comparisons. See liveexample.pearsoncmg.com/dsanimation/MergeSortNeweBook.html for an animation of the implementation. Write a testprogram that prompts the user to enter two sorted lists and displays the mergedlist. Here is a sample run. Note the first number in the input indicates the numberof the elements in the list. This number is not part of the list. Enter list1 size and contents: 5 1 5 16 61 111↵EnterEnter list2 size and contents: 4 2 4 5 6↵Enterlist1 is 1 5 16 61 111list2 is 2 4 5 6The merged list is 1 2 4 5 5 6 16 61 111In C++, you are going to write a program that implements a doubly linked list. The data must be read from the files and you can put the file names in your program. With a NEW solution for a like! Letters.txt contains 26 English Letters: Copy the following exactly as it is into own .txt file to test: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Sequence.txt contains a list of numbers. Copy the following exactly as is into another .txt file 3,-3,19,-19,18,1,-2,3,-18,17,1,-3,-13,14 You need to 1. Create a doubly linked list by reading the 26 letters from Letters.txt. 2. Sequence.txt file contains a sequence of relative letter positions. The initial position is at the beginning of the list which is ‘A’. The first number in the sequence is ‘3’. So the currentp osition will move forward for three steps. Then the first letter to output is ‘D’ and now the current position is at ‘D’ as well. The second number in the sequence is ‘-3’. Then the second letter to output is the third…