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
- 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 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 to display, 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. import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) { // your code here } // display() }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 to display, 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. code given import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) { // your code here } // display() }
- Python write a program in python that plays the game of Hangman. When the user plays Hangman, the computer first selects a secret word at random from a list built into the program. The program then prints out a row of dashes asks the user to guess a letter. If the user guesses a letter that is in the word, the word is redisplayed with all instances of that letter shown in the correct positions, along with any letters correctly guessed on previous turns. If the letter does not appear in the word, the user is charged with an incorrect guess. The user keeps guessing letters until either: * the user has correctly guessed all the letters in the word or * the user has made eight incorrect guesses. one for each letter in the secret word and Hangman comes from the fact that incorrect guesses are recorded by drawing an evolving picture of the user being hanged at a scaffold. For each incorrect guess, a new part of a stick-figure body the head, then the body, then each arm, each leg, and finally…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 to display, 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. import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) {Yahtzee! Yahtzee is a dice game that uses five die. There are multiple scoring abilities with the highest being a Yahtzee where all five die are the same. You will simulate rolling five die 777 times while looking for a yahtzee. Program Specifications : Create a list that holds the values of your five die. Populate the list with five random numbers between 1 & 6, the values on a die. Create a function to see if all five values in the list are the same and IF they are, print the phrase "You rolled ##### and its a Yahtzee!" (note: ##### will be replaced with the values in the list) Create a loop that completes the process 777 times, simulating you rolling the 5 die 777 times, checking for Yahtzee, and printing the statement above when a Yahtzee is rolled. When you complete the project please upload your .py file to the Project 2 folder by the due date.
- In python, The function count_contains_x takes a list of strings (wordList) and returns the count of how many strings in the list contain at least one upper- or lower-case 'x'. Hint: Use the accumulator pattern to accumulate the count. Hint: You might want to use the string method count. For example: Test Result strlist = ["xerox", "OXEN", "whiffleball", "XOXOX"] print(count_contains_x(strlist)) 3 fish = ["angel", "gold", "cat", "puffer", "damsel"] print(count_contains_x(fish)) 0 strlist = ["X", "x"] print(count_contains_x(strlist)) 2 list_of_one_x = ["x"] print(count_contains_x(list_of_one_x)) 1Write the following function that tests whether the list has four consecutive numbers with the same value: def isConsecutiveFour(values):Write a test program that prompts the user to enter a series of integers and reports whether the series contains four consecutive numbers with the same value.Code an application program that keeps track of student information at your college. Include their names, identification numbers, and grade point averages in a fully encapsulated, homogeneous sorted singly linked list structure. When launched, the user will be asked to input the initial number of students and the initial data set. Once this is complete, the user will be presented with the following menu: Enter: 1 to insert a new student's information, 2 to fetch and output a student's information, 3 to delete a student's information, 4 to update a student's information 5 to output all the student information in sorted order, and 6 to exit the program. The program should perform an unlimited number of operations until the user enters a 6 to exit the progrqm Please use java use deep copy
- Write the following function that tests whether a two-dimensional list has four consecutive numbers of the same value, either horizontally, vertically, or diagonally. public static boolean is ConsecutiveFour(int[][] values) Write a test program that prompts the user to enter the number of rows and columns of a two-dimensional list and then the values in the list and displays True if the list contains four consecutive numbers with the same value. Otherwise, display False. Here are some examples of the true cases: Note: You can use random generate to fill the TwoD.Create a program that asks the user to enter (n) the number of elements that will b in the list. The program will create a random list of numbers and then ask the user to enter a number (sNum) to search for. This number to search will either be in the range of the random number list. The program should provide this information if it is in the range. If it is there, it should return the location of the number. If not, the program should return that it is not found.The program will take in a year as an input from the user and output the popular dance and popular slang from that decade. Years, slang, and dances are stored in parallel lists in the starter code. The decade 1920 is located at index 0 and accompanies the 1920’s slang and dance also located at index 0, the decade 1930 is located at index 1 and accompanies the 1930’s slang and dance also located at index 1, etc. year_list = list(range(1920, 2030, 10)) slang_list = ["bee's knees", "hip", "cool", "nifty", "groovy", "far out", "gnarly", "phat", "sweet", "lit", "fire"] dance_list = ["The Charleston", "The Jitterbug", "The Lindy Hop", "The Hand Jive", "The LocoMotion", "The Electric Slide", "The Moonwalk", "The Macarena", "Single Ladies", "Juju on that Beat", "The Renegade"] year = int(input("Year: ")) decade_index = (year - 1920) // 10 if decade_index == 11: print(f"In the {year_list[decade_index]}'s, The {dance_list[decade_index]} is the hip dance craze!") else:…