In this last assignment, you will be playing with ISO-3166 content. This assignment will focus on two- dimensional array, method calling, strings manipulation and more . You need to create a class called MyTakeOnlSO3166.java. Your main method would call a non-static method called init which will populate a two-dimensional String array of 250 rows and variable length of columns. The rows will contain the country codes and t columns will contain the corresponding country names. The init method should not take any paramet and should not return anything as well. In order to do this, you would be using the following sample code:
Q: In this question you will create a method in Forecasting.java named readData that reads the data…
A: 1. Answer Forecasting.java import java.io.File;import java.io.FileNotFoundException;import…
Q: his program is going to maintain a list of customers’ names and bank account balances. Create a…
A: Note: Answering the first three subparts as per the guidelines. Task : Create the string ArrayList…
Q: Please help me with this problem. Create a class to represent an Airplane object containing…
A: Airplane passengers : Passenger [ ] airplaneName : String numPassengers : int //calculated…
Q: Create a class name FunWithArrays and create the following methods: 1. consecutiveValueChecker(int…
A: Programs: Programs are used mainly for problem-solving. It is used to solve complex problems. The…
Q: Write a method called priceIsRight that mimics the guessing rules from the game show The Price Is…
A: Given: Write a method called priceIsRight that mimics the guessing rules from the game show The…
Q: Implement a method named insert. This method should take an array of ints, the index at which a new…
A:
Q: Create a class called ArrayModulus, with the following methods and requirements: • Declare a 5 by 4…
A: Required:
Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File…
A: Please give positive ratings for my efforts. Thanks. PROGRAM Parser.java package com.examples;…
Q: Given the following table containing information about employees of an organization, develop a small…
A: Java used to answer this question
Q: Consider the following Javascript code: function Tool(name, ID, isPower, isCheckedOut) { this.name =…
A: The solution to the given problem is below.
Q: Write a program that has an array of at least 10 string objects that hold people’s names and phone…
A: #include<iostream>#include<string>#include<cctype>using namespace std; #define…
Q: This program is going to maintain a list of customers’ names and bank account balances. 1. Create a…
A: import java.util.*; import java.util.Scanner;public class Main //CustomerList { public static void…
Q: This code is in java. Your friend’s photo editing software has stopped working so you volunteer to…
A: Answer The code will be public class MyClass { int[][] arr; public MyClass(int a,int b){ arr=new…
Q: D creates an associative array containing three key-value pairs
A: let town = { name: "Helena", county: "Shelby", population: 18500}; AnsweR : D creates…
Q: Create a program whose Main() method declares an array of 10 integers. Call a method to…
A: #include <iostream>using namespace std; void fill(int arr[], int n){ int i=0;…
Q: You will then create a separate class, Assignment8A. In its main method, you should do the…
A: It is tо write а C++ рrоgrаm thаt uses а struсture nаmed mоvie dаtа tо stоre the…
Q: Write an application with a main method that allows you to: • Create an array of 3 Cars, the user…
A: Solution: Java code: Car.java public class Car { private String code; private String…
Q: An element in the array is a peak (max or min) if the elements before and after that element are…
A: Program approach: Create a class named displayPeak. Declare a nmethod named initValues() for…
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: A Student is having two options, using array or ArrayList in the program. Which of the following…
A: Option 2 seems to be the correct one. ArrayList can resize itself as items are added, but it can't…
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: This code is in java. Part A: Your friend’s photo editing software has stopped working so you…
A: public class MyClass {int[][] arr;public MyClass(int a,int b){arr=new int[a][b];int count=0;for(int…
Q: this is the template to be user. Add the code here according to the question in image. in java…
A: The program is written in Java. Check the program screenshot for the correct indentation. Please…
Q: Please use the information on the first screenshot about a class BST and node class to implement a…
A: import java.util.Random; //this is our class which have data, nleft and right stored…
Q: Hello, I've attached the prompt for this assignment. I need help creating code to delete and update…
A: The code is given below. import java.util.*; public class ContactService { //Start with an…
Q: (Java in Eclipse) Write code that finds the sum of two matrices. Use the following method header…
A: Algorithm: Start Implement addMatrix() method which takes 2 2d arrays a,b as argument and returns a…
Q: The three parallel arrays are gone — replaced with a single array of type PhonebookEntry. You…
A: Actually, Java is a programming language originally developed by James Gosling at Sun Microsystems…
Q: Given a 2 dimensional array, write a method to return the average of each row. The result must be…
A: Answer: Typed Code: //classpublic class arrays{//main method public static void main(String[]…
Q: Create an ArrayList, Named it Husnain that can hold Integers, and fill each slot with a different…
A: By specifying the number n, we can generate the random number from 0 to n-1 So, add 1 to this, and…
Q: is the syntax for the calling the __init__ method in the ArrayBag class from the ArraySortedBag…
A: Answer :
Q: Write a program that creates a tool box object that contains two(2) different tools, each with…
A: As per the requirement program is completed. Note: Here the programming language is not mentioned,…
Q: 1. Write a program that calls these two methods as described below a. A void method that prints…
A: public static void method1() { for(int i = 1; i <= 5; i++) { for(int j = 1; j <= i; j++) {…
Q: A teacher has three exam grades for all the members of her class, and she worries that the grades…
A: PROGRAM: //Importing required header file import java.util.*; //Defining class public class Grades…
Q: The Code must be in Java Using the program segment you wrote to find Fibonacci Numbers in lab 8 as…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Create a class called ArrayModulus, with the following methods and requirements: • Declare a 5 by 4…
A: 1. create a function to calculate the modulus.2. take the array of two dimension randomly.3. use…
Q: Use the Account class created in Programming Exercise9.7 to simulate an ATM machine. Create 10…
A: PROGRAM STRUCTURE First statement is importing the package whose functions are required later in…
Q: Given that an ArrayList of Integers named numberList has already been created and values have…
A: According to the Question below the solution: Output:
Q: 5. A method named addRow that takes two parameters: the first is a two-dimensional array of doubles,…
A: Required:
Q: In this assignment, you will write a Java program that counts the 26 letter frequencies for a given…
A: Code: import java.util.*; import java.io.*; class LetterCounterArrayApp { // Method 1:…
Q: In the Utils class provided to you in this exercise, please fill in the details for a method called…
A: Code public class Main{ public static void swapArray (int[]theArray, int i, int j) { int temp;…
Q: You are walking along a hiking trail. On this hiking trail, there is elevation marker at every…
A: The method you needed private static boolean dangerousDescent(int[] array) { //…
Q: Write a program that do the following: Ask the user to input his/her first name and store it in a…
A: import java.util.*; class TestClass { public static void main(String args[] ) throws Exception {…
Q: Write a static method, getBigWords, that gets a single String parameter and returns an array whose…
A: Purpose: This program includes a static method "getBigWords" that receives a string (sentence)…
Q: I need the answer quickly None In order to access the 3rd element of an array1, which of the given…
A: According to the above-mentioned question, the index of the 3rd element of a given array ( i.e,…
Q: public static String getMonth_DD_YYYY(int[] datePieces) - Reformats the date in datePieces (where…
A: The java method, split(expression) that is used to break the given string based on the given regular…
Q: In the provided A1Q1. java file, complete the rollingAverage () method. This method will compute the…
A: Solution
Q: a). Write a method called createArray which takes two parameters a and b, and returns an array that…
A: PROGRAM: //Header file import java.util.*; //Defining class class Main { //Defining…
Q: Which of the following is a correct declaration of a variable and a call to a constructor of an…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: A teacher has three exam grades for all the members of her class, and she worries that the grades…
A: Given: A two-dimensional array containing test marks of several students, the number of students…
Step by step
Solved in 3 steps with 1 images
- 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 this lab assignment you need to implement the method named middleValue, in a program named ArrayOps.java. The method accepts an array of integer values as a parameter, and returns the value in the middle of the array. For instance, if an array contains five elements, then the third element would be the middle element to be returned. However, if the array contains six elements, both the third and fourth values could be considered to be the middle elements. In this case, only return the first middle value, namely, the third element of the array. Complete the method middleValue, and test the correctness of your method in main(). Particularly, you should create two arrays (arbitrary values), one array with odd length, and the other with even length, and print out the middle values of these two arrays.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…
- Please don't change anything. Put your code in line 7, 11 and 13. Write a method named getSquares which takes an integer array and returns a new integer array of the same length where each element is the square of the corresponding element in the input array. For example, if the input array is {2, 4, 5} the output would be {4, 16, 25}.Based on the information in the screenshots, please answer the following question below. The language used is Java and please provide the code for it with the explanation. Create a testing class named “PlanTest”. Under this class, there needs to be another static method besides the main method: You will need to create a static method named “prerequisiteGenerator” under “PlanTest”, which return a random 2D array containing prerequisite pairs (e.g., {{1, 3}, {2, 3}, {4, 2}}). The value range of a random integer is [0, 10] (inclusive). This method will accept an integer parameter, which specifies the length of the returned array: int[][] pre = prerequisiteGenerator(3); // possibly {{1, 3}, {2, 3}, {4, 2}} Under the main method, you will need to use prerequisiteGenerator to generate random prerequisite pair lists, and perform tests on plan method at least three examples by printing proper messages. Given 4 courses and prerequisites as [[1,0], [2,0], [3,1]] It is possible to take all…The UnsortedTableMap class is located in the maps folder. In the attachment, you will find a partially implemented class called UnsortedMapOfLists, which extends UnsortedTableMap. The values associated with the keys in UnsortedMapOfLists are arrays. So you have an array with each key. Off course you can save an array in the value of UnsortedTableMap class without the class we are going to develop, but our class makes this easier, as it allows using a syntax like this: myMap["somekey", 1] to reach element at index 1 in the array associated with key "somekey". I already implemented methods __setitem__ and __getitem__. Your task is to: implement method __delitem__ . Deletion will be performed for an element in the array. If index is not given, delete the array associated with the key. implement a function (not a method in the class) to swap the arrays associated with two given keys. Add the required comment in method __getitem__. implement a main to verify that your code is working…
- please use the name, phonenumber and phonebookentry to build this. The three parallel arrays are gone — replaced with a single array of type PhonebookEntry. You should be reading in the entries using the read method of your PhonebookEntry class (which in turn uses the read methods of the Name and PhoneNumber classes). Use the equals methods of the Name and PhoneNumber classes in your lookup and reverseLookup methods. Use the toString methods to print out information. Make 100 the capacity of your Phonebook array Throw an exception (of class Exception) if the capacity of the Phonebook array is exceeded. Place a try/catch around your entire main and catch both FileNotFoundExceptions and Exceptions (remember, the order of appearance of the exception types in the catch blocks can make a difference). Do not use BufferedReader while(true) breaks The name of your application class should be Phonebook. Also, you should submit ALL your classes (i.e., Name, Strip off public from all your class…a). Write a method called createArray which takes two parameters a and b, and returns an array that has all integer from a to b. Example 1: a = 6, b = 2 Array is [6, 5, 4, 3, 2] Example 2: a = 4, b = 8 Array is [4, 5, 6, 7, 8] Example 3: a = 4, b = 4 Array is [4] b). In main method, you should ask the user to input two integers a and b. Then call method createArray and print out the array. class Main {public static int[] createArray(int a, int b) {}public static void main(String[] args) {}}A teacher has three exam grades for all the members of her class, and she worries that the grades are too low. You need to complete the method, named testAverage, in the class named Grades.java. There are two parameters to this method: the first is an integer representing the number of students in the class and, the second is a two-dimensional array of integers. In other words, each row represents the three grades for one student, while the columns represent the three sets of test grades. The return value should be the number of students with an average exam grade below seventy. The grades should be treated as double variables. For example, consider the grades for the four students in the following 2-D array, [88, 84, 89] [76, 64, 67] [85, 76, 79] [95, 90, 91] The first student has an exam average of 87.0 (= (88+84+89)/3 = 261/3), the second student has an exam average of 69.0 (= (77+64+67)/3 = 207/3), the third student has an exam average of 80.0 (= (85+76+79)/3 = 240/3), while the…
- A teacher has three exam grades for all the members of her class, and she worries that the grades are too low. You need to complete the method, named testAverage, in the class named Grades.java. There are two parameters to this method: the first is an integer representing the number of students in the class and, the second is a two-dimensional array of integers. In other words, each row represents the three grades for one student, while the columns represent the three sets of test grades. The return value should be the number of students with an average exam grade below seventy. The grades should be treated as double variables. For example, consider the grades for the four students in the following 2-D array, [ [88, 84, 89] [76, 64, 67] [85, 76, 79] [95, 90, 91] ] The first student has an exam average of 87.0 (= (88+84+89)/3 = 261/3), the second student has an exam average of 69.0 (= (77+64+67)/3 = 207/3), the third student has an exam average of 80.0 (= (85+76+79)/3 = 240/3), while…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] +" "); } } }This question is in javaYou are walking along a hiking trail. On this hiking trail, there is elevation marker at every kilometer. The elevation information is represented in an array of integers. For example, if the elevation array is [100, 50, 20, 30, 50, 40], that means at kilometer 0, the elevation is 100 meters; at kilometer 1, the elevation is 50 meters; at kilometer 2, the elevation is 20 meters; at kilometer 3, the elevation is 30 meters; at kilometer 4, the elevation is 50 meters; at kilometer 5, the elevation is 40 meters. a) Write a method called dangerousDescent that determines whether there is a downhill section in the hiking trail with a slope of more than -0.05. The slope is calculated by the rise in elevation over the run in distance. For example, the last kilometer section has a gradient of -0.01 because the rise in elevation is 40 - 50 = -10 meters. The distance covered in 1000 meters. -10 / 1000 = 0.01. Your method should return true if there exists a dangerous…