QUESTION 33 O points Save Answe Long Answer. Write a method named crazyLetters that takes a char array as a parameter and changes every other character to uppercase (other characters can remain the same). This method should return the new char array. -ALT+F10 (PC) or ALT+EN+F10 (Mac)
Q: a. Declare an array called arrayA holds integer numbers, the size of the array is entered by the…
A: Please check the step 2 for required code and step 3 & 4 for screenshots of code and output.
Q: Which of the following is a correct insert method for inserting an element into an array? public…
A: Logic to insert element is we need to shift all the elements by one postion right from to…
Q: Assume that you have an array of integers called numbers that has been declared and filled with…
A: Method name is BubbleSort Parameters are one integer array and an integer Doesn't return value
Q: i need it in util.java.scanner form and can you make it so i can copy and past it please thanks…
A: Program Triangle.java import java.util.Random; class Triangle{ public static void main(String…
Q: Please Use Java as programming language. Create a class whose main() holds an array containing 10…
A: Function lowest(): takes in an integer array with 10 values. We declare a variable named min with…
Q: Attach File Browse My Computer QUESTION 2 Write a Java program that creates an array of input n (get…
A: take n from user. create n size array . store random numbers in it using loop. calculate average…
Q: Which of the following declare an array and initializes them some known values without an error?…
A: According to the rule of array declaration and array initialization Correct option will be char…
Q: A. Edit the following code so that it return true only if the key is found in the 2D array at least…
A: public static boolean search(String[][] array2D,String key) { //this variable is used as…
Q: Prompt the user to enter an integer, then asks the user to enter that many values. Store these…
A: #include <iostream> #include <ctime> using namespace std; int main() { int n;…
Q: In the main() method, create two arrays: String[] wordsFromFile1;…
A: Step 1: Declare class Main. Define calculateTokenCounts() method that determines the count of tokens…
Q: 13.2 (Suffle ArrayList) Write the following method that suffle an ArrayList of the numbers: public…
A: In shuffle method parameter ArrayList is passed where for loop is used to iterate over the…
Q: Now do it the fixed sliding window of building a tri-gram dictionary method. You can start after 256…
A: First and foremost Question: what is trigram? A three-part graphic unit is known as a trigraph.…
Q: Write a java program that prompts the user to enter ten integer values and reads them into an array.…
A: package bartlebey;// Importing the required packagesimport java.io.*;import java.util.*;public class…
Q: Which statement/s will declare an array of integers that has 8 elements? O a. intll n = new int[8];…
A: Hello Student. Warm welcome from my side. Hope you are doing great. I will try my best to answer…
Q: Create a program that do these: 1- Create an array of 10 int items 2- Fill this array using the…
A: Since you said, Create a program without using the method, I have not created the method. Comments…
Q: What type of value does the nextLine0 returns? Select one: O a. double O b. None of these O . Line O…
A: Your answer is given below with an explanation.
Q: In the main() method, create two arrays: String[] wordsFromFile1;…
A: SUMMARY: -Taking input from the file we displaced the total no of token.
Q: Snames1:snames names ArrayList<String :String :String :String Ayesha Jazan Bushra Jazan Zahra Jazan…
A: Answer of the Following Questions are below:
Q: QUESTION 17 If you declare an array int[] numbers = {4, 2, 0, 3, 5}, then numbers[0] is O 4 0 5 O 2…
A: Given array numbers={4,2,0,3,5}
Q: Array will store the type of values in the contiguous memory location. a. integer O b. positive O c.…
A: Here, Fill in the blank is given with four options.
Q: You need to write a method called "sumoddIndexes". The method should take an integer array as input.…
A: Required: You need to write a method called "sumOddIndexes".The method should take an integer array…
Q: For this exercise you will be creating 2 different arrays, both should store integers and be able to…
A: #include <iostream>using namespace std;int main(){ //creating array int a[5],b[5],c[5];…
Q: Create 10 accounts in an array with id 0, 1, ..., 9, and an initial balance of $100. The system…
A: Actually, given information; Create 10 accounts in an array with id 0, 1, ..., 9, and an initial…
Q: Which of the following statements a), b) or c) is false? O a. You can create an array from a range…
A: Which of the following statements a). b) or c) is false? a. You can create an array from a range of…
Q: . int16_t returnMin(int16_t x[], uint32_t count); // return the minimum value from the integer…
A: This Question belongs to assembly language domain of computer science. To solve:-. int16_t…
Q: Complete the findMax() method that returns the largest value in array nums. Ex: If array nums…
A: Here Java code is given, for which I have given the required method findmax() below to find the…
Q: write a (GUI) application that asks a user how many integers to be entered, then stores the integers…
A: Given data is shown below: write a (GUI) application that asks a user how many integers to be…
Q: Which statement/s will declare an array of integers that has 8 elements? int[] n = new int[8]; int…
A: EXPLANATION: The general declaration of the variable of array type requires the following items:…
Q: 2. The following code has a run time error. Explain the error and correct it. | final int…
A: Below I have provided a C++ program for the given question. Also, I have attached a screenshot of…
Q: Write a method named printOdd() that accepts an integer array as argument and print all the odd…
A: Odd numbers: Odd numbers are those which cannot be divisible by 2. Eg: 1,3,5,... Implementation:…
Q: Write a Java program named searchForLastOccurence that : Asks the user to enter an integer value…
A: Introduction: This question explains about JAVA program
Q: C++ Challenge!! Search Metrics Link to the 100,000 Random Integers:…
A: Program Explanation: 1) Implement the header file. 2) Declare the variable for counting the number…
Q: 1. Declare an array to save 4 Dog objects. The Dog class is provided below. Look into the Dog class…
A: Declaration of the array of the class of given size, N is as follows className[] arrayName = new…
Q: C++ Get a value from the user and using a loop, search for the value in the array. Report all the…
A: The complete code with part 3 and part 4 are shown below. Sample Response: //C++ program#include…
Q: 5. A method named addRow that takes two parameters: the first is a two-dimensional array of doubles,…
A: Required:
Q: amanpy >. Tarminal 38 ***Supports traversal with a for loop, return ster(self. stons) sendbas t…
A: Syntax error is generated when the program(code line) is written in wrong syntax then the specified…
Q: Please answer in c++. Create a template class UniversalArray which createss an array of a given…
A: Does the template class work in C++In C++, a template is a blueprint or formula for creating a…
Q: Calculate the sum of numbers within an array You can create your own array of numbers but consider…
A: // This program computes the sum of all the integers(+ve and -ve) in an array and prints the sum.…
Q: Determine if the following statement are true or false screen shot shows the text's…
A: According to our rules, we should answer only the first question when many questions are posted.…
Q: Can you write it in Java, add comments Create an application containing an array that stores…
A: Program Approach: Import necessary package Defining class ArrayMethodDemo Defining main method…
Q: 1. Mode a. Write a method that generates and returns an array of 10O integers between 1 and 365,…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Implement a method…
Q: Assume that you have an array of integers called numbers that has been declared and filled with…
A: using System; namespace SortingExample { class Program { static void…
Q: int[]myArray=newint[7]; c. int[][]myArray=newint[3][4];
A: Explanation: A 2D array's items are designed in rows and columns, and the new operator for 2D arrays…
Q: Which statement shows an array declaration with 4 columns and 3 rows? O int [3][4]values; O int…
A: Declaring Arrays: To declare an array in C, a programmer specifies the type of the elements and the…
Q: In the provided A1Q1. java file, complete the rollingAverage () method. This method will compute the…
A: Solution
Q: cipher and the player tries to decrypt it by using common letter combinations in English and…
A: The Code of the following is given below.
Q: Which Python statement creates the following NumPy array? [24 24 24 24 24 24 24]
A: The correct answer is option d (None of the others) Reason: --> Numpy ones will only return 1…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- You will notice that a class named PeriodicTable has been provided to you. Inside the class is a static, two-dimensional arrayof strings named ELEMENTS that contains information about every element in theperiodic table, so: ELEMENTS[0] is { "1", "Hydrogen", "H", "1.007" }; ELEMENTS[1] is { "2", "Helium", "He", "4.002" } and so on ... Add a static method to this class that uses the array to build a datastructure of elements such that it is fast and easy to find an element usingonly its symbol. Your method should match the following signature, but replaceDataStructure with your chosen data structure. public static DataStructure makeFastPeriodicTable() {} Hint: you can use the Integer.parseInt("2") and Double.parseDouble("1.23")methods to create numeric values from strings. _____________________________________________________ public class PeriodicTable {public static final String[][] ELEMENTS = {{ "1", "Hydrogen", "H", "1.007" },{ "2", "Helium", "He", "4.002" },{ "3", "Lithium",…Need help writing the following method: getWaitlistedStudents() – returns an array of Students in the waitlist. public class Course { public String code; public int capacity; public SLinkedList<Student>[] studentTable; public int size; public SLinkedList<Student> waitlist; public Course(String code) { this.code = code; this.studentTable = new SLinkedList[10]; this.size = 0; this.waitlist = new SLinkedList<Student>(); this.capacity = 10; } public Course(String code, int capacity) { this.code = code; this.studentTable = new SLinkedList[capacity]; this.size = 0; this.waitlist = new SLinkedList<>(); this.capacity = capacity; } public Student[] getWaitlistedStudents() { // insert your solution here and modify the return statement return null; }Define an array to be a 121 array if all elements are either 1 or 2 and it begins with one or more 1s followed by a one or more 2s and then ends with the same number of 1s that it begins with. Write a method named is121Array that returns 1 if its array argument is a 121 array, otherwise, it returns 0. There is one additional requirement. You should return 0 as soon as it is known that the array is not a 121 array; continuing to analyze the array would be a waste of CPU cycles. If you are programming in Java or C#, the function signature isint is121Array(int[ ] a) If you are programming in C or C++, the function signature isint is121Array(int a[ ], int len) where len is the number of elements in the array a. Examples a is then function returns reason {1, 2, 1} 1 because the same number of 1s are at the beginning and end of the array and there is at least one 2 in between them. {1, 1, 2, 2, 2, 1, 1} 1 because the same number of 1s are at the beginning and end of…
- In the Utils class provided to you in this exercise, please fill in the details for a method called swapArray(). You can either upload a file or use the Edit tab to submit your work. The VPL tester will pass an arbitrary array of type integer to your method, along with the value of the locations in the array of two values that need to be swapped (exchanged). For instance, in the illustration below, the method swapArray is told to swap the values in positions 0 and 2 of an array made up of {10, 20, 30, 40, 50}. The three input parameters to the method are the array, as well as the two array indices (i and j) that control which elements to swap. Your task is to write the contents of the method that can execute this swap.This code is in java.Your friend’s photo editing software has stopped working so you volunteer to help. She wants all the pictures reversed in the horizontal direction along the y-axis so that items on the left side of the picture are now on the right side, and vice versa. Pictures are stored as 2-D arrays, where each “pixel” stores a single brightness value. In other words, you need a method that will take a 2-D array and reverse its columns so that the first becomes the last, the second becomes the second to last, and so on. Given the following starter code, write the method to help your friend.In ArrayUtility class, create a public static method equals that receives two arrays of int's and returns true if they have the same length and equal corresponding elements. In ArrayUtilityTest class, create a public static method equalsTest that prints the results for the following 6 cases: two empty arrays, one empty and one singleton, two singleton with the same element, two singleton with different elements, two arrays with two identical elements, two arrays with two different elements. Call only this class in the main method and check the results. In ArrayUtility and ArrayUtilityTest, design, implement and test a method named isSorted that checks if an array of int-s is already sorted, i.e. all the elements are in increasing order. In ArrayUtility and ArrayUtilityTest, design, implement and test a method named generateIntArray that generates a random array with the provided length having elements randomly generated between a minimum and maximum value, including those values create…
- This code is in java. Part A: Your friend’s photo editing software has stopped working so you volunteer to help. She wants all the pictures reversed in the horizontal direction along the y-axis so that items on the left side of the picture are now on the right side, and vice versa. Pictures are stored as 2-D arrays, where each “pixel” stores a single brightness value. In other words, you need a method that will take a 2-D array and reverse its columns so that the first becomes the last, the second becomes the second to last, and so on. Given the following starter code, write the method to help your friend. Part B The method worked so well that your friend has asked for more help! She needs a way to save her photos, along with all of their associated information. Design a class Photo that stores the picture’s photographer and date as strings and the actual picture itself as a 2-D array. The constructor should create a Photo with those three qualities, and the class should also have…The editTemperatures() method takes in two parameters: integer array tempData and integer numMore. Complete editTemperatures() to create a new array called arrayCopy with the same elements as tempData, and the size increased by numMore. Ex: If the input is: 10 48 49 18 3 then the output is: 10 48 49 18 0 0 0 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Scannerscnr=newScanner(System.in); int[] degreesFahrenheit=newint[4]; intinput; inti; for (i=0; i<degreesFahrenheit.length; ++i) { degreesFahrenheit[i] =scnr.nextInt(); } // Read number of values to increase array size by input=scnr.nextInt(); degreesFahrenheit=editTemperatures(degreesFahrenheit, input); for (i=0; i<degreesFahrenheit.length; ++i) { System.out.print(degreesFahrenheit[i] +" "); } } }Method #2: Write a method named longestSortedSequence that accepts an array of integers as a parameter and that returns the length of the longest sorted (nondecreasing) sequence of integers in the array. For example, if a variable named array stores the following values: int[] array = {3, 8, 10, 1, 9, 14, -3, 0, 14, 207, 56, 98, 12}; then the call of longestSortedSequence(array) should return 4 because the longest sorted sequence in the array has four values in it (the sequence -3, 0, 14, 207). Notice that sorted means nondecreasing, which means that the sequence could contain duplicates. For example, if the array stores the following values: int[] array2 = {17, 42, 3, 5, 5, 5, 8, 2, 4, 6, 1, 19} Then the method would return 5 for the length of the longest sequence (the sequence 3, 5, 5, 5, 8). Your method should return 0 if passed an empty array. - Your code should have two classes ( Drive , Methods ) - Methods class should include longestSortedSequence(array) and swapPairs(array)…
- Create an array of 1,000 random numbers using the CArray class and the SeqSearch and BinSearch methods. Add a new private Integer data member called compCount, which is set to 0. Add a line of code directly after the essential comparison in each of the search algorithms that increases compCount by one. Run both methods, each searching for the same number, say 734. Compare the compCount results after executing both techniques. What is the compCount value for each method? Which method generates the fewest number of comparisons?Need help writing the following method: getRegisteredIDs() – returns an array of int[], namely registered student id’s. The length of the array is the size (number of students) in the course. public class Course { public String code; public int capacity; public SLinkedList<Student>[] studentTable; public int size; public SLinkedList<Student> waitlist; public Course(String code) { this.code = code; this.studentTable = new SLinkedList[10]; this.size = 0; this.waitlist = new SLinkedList<Student>(); this.capacity = 10; } public Course(String code, int capacity) { this.code = code; this.studentTable = new SLinkedList[capacity]; this.size = 0; this.waitlist = new SLinkedList<>(); this.capacity = capacity; } public int[] getRegisteredIDs() { // insert your solution here and modify the return statement return null; }In the test class below, integrate another method to existing method to: Print the minimum values of each row and of each column. public class ArrayTest {public static void main(String[] args) {int[][] myArray = {{1, 4, 3, 2}, {2, 4, 8, 6}, {3, 3, 3, 3}};int[] rowMax = ArrayOperations2D.findRowMax(myArray);for (int i = 0; i < rowMax.length; i++) {System.out.println("Max in row " + i + " = " + rowMax[i]);}int[] rowSums = ArrayOperations2D.findRowSums(myArray);for (int i = 0; i < rowSums.length; i++) {System.out.println("Sum in row " + i + " = " + rowSums[i]);}int[] columnMax = ArrayOperations2D.findColumnMax(myArray);for (int i = 0; i < columnMax.length; i++) {System.out.println("Max in column " + i + " = " + columnMax[i]);}int[] columnSums = ArrayOperations2D.findColumnSums(myArray);for (int i = 0; i < columnSums.length; i++) {System.out.println("Sum in column " + i + " = " + columnSums[i]);}int[][] transpose =…