Part B True /False 6. An output parameter works like a by value parameter. 7. A value-returning function must contain a return statement. 8. A Boolean method returns either yes or no 9. A jagged array is similar to a two-dimensional array, but the rows in a jagged array can have different numbers of columns. 10. When you create a List object, you do not have to know the number of items that you intend to store in it.
Q: Write a function named remove_names (names_list) that takes a list of names as a parameter, and…
A: Answer to the given question: Python Program for the given question is : new_lst=[] def…
Q: in c++ : The function insert of the class orderedLinkedList does not check if the item to be…
A: //Linked list node class Node{ public: int data; Node *next;};
Q: Functions, Iterations and List Write a function that takes a positive integer n as its parameter. •…
A: NOTE - Here I have used the Java programming language Here I have created a function named…
Q: Exercise 3: Single parameter Write a function print_even() which • takes a list of integer numbers…
A: A number is said to be an even number if the number is divisible by 2 and the remainder of the…
Q: python" Write a function named add_value that has a single parameter. This parameter will be a…
A: start define a function that takes list as a parameter append 21 in list stop
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: I give the code in Python along with output and code screenshot
Q: Multiple choice in data structures void doo(list &L){ int item,a,p=L.size()-1; L.retrieve(p,a);…
A: As the variable a and item is not initialized and it can't be passed through the function…
Q: The main method in C which calls all the above functions is: #include int main(){ int s1[100],…
A: Code: #include <stdio.h>#include <stdlib.h>typedef struct node *nodeptr;typedef struct…
Q: Question 3. Write a function called simulate_several_key_strikes . It should take one argument: an…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Exercise #3 o Write a program averageLuminance(picture) which takes as input a picture uses…
A: Calculates image brightness by luminance per pixel. Extract each color components and calculate…
Q: a function maxCylinderVolume that takes a list of floating-point tuples that represent dimensions of…
A: F# system function such as min or methods in the list module such as List.map are not allowed Write…
Q: eprivate static void sort(int [] list, int low, int high) { eif (low < high) { // Find the smallest…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: In Java List all the values of the array after the function is called static void…
A: 2D array can be defined as an array of arrays. The 2D array is organized as matrices which can be…
Q: C7 Write a program that will take an integer array(A) and an integer value(v)as input and do the…
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: Q-No.4: Add the following functions and write a program to test these functions in the class…
A: System.exit(0); It is used to exit a program at any point in java. General syntax of node :…
Q: In C++, first, make a set with 10 objects, then ask the user to enter a value for search in your…
A: // Online C++ compiler to run C++ program online#include <iostream>#include…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: function isUnfairHurdle(hurdles) { const tooHigh = hurdles.length >= 4; let tooClose = false;…
Q: list is an array of five elements of int type. What is stored in list[2] after the code is executed?…
A: Here in this question we have given a c++ code segment and we have asked to find the output of…
Q: CH7: Problem 1: Lo Shu Magic Square 15 The Lo Shu Magic Square is a grid with 3 rows and 3 columns,…
A: Python code: def generateSquare(n): # 2-D array with all # slots set to 0 magicSquare = [[0 for x…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: I give the code in Python (because no language is mentioned) along with output and code screenshot.…
Q: 1- write the removeLast function which removes the last digit from a given number, if the number…
A: PROGRAM EXPLANATION(C++): Include the header file. Define the remove last function, this function…
Q: Activity #2: Vector Math This program is meant to give you practice with lists and looping on them,…
A: code :-- # get the tow vector and using list comprehension store each element in to list…
Q: Suppose you are given an array of integers. You want to insert a number x to the array and rearrange…
A: Basically, an input array is taken and an element has to be inserted into it, in such a way that all…
Q: Write a program that reads a string and mirrors it around the middle character. Examples: aabb…
A: #include <stdio.h>#include<stdlib.h>void mirror(char* str){ //takes a string and…
Q: struct Node { int data; Node • next; }; Node • head; a. Write a function named addNode that takes in…
A: Step 1: Declare structure with data and next member Step 2: Accept choice from user, 1 for add node,…
Q: The two-dimensional lists m1 and m2 are strictly identical if their corresponding elements are…
A: Program Approach: Create a boolean function which takes two matrices.Using for loop check whether…
Q: Guess a letter: w wallaby You win! # The program selects the word platypus Guess a letter: b…
A: The given python code is examined and the respective needed changes are done on the given code and…
Q: A cyclist has several rides each day. After each ride she records the number of miles she has…
A: In the question it is given that cyclist has ridden different number of miles per day. So we
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: Since the programming language is not mentioned, I have provided the code using JavaScript.
Q: Topic: pointers, dynamic array and command line arguments Write a complete C++ program named…
A: Solution:-- 1)The given question has required for the solution which is to be provided with the…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: Algorithm - Take input from user. Now use the below logic - let isTooTall = arr.length > 3;…
Q: Write the following function that tests whether the list has four consecutive numbers with the same…
A: #declarer functiondef isConsecutiveFour(values): #return the values return sorted(values) ==…
Q: Exercise Objectives Problem Description Write a program that reads a string and mirrors it around…
A: Write a program that reads a string and mirrors it around the middle character. abcd becomes cdab…
Q: python question: Write a code that takes a sentence as an argument and places its words in a list…
A: #method that takes sentence as argument and places its words#in a list in alphabetical order and…
Q: 1. You only want to watch low calorie food. Write the following function: def low_cal(foods, count)…
A: Python used to answer this question
Q: mplement a function void printAll(void) to print all the items of the list.
A: Here the pointer list is pointing to first node of listNode. The next node is accessed by using…
Q: In Java list all the values of the array after the function is called A. static void…
A: In Java list all the values of the array after the function is called elements.
Q: Question 3. Write a function called simulate_several key_strikes It should take one argument an…
A: The program is written in python import stringimport random char=string.ascii_lowercase def…
Q: .Prime Numbers In this task, you will implement a program that takes as input a number n and…
A: Given, Pseudocode of isPrime() function: Step 1: count = 2Step 2: while count < numberStep 3: if…
Q: Create a list of two vectors (dog, cat, mouse) and (True, True, False) called a.list. Name the…
A: import numpy as np animal = np.array(["dog", "cat", "mouse"]) pet = np.array([True, True, False])…
Q: The two-dimensional lists m1 and m2 are identical if they have the same contents. Write a function…
A: Given: The two-dimensional lists m1 and m2 are identical if they have the same contents. Write a…
Q: Programming Problem Part 1 Write a function that will have a list as an input, the task of the…
A: In python, we need to define a function is to check if all the elements in the list are unique.
Q: Write a function called find_duplicates which accepts one list as a parameter. This function…
A: In Python, lists are used to store multiple items in a single variable. Lists are mutable type its…
Q: Implement the following function. 1. void listNumbersAsc(int start, int end);Description: Outputs…
A: Below is the implementation of the function: - Approach: - Define the function listNumbersAsc.(int…
Q: Create a function that takes two numbers as arguments (num, length) and returns a list of multiples…
A: # As no language is mentioned, the program is written in Python language. def…
Q: The following program has a bug. What is it? def get data(ifile): myList = ] %3D for line in ifile:…
A: Explanation: In programming, methods are executed and get the return value. In the first…
Q: Output values in a list below a user defined amount - functions Write a program that first gets…
A: Below is the modified Python code with approach: - Approach: - Defining the two functions…
Q: Complete the code for the following function so it matches its documentation: def…
A: def doubleList(numberList): #defining the function with list as a Parameter for num in…
Problem Attached
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- mergeAndRemove(int[], int[]) This is a public static function that takes a int[] and int[] for the parameters and returns an int[]. Given two arrays of integers. Your job is to combine them into a single array and remove any duplicates, finally return the merged array.Write a program that declares/intializes two arrays as described in main() and has two functions. main() - The size of both arrays is 5. The first array has elements of type double. The values are for distance measurements. Choose a descriptive name for this array.The second array will have the unit of measure. Choose a descriptive name for this array. Initialize the first 4 elements using an initialization list with the values "mi", "mi", "km", "km". Assign a new value to the first element of the second array: "km"Assign a value to the last element of the second array: "mi" Use a loop with statement that ask the user to type in all of the values for the temperatures and assign them to the first array. Function calls in main() -- you might want to write the definitions first (or at least read about them) before coming back to main() to write the calls. call the function that prints the measurements along with the unit of measure.Call the function that can count the number of…Exercise #3 o Write a program averageLuminance(picture) which takes as input a picture uses functional programming to calculate the average luminance of the picture’s pixels. Use the helper function def luminance(pixel): r = getRed(pixel) g = getGreen(pixel) b = getBlue(pixxel) y = 0.2126 * r + 0.7152 * g + 0.0722 * b return y Within your main program, use map and luminance to create a list of luminances from the list of pixels. This is an example answer to help you formulate an answer for the question above: # Exercise 3 def isDocument(fileName): listOfEndings = [ ".docx", ".txt", ".rtf" ] for ending in listOfEndings: if fileName.endswith(ending): return True return False def recursiveListDocuments(directory=os.getcwd()): files = os.listdir(os.path.normpath(directory)) for file in files: fileName = os.path.normpath(directory + "/" + file) if isDirectory(fileName): recursiveListDocuments(fileName) else: if isDocument(fileName): print fileName
- The _______ function sorts an array of objects. a) bsort() b) hsort() c) ssort() d) qsort()Write a function randomList() that gets three integers as parameters, start, bound and k. This function will create a list of k randomly generated integer numbers between start and bound values (both inclusive), and return the created list.Write a function sqrtList() that gets a list as parameter, print the numbers in the list and their square root. The square roots will be printed with 3 decimal digits. Write Python statements that ask the user to input start, bound and k values, then call the method to perform the calculations and produce the output.At the end print average of numbers by calling the function calculateAverage(). Part-2:Enter start: 10Enter end: 30Enter k: 41. number: 28 Square root = 5.2922. number: 22 Square root = 4.6903. number: 10 Square root = 3.1624. number: 16 Square root = 4.000Average of numbers is = 19.0Write a function randomList() that gets three integers as parameters, start, bound and k. This function will create a list of k randomly generated integer numbers between start and bound values (both inclusive), and return the created list.Write a function sqrtList() that gets a list as parameter, print the numbers in the list and their square root. The square roots will be printed with 3 decimal digits. Write Python statements that ask the user to input start, bound and k values, then call the method to perform the calculations and produce the output.At the end print average of numbers by calling the function calculateAverage().
- Hi, I am implementing a matrox with several functions. I have pasted the error, the assignment and my code. Hopefully you can see what causes the error and how to fix it. Thank you so much. My transpose function gives an error: IndexError: list assignment index out of range self = <tests_matrix.TestsStudent testMethod=test_transpose> def test_transpose(self): self.assertEqual(str(self.a.transpose()), ' 1 4 7\n 2 5 8\n 3 6 9\n') self.assertEqual(str(self.b.transpose()), ' 2 8 14\n 4 10 16\n 6 12 18\n') self.assertEqual(str(self.c.transpose()), ' 1 0 0\n 0 1 0\n 0 0 1\n') self.assertEqual(str(self.a.transpose().transpose()), ' 1 2 3\n 4 5 6\n 7 8 9\n') self.assertEqual(str(self.e.transpose()), ' 0 0 0 1\n 0 0 1 0\n 0 1 0 0\n 1 0 0 0\n') > self.assertEqual(str(self.f.transpose()), ' 1 2 3 1\n 2 3 2 3\n 3 1 1 2\n') tests_matrix.py:34: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = 1 2 3 2 3 1 3 2 1 1 3 2 def transpose(self): nl…1. Write a program that inputs a string and output a series of ICAO words that would be used to spell it out. For example:Enter string: Program TestPhonetic version is: Papa Romeo Oscar Golf Romeo Alpha Mike Tango Echo Sierra Tango. Note that there is a space in the string being translated and letters can be entered either upper or lower case. Any characters other than alphabet or the space should be ignored.2. You should create a function called BuildCodeArray to build an array of strings of the ICAO words.3. You should create a second function called TranslateString that takes a string and translates it into the ICAO spelling.4. After printing the ICAO words the application should ask the user if they want to translate another string and continue looping until the user indicates they do not want to translate another string.Be sure to use proper formatting and appropriate comments in your code. Provide appropriate prompts to the user. The output should be clearly labeled and neatly.…Call your class quadraticExpression.• Your private data will be a, b, c. Make them doubles.• Create an enumerated list witho NO_ROOTS = 0o ONE_ROOT = 1o TWO_ROOTS = 2o INFINITE_ROOTS = 3• Write the constructor as stated in the book• Write the changeCoeeficients as stated in the book• Write the getACoeeficient, getBCoeeficient,getCCoeeficient as inline constant functions• Write evaluate function to take a double a return a double. Constantfunction.• Write getNumberOfRoots function to return an integer. Constantfunction.• Write getFirstRoot and getSecondRoot to return the first and secondroots. Return a domain_error is there is no first or second root.Constant Functions.Use my .cpp file to test out your class.
- Write a function randomList() that gets three integers as parameters, start, bound, and k. This function will create a list of k randomly generated integer numbers between the start and bound values (both inclusive), and return the created list. Write a function sqrtList() that gets a list as a parameter, print the numbers in the list and their square root. The square roots will be printed with 3 decimal digits. Write Python statements that ask the user to input start, bound and k values, then call the method to perform the calculations and produce the output. At the end print average of numbers by calling the function calculateAverage().You have a list of student ID’s followed by the course number (separated by a space) that the student is enrolled in. The listing is in no particular order. For example, if student 1 is in CS100 and CS200 while student 2 is in CS105 and MATH210 then the list might look like this:1 CS1002 MATH2102 CS1051 CS200Write a program that reads data in this format from the console. If the ID is −1 then stop inputting data. Use the HashMap class to map from an Integer (the student ID) to an ArrayList of type String that holds each class that the student is enrolled in. The declaration should look like this:HashMap<Integer, ArrayList<String>> students =new HashMap<Integer, ArrayList<String>>();After all data is input, iterate through the map and output the student ID and all classes stored in the vector for that student. The result should be a list of classes organized by student ID.Write a function called mymember? Which will take an object x and a list y, and return #t (true) If x is an element of y and #f (false) otherwise. Note that y may be a nested list, but x is only a member of y if x is one of the top-level elements. One can use the built in equal. Code in Racket. I really appreciate it thank you so much. I have been so stuck on this question for so long