0 Mohave 12 La Paz 11 Yavapai 14 Maricopa Coconino 13 Yuma 2 Navajo 10 Gila 8 Pinal (13 7 Pima 12 9 Graham Apache 6 Santa Cruz 5 Cochise Greenlee. 16 vertices[0] Mohave vertices [1] Coconino vertices[2] Navajo vertices[3] Apache vertices[4] Greenlee vertices[5] Cochise vertices[6] Santa Cruz vertices[7] Pima vertices[8] Pinal vertices[9] Graham vertices[10] Gila vertices[11] Yavapai La Paz vertices[12] vertices[13] Yuma vertices[14] Maricopa
Q: Exercise: I A company pays its employees on a weekly basis. The employees are of four types:…
A: Please refer to the screenshot of the code to understand the indentation of the code. package :…
Q: Write a program that allows the user to enter data about each of the aliens' alias and actions. Let…
A: A class Alien has been created which has members namely name, jobNo, hiuseNo and fireStationNo and a…
Q: Write code that gets the tenth item in the list, assigning it to an appropriate variable. (java)
A: Create an ArrayList called folders to store EmailFolder objects. Add EmailFolder objects to the…
Q: In this project, you will develop algorithms that find road routes through the bridges to travel…
A: solution
Q: In Java code Write Java program that creates two arrays of type integer 10 elements each (fill the…
A: Create a SimpleArray class that contains an integer array of size n. Implement a constructor that…
Q: Given the IntNode class, define the findMax() method in the Custom Linked List class that returns…
A: We have a CustomLinkedList class and an IntNode class in the Java code that has been provided. The…
Q: Java Your Java project has a class named Tree with the current class header: public class Tree…
A: According to the Bartelby guideline we are allowed to answer only 1 question at a time. Please…
Q: Write a recursive solution to this problem that computes the shortest travel time of the game and…
A: //Program in Javaimport java.util.Arrays;import java.util.Scanner; public class Main{ // function…
Q: Java programming language I need to complete the "public int remove" method in the bottom. Please…
A: public class ourArray { //define an array of integers private int[] Ar; //Ar is a reference…
Q: Can you give me an example on how in OpenGL for C++, I can implement a rolling sphere on a plane.…
A: It seems like you're providing information on how to parametrize points on a sphere using sector…
Q: I need help with this Java problem as it's explained in the image below: Image attached can not…
A: ShoppingList Class:Initialize an array list to store items and a variable numberOfItems to track the…
Q: In Javascript, write code that prints the FIRST NAMES ONLY of people who have BOTH above average…
A: here we user this data set for reference :- data set : var dataSet = [ { "name": "Maura Glass",…
Q: Complete ArrayStack.java, an array-based implementation o the Stack.java interface. Modify only the…
A: In this question, it is asked to provide the java code for the array implementation of a stack. The…
Q: need help completing the code in java ArrayList implementation of a Set data structure. Recall from…
A: You must put the techniques into practise to guarantee that the Set's components don't repeat and…
Q: Create the RandomList class with instance variables for an array of integers and a Random object.…
A: Code : import java.util.*; public class RandomList { //Instance variable for an array of integers…
Q: FIX ERRORS GIVEN IN IMAGE #include #include #include using namespace std; typedef float f;…
A: Program #include<iostream> #include<math.h> #include<assert.h> using namespace…
Q: public class TestStudents { public static void main(String[] args) { //2.2…
A: The answer is given
Q: Using OpenGL I need help making a 3d pyramid In C++ using my existing code and without adding any…
A: Given : Using OpenGL I need help making a 3d pyramid In C++ using my existing code and without…
Q: Implement a function deepEqual in Javascript that takes two arguments and returns true if the…
A: We need to write a Javascript code for the given scenario.
Q: Define a class Car as follows: class Car { public String make;…
A: CODE:- main.c#include <stdio.h>#include <string.h>#define MAX_STRING_LENGTH 512typedef…
Q: java Create a static method that: is called removeAll returns ArrayList takes two parameters: an…
A: public static void main(String[] args) { Scanner in = new Scanner(System.in); int size =…
Q: Write a C++ program that will display multiple-choice trivia questions, accept the user's answers,…
A: Define Question class. Define default and parametrized constructor for initializing the data…
Q: Implement closer_city, a function that takes a latitude, longitude, and two cities, and returns the…
A: Python Python, an open source programming language created by Guido van Rossum in the late 1980s,…
Q: TranposeGraph import java.io.*; import java.util.*; // This class represents a directed graph using…
A: Transpose of a graph ---
Q: Please, can you help me? Thanks I'm working with notebook python. In the code cell below, create…
A: Import the networks module in your code. Select the file. Create the graph with certain parameters.…
Q: JAVA: Consider the following ArrayList: ArrayList myList = new ArrayList() Using polymorphism,…
A: The design, organization, and behavior of a system or application are represented visually in…
Q: In Java In the real world, you will often be tasked with understanding and improving another…
A: In software development, it is common to encounter existing code that is difficult to understand or…
Q: in Java: this {ArrayList} is a type of class called ....... class that offers some useful methods…
A: The class ArrayList<T> in Java is a part of the Java Collections framework and it represents a…
Q: How to change this Java code to accept character value instead of integer for edges u and v:…
A: Answer is given below
Q: Lets make a simple tic tac toe game. A tic tac toe game board is a 3 by 3 grid. When a player has 3…
A: Here's an example implementation of a Tic Tac Toe game class in Python:
Q: Q# In Java, if you see a class name followed by “”, as in List, what does this mean? Group of answer…
A: List<T>: In java, we are using List for making the collection of objects. The idea of…
Q: Siven a class Point2D and an abstract class Shape2D: from_future_ import annotations from abc import…
A: from __future__ import annotations from abc import ABC, abstractmethod from dataclasses import…
Q: How do I create a class called MyArrayList which acts just like Java's ArrayList class? And how do I…
A: Java's ArrayList class is a part of the Java Collections Framework and is used to create resizable…
Q: Write a C++ a class definition for an abstract data type called Graph that models an undirected…
A: Create a class called Graph. Define private member variables: vertex: representing the number of…
Q: Write a JAVA program of A Data File Structure for a connected graph that produces a tree. There is a…
A: Description Create a boolean 'visited' and initialize it with false (for all nodes) Iterate through…
Q: Determine which functions should be removed, which must be carefully implemented, and which are…
A: Given,public class 3dShape{private 3dPoint points;public 3dShape(3dPoint[] points);// Sets the point…
Step by step
Solved in 6 steps with 2 images
- Write a program that allows two players to play tic-tac-toe game. Your program must contain the class ticTacToe to implement a ticTacToe object.Include a 3-by-3 two-dimensional array, as a private member variable, to create the board.If needed, include additional member variables.Some of the operations on a ticTacToe object are printing the current board, getting a move, checking if a move is valid, and determining the winner after each move.Add additional operations as needed.Add the method below to the parking office.java class. Method getParkingCharges(ParkingPermit) : Money Parkingoffice.java public class ParkingOffice {String name;String address;String phone; List<Customer> customers;List<Car> cars;List<ParkingLot> lots;List<ParkingCharge> charges; public ParkingOffice(){customers = new ArrayList<>();cars = new ArrayList<>();lots = new ArrayList<>();charges = new ArrayList<>();}public Customer register() {Customer cust = new Customer(name,address,phone);customers.add(cust);return cust;}public Car register(Customer c,String licence, CarType t) {Car car = new Car(c,licence,t);cars.add(car);return car;}public Customer getCustomer(String name) {for(Customer cust : customers)if(cust.getName().equals(name))return cust;return null;}public double addCharge(ParkingCharge p) {charges.add(p);return p.amount;} public String[] getCustomerIds(){String[] stringArray1 = new String[2];for(int…in c++
- JAVA programming language i need to create an "addFront" method in the bottom of the code that adds an element at the front. [-1, -3, -5] A.add(-9) ===> [-9, -1, -3, -5]. Its all the way in the bottom, please help me. public class ourArray { //define an array of integers private int[] Ar; //Ar is a reference //declare private int capacity = 100; private int size = 0; private int increment = 10; //default constructor public ourArray() { Ar = new int[100]; capacity = 100; size = 0; increment = 10; } //Constructor that accepts the capacity (C). It creates an array of C integersm, sets capacity to C // Increment to 10 public ourArray(int C) { Ar = new int [C]; size = 0; capacity = C; increment = 10; } //Constructor that accepts two integers (c, i) c for capacity and i for increment public ourArray (int C, int I) { Ar = new int[C]; size = 0; capacity = C; increment = I; } //setter for Increment public void setincrement(int I) { increment = I; } //getter for size, capacity…please complete the following in JAVA Implement the graph ADT using the adjacency list structure. thanks! also posting a similar question for adjacency matrix. have a good day!File TesSLL.java contains a driver that allows you to experiment with these methods. Compile and run TestSLL, and play around with it to see how it works. Then add the following methods to the SinglyLinkedList class. For each, add an option to the driver to test it. Do this in incremental steps!! This means, implement and test the methods one at a time.
- Java Code: Create a Parser class. Much like the Lexer, it has a constructor that accepts a LinkedList of Token and creates a TokenManager that is a private member. The next thing that we will build is a helper method – boolean AcceptSeperators(). One thing that is always tricky in parsing languages is that people can put empty lines anywhere they want in their code. Since the parser expects specific tokens in specific places, it happens frequently that we want to say, “there HAS to be a “;” or a new line, but there can be more than one”. That’s what this function does – it accepts any number of separators (newline or semi-colon) and returns true if it finds at least one. Create a Parse method that returns a ProgramNode. While there are more tokens in the TokenManager, it should loop calling two other methods – ParseFunction() and ParseAction(). If neither one is true, it should throw an exception. bool ParseFunction(ProgramNode) bool ParseAction(ProgramNode) -Creates ProgramNode,…public class PokerAnalysis implements PokerAnalyzer { privateList<Card>cards; privateint[]rankCounts; privateint[]suitCounts; /** * The constructor has been partially implemented for you. cards is the * ArrayList where you'll be adding all the cards you're given. In addition, * there are two arrays. You don't necessarily need to use them, but using them * will be extremely helpful. * * The rankCounts array is of the same length as the number of Ranks. At * position i of the array, keep a count of the number of cards whose * rank.ordinal() equals i. Repeat the same with Suits for suitCounts. For * example, if your Cards are (Clubs 4, Clubs 10, Spades 2), your suitCounts * array would be {2, 0, 0, 1}. * * @param cards * the list of cards to be added */ publicPokerAnalysis(List<Card>cards){ this.cards=newArrayList<Card>(); this.rankCounts=newint[Rank.values().length]; this.suitCounts=newint[Suit.values().length];…Make a Java class for storing data of employee. Make a class Employee has data members eid(int), experience(int), sal (int) and name (String). Make a second class EmployeeArray that declares an array of Employee. You have to add following public methods void addEmployee(Employee val); ( This functions add employee to the array. While adding employee make sure size of array increases when it gets full. Employee is added in sorted order with respect to experience. You are not allowed to sort array. Find appropriate index for the value and place value at that index. While adding data also ensure that any data does not get duplicated. bool Remove (int eid); ( This function will receives eid as argument and delete an employee from array whose eid matches with argument. When a value gets deleted shift rest of data. If value is removed successfully returns true otherwise return false) Employee valueAt(int index) (This function receives index as argument and returns value of that index if…
- Lab 10 Using an interface to share methods It is often the case that two or more classes share a common set of methods. For programming purposes we might wish to treat the objects of those classes in a similar way by invoking some of their common routines.For example, the Dog and Cat classes listed below agree on the void method speak. Because Dog and Cat objects have the ability to “speak,” it is natural to think of putting both types of objects in an ArrayList and invoking speak on every object in the list. Is this possible? Certainly we could create an ArrayList of Dog that would hold all the Dog objects, but can we then add a Cat object to an ArrayList of Dog?Try running the main program below as it is written. Run it a second time after uncommenting the line that instantiates a Cat object and tries to add it to the ArrayList. import java.util.*;public class AnimalRunner{ public static void main(String[] args) { ArrayList<Dog> dogcatList = new ArrayList<Dog>();…Add missing code to turn this class a singleton in Java package com.gamingroom; import java.util.ArrayList;import java.util.List; /** * A singleton service for the game engine */public class GameService { /** * A list of the active games */ private static List<Game> games = new ArrayList<Game>(); /* * Holds the next game identifier */ private static long nextGameId = 1; // FIXME: Add missing pieces to turn this class a singleton /** * Construct a new game instance * * @param name the unique name of the game * @return the game instance (new or existing) */ public Game addGame(String name) { // a local game instance Game game = null; // FIXME: Use iterator to look for existing game with same name // if found, simply return the existing instance // if not found, make a new game instance and add to list of games if (game == null) { game = new Game(nextGameId++, name); games.add(game); } // return the new/existing game instance to the caller return…Code in Python: