Class name: SURNAME_MATRIX Data fields: two(2) q xr arrays where: q = no. of characters of your first name. If q <= 5 then q = q * 2. r= no. characters of your surname. if r <= 5 then r=r* 2. Methods: Constructor: initialize two(2) arrays. Value of each element = no. of characters of your fullname * 2.5.
Q: How many pets do you have? 3 What is the name of your pet? Buttercup What type of pet is Buttercup?…
A: The answer is given below:-
Q: Part 2: binary search. When binary searching a sorted array that contains more than one key equal to…
A: ANSWER : When binary searching a sorted array that contains more than one key equal to the search…
Q: (Algebra: add two matrices) Write a method to add two matrices. The header of the method is as…
A: /** The method for adding two matrices */ public static double[][] addMatrix(double m1[][], double…
Q: Language: JAVA Script Your company is giving every employee earning less than $50,000 a 10%…
A:
Q: Create a function that returns the frequency distribution of an array. This function should return…
A: Algorithm - Take input from user. Now use the below logic - for (let el of arr) { if (out[el])…
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: 2- The purpose of the method resize() in the IntegerArray class below is to dynamically change the…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: Need help fixing some issues with a project. PLEASE read below Write a Java program that implements…
A: Answer is given below-
Q: #ifndef lab5ExF_h #define lab5ExF_h typedef struct point { char label[10]; double x ; // x…
A: Coded using c++.
Q: Write a function called adding that will accept an array of numbers as the only parameter. This…
A: def add4(num): return num + 4 def adding(arr): if not isinstance(arr, list): raise…
Q: Code in C++ language Included is an input file that contains data for every Superbowl MVP…
A: Q: Code the given problem in C++. Notes: 1. There are 2 spaces for between MVP and Position columns,…
Q: Create a type of Struct DynamicArray. This contains an int array You will use the type as a dynamic…
A: 1) Array:- A clutch is defined as a collection of similar aspects of information items stored in…
Q: 3. Removе an el nt fror an Consider an array named source. Write a method/function named remove(…
A: #remove element at index idx from source and add 0 def remove(source,size,idx): source.pop(idx)…
Q: One problem with dynamic arrays is that the created once array is using the might want to add or…
A: the answer is given below:-
Q: Trace Shell sort. Sort the data into ascending order (from smallest to largest). Also for showing…
A: Shell Sort ShellSort is essentially an Insertion Sort variant. We only pass elements one position…
Q: ****************************Instructions***************************** Add a "copy constructor" to…
A: Objective: Here, a copy constructor requires to be added and some courses would be added to the…
Q: video games, as follows: Name GTA Callof Duty Minecraft TitanFall Battlefield ● Number of users…
A: Code is given below .. #include<iostream> #include<iomanip> using namespace std;…
Q: Create a function that returns the frequency distribution of an array. This function should return…
A: In this problem, we need to design the code in the JS programming language. Input - Array Output…
Q: Create a class called 'Matrix' where initializes the number of rows and number of columns of a new…
A: ALGORITHM:- 1. Create a class representing Matrix. 2. Take input for rows & columns value. 3.…
Q: Create a function that returns the frequency distribution of an array. This function should return…
A: Algorithm - Take input from user. Now use the below logic - for (let el of arr) { if (out[el])…
Q: SOLVE USING JAVA It is required to develop an application in Java to represent Set as a data…
A: Answer: Our guideline is answer first three question form the first question. I have inserted java…
Q: Design a class named Location for locating a maximal value and its location in a two-dimensional…
A: The required Java code: import java.util.Scanner;class Location { // instance variable public…
Q: Language: JavaScript (Node.js) Autocomplete Ready O 1 > 'use strict'; 1. Lowercase strings using…
A: There isn't a built-in specific main function in Node.js to mark a program's entry point. However,…
Q: Create an object called GSSArray. (It stands for growable self-sorting array) This object will…
A: Program: //GSSArray.java import java.util.*; class GSSArray { private int array[]; private…
Q: Create a Vector2D class with properties x and y and a proper constructor method. Plus, minus and…
A: In this question, the coding language is not specified then we are doing this question in the CPP…
Q: Consider an array named source. Write a method/function named remove( source, size, idx) that…
A: def removeElement(source,size,idx): del source[idx] source.append(0) return source…
Q: Computer Science Part 2: Client Program with ArrayList Create a second client program. This program…
A: Program: import java.util.ArrayList;import java.util.Random;import java.util.Scanner; class…
Q: In LineArrayBag, add a function named addBefore. This function accepts two Line objects as input:…
A: We need to write a class LineArrayBag which has a function named addBefore, that accepts two…
Q: Word Search A word search is often a rectangular puzzle containing a bunch of characters, when these…
A: Having considered that the file structure and reading input file is. configured, below is the code…
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: Define a class named VectorDouble that mimics a vector with double type. Your class should have…
A: Actually, array is a collection of elements.
Q: Create a function that returns the frequency distribution of an array. This function should return…
A: In this problem, we need to design the code in the JS programming language. Input - Array Output…
Q: Design a class named Location for locating a maximalvalue and its location in a two-dimensional…
A: File name: “Location.java” public class Location { // public data fields public int row;…
Q: JAVASCRIPT Write the function divideArray() in script.js that has a single numbers parameter…
A: INTRODUCTION: the given answer below
Q: trix Multiplication • Write a multiplication function that accepts two 2D numpy arrays, and returns…
A: import numpy as npdef mularr(a,b): if len(a[0])==len(b): #to check if both arrays are…
Q: eate a class called 'Matrix' containing constructor that initializes the number of rows and number…
A: EXPLANATION: - The Matrix class comprises three instance variables namely for the rows, columns,…
Q: Complete the following problem using concepts of Key index searching,sorting and hashing
A: import java.util.*; class GFG { public static void main(String args[]) {…
Q: One problem with dynamic arrays is that once the array is created using the new operator the size…
A: Solution of the above querys, please find in below // Save as DynamicStringArray.h…
Q: Create a function that returns the frequency distribution of an array. This function should return…
A: Algorithm - Take input from user. Now use the below logic - for (let el of arr) { if (out[el])…
Q: Student* func () { unique ptr arr[] make_unique ("csc340") ); // #1 Insert Code int main () ( // #2…
A: Here is the code with explanation:-
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: Person
A: Define Student and Person classes as specified and create sorting algorithm methods for type Student…
Q: JAVA Create a class called 'Matrix' containing constructor that initializes the number of rows…
A: A class “Mat” for Matrix is created containing constructor which initializes the no of rows and…
Q: Assignment 6C: Overloaded Sorting. In class, we have primarily used integer arrays as examples when…
A: Step 1 : Start Step 2 : Define an overloaded function sortArray() to sort an array of integers. This…
Q: Requirements: Use only Java Programming Please show screenshots of your work Write a method named…
A: logic:- set a beginning variable to start point of subarray i.e beg=start; create…
Q: 1. An array is a container that holds a group of values of a 2. Each item in an array is called an…
A: Ans(1) An array is a container that holds a group of values of a single type. Ans(2) Each item in an…
Q: Description Write a Java program, called LinearSearch1 that contains a static method called…
A:
Q: flipObject(object) Given an object, you will return a new object where the values are now the keys…
A: Ans:) In this javascript program, we have to flip the objects with key-value pairs and if the value…
Step by step
Solved in 4 steps with 2 images
- George runs a company. He manages James and Jamila, who each have a small team to manage. In James' team are Jill and Jenny. In Jamila's team are Jewel, Jasmine and Jeremy. Create a JSON object in a string variable called company where each item has a name field and a field called manages which contains an array of the people managed by that person. If a person does not manage anybody, they have no field called manages. Then convert the JSON string to a dictionary in a variable called company_dict. Finally, write a recursive function that accepts the dictionary as an argument and lists each person and their level in the organisation, so that George is at level 1, James and Jamila are at 2, and so on. Call the function and print the result. It should look like this: George is at level 1 James is at level 2 Jill is at level 3 Jenny is at level 3 Jamila is at level 2 Jewel is at level 3 Jasmine is at level 3 Jeremey is at level 3 The function can either return a string, which you print…Computer Science Part 2: Client Program with ArrayList Create a second client program. This program will contain an ArrayList of StudentGrades objects. The program will perform the following tasks: Create an instance of an ArrayList that will store three StudentGrades objects. Each element in the ArrayList represents student grades for a test (assessment). This means that each StudentGrades object stored by the ArrayList element represents the grades achieved by students for a single test. Prompt the user for the number of students in the class. The prompt text is: Enter the number of students in the course: [Keyboard Input] Add three new StudentGrades objects to the ArrayList. The StudentGrades objects should be populated with random values from 0 to 100. Use the enhanced for loop to print each of the StudentGrades objects to the console. Print a line containing the following text: “LAST ELEMENT BEFORE REMOVE:”. Print the value of the final element in the ArrayList under the heading.…****************************Instructions***************************** Add a "copy constructor" to your dynamic-array student. Remember, the prototype looks like: Classname(const classname& otherObject); Update your test program to use the copy constructor. e.g., CourseTypeList list2(list1); ********************************************************************* Submit: Updated test program, implementation and header files (.cpp and .h) for CourseListType and CourseType zipped into a single file. //courseTypeList.h #ifndef COURSELISTTYPE_H_INCLUDED#define COURSELISTTYPE_H_INCLUDED #include <string>#include "courseType.h" class courseTypeList { public:void print() const;void addCourse(std::string);courseTypeList(int n);~courseTypeList(); private:int NUM_COURSES;int courseCount;courseType *courses;}; #endif // COURSELISTTYPE_H_INCLUDED =============================================== //courseTypeList.cpp #include <iostream>#include <string>#include…
- MUST BE IN JAVA Design a class named Location for locating a maximal value and its location in a two-dimensional array. The class contains public data fields row, column, and maxValue that store the maximal value and its indices in a two-dimensional array with row and column as int types and maxValue as a doubletype. Write the following method that returns the location of the largest element in a two-dimensional array: public static Location locateLargest(double[][] a) The return value is an instance of Location. Write a test program that prompts the user to enter a two-dimensional array and displays the location of the largest element in the array. If there are more than one largest element, find the location with the smallest row index and then the smallest column index. Sample RunEnter the number of rows and columns in the array: 3 4Enter the array: 23.5 35 2 10 4.5 3 45 3.5 35 44 5.5 9.6 The largest element is 45, located at (1, 2)Class Name: Exercise09_13In Java code Write Java program that creates two arrays of type integer 10 elements each (fill the first one with odd values 0 – 100, the second with even values from 50 – 150). You need to make a class for the array (separate class call it SimpleArrayclass). The driver class instantiates two objects for the two arrays as follows:SimpleArray a1 = new SimpleArray(10); //**this code in the driver class to creates the first array of 10 integer elements.The class SimpleArray contains all the methods (operations) that you need to do in the array, for example: int mx1 = a1.maxx(); //*** this to get the maximum value in the first array.(a) print the two arrays. (b) print the min, max, and average values in each array. Please implement this program and provide two sample runs as screen shots.Java programming Create a file named StudentArrayList.java, within the file create a class named StudentArrayList. This class is meant to mimic the ArrayList data structure. It will hold an ordered list of items. This list should have a variable size, meaning an arbitrary number of items may be added to the list. Most importantly this class should implement the interface SimpleArrayList provided. Feel free to add as many other functions and methods as needed to your class to accomplish this task. In other words, the class StudentArrayList must implement the interface SimpleArrayList. You have to write the code for each of the functions specified in the SimpleArrayList interface. Make sure the class that implements SimpleArrayList is named "StudentArrayList" or else the test code will not compile. All of the documentation for the function guidelines may be found in the interface. This assignment can be a lot of programming if you do not follow the DRY (Don't Repeat Yourself)…
- Create a class called 'Matrix' containing constructor that initializes the number of rows and number of columns of a new Matrix object. The Matrix class has the following information: 1 - number of rows of matrix 2 - number of columns of matrix 3 - elements of matrix in the form of 2D array The Matrix class has methods for each of the following: 1 - get the number of rows 2 - get the number of columns 3 - set the elements of the matrix at given position (i,j) 4 - adding two matrices. If the matrices are not addable, "Matrices cannot be added" will be displayed. 5 - multiplying the two matrices IN JAVA, PLZ GIVE ANS ASAPIN JAVA. Any help is appreciated! Thank you! PART 1 : Automobiles Create a data class named Automobile that implements the Comparable interface. Give the class data fields for make, model, year, and price. Then add a constructor, all getters, a toString method that shows all attribute values, and implement Comparable by using the year as the criterion for comparing instances. Write a program named TestAutos that creates an ArrayList of five or six Automobiles. Use a for loop to display the elements in the ArrayList. Sort the Arraylist of autos by year with Collections.sort(). Finally, use a foreach loop to display the ArrayList sorted by year.In previous chapters, you have created programs for the Greenville Idol competition. Now create a Contestant class with the following characteristics: The Contestant class contains public static arrays that hold talent codes and descriptions. Recall that the talent categories are Singing Dancing, Musical instrument, and Other. The class contains an auto-implemented property that holds a contestants name. The class contains fields for a talent code and description. The set accessor for the code assigns a code only if it is valid. Otherwise, it assigns I for Invalid. The talent description is a read-only property that is assigned a value when the code is set. Modify the GreenvilleRevenue program so that it uses the Contestant class and performs the following tasks: The program prompts the user for the number of contestants in this years competition; the number must be between 0 and 30. The program continues to prompt the user until a valid value is entered. The expected revenue is calculated and displayed. The revenue is $25 per contestant. The program prompts the user for names and talent codes for each contestant entered. Along with the prompt for a talent code, display a list of the valid categories. After data entry is complete, the program displays the valid talent categories and then continuously prompts the user for talent codes and displays the names of all contestants in the category. Appropriate messages are displayed if the entered code is not a character or a valid code.
- You will need to use at least 1 additional class other than the class with the main method. Perhaps the class would be how you instantiate each character for the array? The class needs to contain at least 3 different private members (variable/attribute) and public getter and setter properties for those members. These could be name, points, whether the character is good or evil, etcWrite code for PersonManagement class. This class contains the array of Person class (code is given below) and also following methods: set: This method receives the array of person class and set the attribute. displayAll: This method will display values of all persons. sort: This method will sort the array according to age values of the persons with ascending order using Selection Sort. reverse: This method will reverse the order of the array. getPersons: This method will return the array of the persons (attribute). displayEvenAgePerson: This method will display all those persons values who have even age. displayOddAgePerson: This method will display all those persons values who have odd age. displayPrimeAgePerson: This method will display only those persons values who have prime number age. Following is the class of Person: public class Person { private String Name; public int age; public void set(String Name, int age) { this.Name =…Write code for PersonManagement class. This class contains the array of Person class (code is given below) and also following methods: set: This method receives the array of person class and set the attribute. displayAll: This method will display values of all persons. sort: This method will sort the array according to age values of the persons with ascending order using Selection Sort. reverse: This method will reverse the order of the array. getPersons: This method will return the array of the persons (attribute). displayEvenAgePerson: This method will display all those persons values who have even age. displayOddAgePerson: This method will display all those persons values who have odd age. displayPrimeAgePerson: This method will display only those persons values who have prime number age.