L = [[[1,2], [3,4,5]], "friday", {'x': "halloween", 'y':7, 'z’:77}, {10, 11, 12}] Show the commands for the following operations on L a) retrieve 'w' inside string "halloween" b) retrieve 4 c) retrieve 'y' in string "friday" d) change the value of key 'z' to 100 e) place 'A' inside [3, 4, 5] f) place 'B' inside {10, 11, 12}
Q: C++ Given Code #include #include #include using namespace std; // The puzzle will always have…
A: // CPP program for solving cryptographic puzzles#include <bits/stdc++.h>using namespace std;…
Q: Suppose A is a one dimension array with § elements is entered into listbox. Write a program Segment…
A: Note: As per the bartlebey policy we can answer single questions at a time so I am answering first…
Q: Create a function that takes a single string as argument and returns an ordered array containing the…
A: In this problem we need to design a C# code. Please find the logic below that we will be used.…
Q: All code in JAVASCRIPT Write a program that creates two files with the names file4 and file4a two…
A: the program is given below:-
Q: Q2/ Write a program in vb.net using windows forms application to create and display a dictionary for…
A: vb.net program is given below
Q: def count_punctuation(fname: str) -> dict[str, int]: **"Return a dictionary containing all of the…
A:
Q: nensional array consists Replace "YourName" anc 2] = ("YourName","YourS "Zulhairi bin Husin "Chan…
A: #include <bits/stdc++.h> using namespace std; // Linked list node struct Node { int data;…
Q: in C++ Create 4 arrays of type integer having a size of 11 and assign values to only 2 arrays using…
A: Given: Create 4 arrays of type integer having a size of 11 and assign values to only 2 arrays using…
Q: Complete the following sequence of uctions li $t0, 42 la $s0, A addiu $s1, $s0, 100 loop: pos: bltu…
A: Given an array of space 100 if array contains negative integer then it must be replaced by 42
Q: 2) Assume that you have patient list and name, surname, age and height of patients are given as…
A: Note: Since no programming language is mentioned. I am attempting this in C++. if you need it in any…
Q: 15: points.cpp) Write a program that reads 10 pairs of Cartesian coordinates from a file called…
A: Objective: This program would sort 10 pairs of coordinates whose values would be achieved from a…
Q: C program Given Code: main.c (don’t modify) #include <stdlib.h> #include <stdio.h>…
A: PROGRAM: FILE NAME: “Search.h” //header file #include <stdlib.h> //Initializing row and…
Q: / HouseholdSize.cpp - This program uses a bubble sort to arrange up to 300 household sizes in//…
A: Programming is instructing a computer to do something for you with the help of a programming…
Q: Q: Write a program that reads from the user a string matrix with 4x4 dimensions, the program has to…
A: The programming languages include Java, c, c++. The program reads the input from the user that is…
Q: After the program completes the array "newValue" should be the reverse of "oldValue". E.g. if the…
A: In this question, we will be given an array, and when the program runs and complete its execution…
Q: 3. Take the middle three numbers* and assign it to a variable called x3 *i.e. pull out the elements…
A: - We need to code for the numpy array.
Q: 11.9 (Largest rows and columns) Write a program that randomly fills in Os and 1s into an n-by-n…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: #include #include using namespace std; int main() { const int ROW_HOURS=6; //declare…
A: The solution for the above given question is given below:
Q: C++ This is the given code: #include #include #include using namespace std; // The puzzle…
A: #include <iostream> #include <fstream> #include <vector> #include <ctime>…
Q: int main () int small[1 (5, 10, 15, 20, 25); int large[] - (50, 40, 30, 20, 10); vectorcint> v(10);…
A: Note: Answering the first question as per the guidelines. 6. Here, we have given the vector code to…
Q: Write a statement that assigns the number of rows in the intOrders array to the intRows variable.
A: Explanation: Assignment statement is used to assign the value of one variable to another variables.…
Q: C++ Given code #include #include #include using namespace std; // The puzzle will always have…
A: CODE: // CPP program for solving cryptographic puzzles#include <bits/stdc++.h>using namespace…
Q: T/F Suffix array can be created in O(nlogn) time.
A: T/F Question. Suffix array can be created in O(nlogn) time.
Q: Directions. Write TRUE if the statement is correct, otherwise, write FALSE. Write your answer on the…
A: I can only solve the first three subparts as per the rules of Bartleby. The answer is
Q: Date Printer Write a program that reads a char array from the user containing a date in the form…
A: To able to print out the month in words, we use a list containing the names of each month and we…
Q: Assume that number is an int array and intptr is an int pointer. Which statement correctly assigns…
A:
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: Python code: Kindly check the Indentation during compiling the code.
Q: Consider the following code snippet and choose the best statement below. const int NUM_CARDS = 5;…
A: array: an array is a collection of homogenous elements with name and the elements are stored in the…
Q: In C Programming Language Palindrome: “A palindrome is a word, phrase, number, or other sequence of…
A: #include <stdio.h>#include <stdlib.h> // For exit() function //function for storing the…
Q: eed help with python...paste indented code here... QUESTION 6 Implement the following: a) Create a…
A: Python code to print the grades according to marks is given below.
Q: Assuming C++ slogan is a valid char array storing C-String "Giants", what is the minimum size that…
A: C++ is designed to allow you to express ideas, but if you don't have ideas or don't have any clue…
Q: void generatestory (char ** noun, char ** verb, char ** adjective, char ** preposition, char **…
A: check further steps for the answers :
Q: Question 1 Write a statement that declares a string arrays initialized with the following strings:…
A: Since no programming language is mentioned I am using c++ Algorithm: 1. Start 2. Initialize string…
Q: 1 Write a statement that declares a string arrays initialized with the following strings: Write a…
A: Array indexing starts from 0 and thus values of Monday to Sunday are stored from index 0
Q: Using C++ complete the following program 10.18: Phone Number ListWrite a program that has an array…
A: Program Instructions:Declare a string array phoneDirectory[] and open the file named…
Q: Q: Write a program that reads from the user a string matrix with 4x4 dimensions, the program has to…
A: i need the answer quickly
Q: (Array IndexOutofBoundsException) Using the two arrays shown below, write a program that prompts the…
A: Code: import java.util.*; class Array{ public static void main(String[] args){ Scanner sc =…
Q: With number of array elements, a desired element will be searched in the string, and if it is found,…
A: With number of array elements, a desired element will be searched in the string, and if it is found,…
Q: using namespace std; int main () { int euseph[10] ; int i, choice, num, intr,rng; cout « "\nFinal…
A: Please find the flowchart of the above program.
Q: A file contains a list of telephone number in following form. Aman 23456 Raj…
A: #include<iostream>#include<iomanip>#include<fstream>using namespace…
Q: *12.2 (Array IndexOutofBoundsException) Using the two arrays shown below, write a program that…
A: Please find the answer below :
Q: 5. Calculate the means of the rows and assign it to a variable called x5 # YOUR CODE HERE raise…
A: - We need to code for the numpy array.
Q: What does the following code snippet do? char str[32]; const char *info = "Time is the most valuable…
A: Strcpy is used to copy strings from one variable to another variable.
Q: A(n) ___ is used in an array to across each element? a. Index b. Subscript…
A: An index, also known as a subscript, determines how the array accesses each element in the array.
Q: Implement the following: Given: names = ['ann', 'bill', 'calvin', 'david'] ids = [12, 34, 56, 78]…
A: Solution :
Q: C++ 2D ARRAY, Continue this codes and change the array to seat[6][6]. Include a loop that asks the…
A: We need to write a C++ code for the given scenario.
Q: (Random sentences and story writer) Write an app that uses random-number generation to create…
A: Step 1.Random number generator are the application which generate any numbers from a particular…
Q: #include ctr1=0; while(ctr1arr1[ctr2]) { 17 using namespace std; 18 19E int main() { int…
A: Solution - Pseudo Code - Firstly display a message to input row and column -…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- For any element in keysList with a value greater than 100, print the corresponding value in itemsList, followed by a space. Ex: If keysList = {42, 105, 101, 100} and itemsList = {10, 20, 30, 40}, print:20 30 Since keysList.at(1) and keysList.at(2) have values greater than 100, the value of itemsList.at(1) and itemsList.at(2) are printed. #include <iostream>#include <vector>using namespace std; int main() { const int SIZE_LIST = 4; vector<int> keysList(SIZE_LIST); vector<int> itemsList(SIZE_LIST); unsigned int i; for (i = 0; i < keysList.size(); ++i) { cin >> keysList.at(i); } for (i = 0; i < itemsList.size(); ++i) { cin >> itemsList.at(i); } /* Your solution goes here */ cout << endl; return 0;}For any element in keysList with a value greater than 100, print the corresponding value in itemsList, followed by a space. Ex: If keysList = {42, 105, 101, 100} and itemsList = {10, 20, 30, 40}, print: 20 30 Since keysList.at(1) and keysList.at(2) have values greater than 100, the value of itemsList.at(1) and itemsList.at(2) are printed. #include <iostream>#include <vector>using namespace std; int main() {const int SIZE_LIST = 4;vector<int> keysList(SIZE_LIST);vector<int> itemsList(SIZE_LIST);unsigned int i; for (i = 0; i < keysList.size(); ++i) {cin >> keysList.at(i);} for (i = 0; i < itemsList.size(); ++i) {cin >> itemsList.at(i);} /* Your solution goes here */ cout << endl; return 0;} Please help me with this problem using c++.Consider the following code snippet and choose the best statement below. const int NUM_CARDS = 5; int myCards[NUM_CARDS] = {7, 4, 2, 4}; int dealerCards[NUM_CARDS] = {7, 4, 2, 4}; if (myCards == dealerCards) cout << "Player cards are same as Dealer cards\n"; else cout << "Player cards are different than Dealer cards\n"; A) Nothing is wrong. B) It looks like it wants to compare the two arrays. It needs to compare elements one by one. C) NUM_CARDS is const, an array needs to have a variable number of elements. D) It will read from out of bounds memory.
- In Python please: 7.9 LAB: Sorting TV Shows (dictionaries and lists) Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. The input file contains an unsorted list of number of seasons followed by the corresponding TV show. Your program should put the contents of the input file into a dictionary where the number of seasons are the keys, and a list of TV shows are the values (since multiple shows could have the same number of seasons). Sort the dictionary by key (least to greatest) and output the results to a file named output_keys.txt, separating multiple TV shows associated with the same key with a semicolon (;). Next, sort the dictionary by values (alphabetical order), and output the results to a file named output_titles.txt. Ex: If the input is: file1.txt and the contents of file1.txt are: 20 Gunsmoke 30 The Simpsons 10 Will & Grace 14 Dallas 20 Law & Order 12 Murder, She Wrote the file…Dec2Hex function : def decimal_to_hex(number): hex_map = {0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'} hex_digits = [] while number > 0: hex_digits.append(hex_map[number % 16]) number //= 16 # Reverse the order of the hex digits and join them to form the final hex string hex_string = ''.join(reversed(hex_digits)) return f'0x{hex_string}' if hex_string else '0x0' Perform a Profile of your Dec2Hex function. Write a function that takes a timedate object as a parameter andcalculates the number of years from NOW to the time in the timedateobject. Add unit-testing code to your Dec2Hex exercise, and then perform aUnit test of the updated Dec2Hex code.Capital QuizWrite a program that creates a dictionary containing the U.S. states as keys, and their capitals as values. (Use the Internet to get a list of the states and their capitals.) The programshould then randomly quiz the user by displaying the name of a state and asking the userto enter that state’s capital. The program should keep a count of the number of correct andincorrect responses. (As an alternative to the U.S. states, the program can use the names ofcountries and their capitals.) in phyton
- All code in JAVASCRIPT Write a program that creates two files with the names file4 and file4a two 10 element int arrays with the names arrfile4 and arrfile4a; these arrays are to have different values write the contents of arrfile4 to file4write the contents of arrfile4a to file4a(Random sentences and story writer) Write an app that uses random-number generation to create sentences. Use four arrays of strings, called article, noun, verb andprepostion. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article, noun.As each word is picked, concatenate it to the previous words in the sentence. The words should be separated by spaces. When the sentence is output, it should start witha capital letter and end with a period. The program should generate 10 sentences and output them to a text box. The arrays should be filled as follows:The article array should contain the articles "the", "a", "one", "some" and "any";The noun array should contain the nouns "boy", "girl", "dog", "town", "car";The verb array should contain the past tense verbs "drove", "jumped", "ran", "walked" and "skipped";The preposition array should contain the preposotions "to", "from", "over", "under" and "on";6. sum_highest_five This function takes a list of numbers, finds the five largest numbers in the list, and returns their sum. If the list of numbers contains fewer than five elements, raise a ValueError with whatever error message you like. Sample calls should look like: >>> sum_highest_five([10, 10, 10, 10, 10, 5, -17, 2, 3.1])50>>> sum_highest_five([5])Traceback (most recent call last): File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode exec(code, self.locals) File "<pyshell#44>", line 1, in <module> File "/homework/final.py", line 102, in sum_highest_five raise ValueError("need at least 5 numbers")ValueError: need at least 5 numbers
- In C#: Run the following console application. This program should produce the union of two sets, but has several errors. Use a variety of debugging techniques to locate and correct the errors. NOTE: A set is a collection of like elements that does not contain any duplicates. The union of two sets is the set that contains all the elements in both sets. Formally: A union B = {x : x Î A or x Î B}read: A union B is the set of all x such that x is in A or x is in B Example: A = {1,2,3,4,5} and B = {2,4,6,8}, then A union B = {1,2,3,4,5,6,8} (notice, no duplicates!) Debug the program. When you find an error, comment out the offending line, give an explanation of the error, write a corrected line, and include a screenshot of your program running with successful output. Submit the modified files and screenshots of any breakpoints you use. Program using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace…// Program 4.3.1#include <iostream>using namespace std;int main (){int a[3][4] = { {0, 1, 2, 3} , // initializers for row indexed by 0 {4, 5, 6, 7} , // initializers for row indexed by 1 {8, 9, 10, 11} // initializers for row indexed by 2 };for ( int i = 0; i < 3; i++ ) // output each array element's value for ( int j = 0; j < 4; j++ ){ cout << "a[" << i << "][" << j << "]: "; cout << a[i][j]<< endl;}return 0;} TASK 1. Explain in details what the Program 4.3.1 does? 2. What is the output.Word IndexWrite a python program that reads the contents of a text file. The program should create a dictionary inwhich the key-value pairs are described as follows:Key. The keys are the individual words found in the file.576Values. Each value is a list that contains the line numbers in the file where the word (thekey) is found.For example, suppose the word “robot” is found in lines 7, 18, 94, and 138. The dictionarywould contain an element in which the key was the string “robot”, and the value was a listcontaining the numbers 7, 18, 94, and 138.Once the dictionary is built, the program should create another text file, known as a word index,listing the contents of the dictionary. The word index file should contain an alphabetical listingof the words that are stored as keys in the dictionary, along with the line numbers where thewords appear in the original file. Figure 9-1 shows an example of an original text file(Kennedy.txt) and its index file (index.txt