eate a matching game using java and 2D arrays. Create a reset button and title
Q: The problem: The purpose of this question is to write a program that will perform these nutritional…
A: Note :- You have not mention the language of the program so i'm answering your question in C++. Your…
Q: This code is not working for me and it seems as if it's not performing the way it should like on the…
A: The python program is given below:
Q: Show that f(x, y) = x +y is primitive recursive.
A: See Second step
Q: Consider the statement if (x = 1) and (y = 1) then z := 1 where x and y can each be 0 or 1, with…
A:
Q: IN JAVA Write a function that takes in user input as a string. For all characters which are numeric,…
A: Introduction A class called Scanner may be found in the java.util package and is used to get input…
Q: How does Wireshark inform us about how the TCP/IP protocol is used in networking?
A: Wireshark is able to visualise the traffic on a network by displaying a moving line that represents…
Q: U is currently i
A: Dear Student, The answer to your question is given below -
Q: 1. Which statement about ARP proxy is false ? The ARP proxy is also called promiscuous ARP or…
A: ARP Proxy which refers to the one that the Proxy ARP which it is a technique by which a proxy server…
Q: What are percentiles and quartiles ?
A:
Q: What are the types of Multiplexers?
A: There are mainly three types of Multiplexing given below:
Q: In this exercise, assume that a circle object name one Circle has been created in a program that…
A: In this exercise, assume that a circle object name one Circle has been created in a program that…
Q: Write a C program that accepts two integers from the user then Display a menu and return the choice…
A: #include<conio.h> #include<stdio.h> int sum(int a, int b){ return a+b; } int…
Q: Our CPU is currently idle and the current time is labeled time 0. Four processes arrive to the ready…
A: explain algorithm FCFS SJF SRJF
Q: My question is, will you agree or disagree with this discussion?
A: The question has been answered in step2
Q: Explain Partial Recursive Function.
A: Introduction: A recursive function is called a total recursive function if it is defined for all…
Q: Explain The Sign Magnitude Numbers.
A: Sign magnitude number: The representation of decimal number in daily business is known as sign…
Q: What are the types of Multiplexers?
A:
Q: What are the methods to simplify the boolean functions?
A:
Q: Explain The Sign Magnitude Numbers.
A:
Q: What are the advantages of segmented memory?
A: The following are some of the benefits of memory segmentation in the 8086: Memory segmentation…
Q: Which one of the following statements is false concerning the buffer overflow that causes the…
A: The false statement concerning the buffer overflow that causes the security problem is:
Q: Explain Way Of Grouping (Pairs, quads and Octets).
A: Introduction: Karnaugh map cells are grouped in Gray code order so we may see duplication in Boolean…
Q: Explain PTR & GROUP
A: Computers can communicate thanks to DNS's PTR resource record. PTR translates IP addresses to domain…
Q: What is NMI (Non-Maskable Interrupt)?
A:
Q: ters. RESULTS[RaceName, Year, Place, AthleteName] (RaceName, Year, Place) form the primary key.…
A: Dear Student, All the required queries are given below -
Q: Java : Create a .txt file with 3 rows of various movies data of your choice in the following table…
A: The solution is given in the next step
Q: What is Base64? Show at least one application of Base64. (b) What does mount command do in UNIX?…
A: Answer a: What is Base64 Base64 is a group of similar binary-to-text encoding schemes that represent…
Q: 4. Write a class Employee Info (linked List based) that records employee information. It must have…
A: The question is to write the code for the given problem. As no language has been mentioned, here c++…
Q: How can we access the class members?
A: In this question we have to understand how to access the class members in the program We will…
Q: Can you explain how MIDI has had such staying power?
A: Introduction The technical standard known as MIDI outlines a protocol stack, digital interface,…
Q: Create an abstract super class called Employee with the following attributes: Use JavaDoc comments…
A: // SalaryEmployee.java public class SalaryWorker extends Worker { private double yearlyPay;…
Q: Python question please include all steps and screenshot of code. Also please provide a docstring,…
A: The python program is given below:
Q: Discuss The Use of Multiplexers in Combinational Logic Design:
A: A multiplexer lets several input signals use the same device or resource, like an analog-to-digital…
Q: Question 4 This question assesses Block 2 Part 4. Parts a and b of this question involve creating…
A:
Q: // play game until game Over is true start with player 'X' while (!gameOver) { // get current player…
A: Algorithms: START // make a scanner for reading user input // make a char[] array to hold…
Q: Python question please include all steps and screenshot of code. Also please provide a docstring,…
A: The following are steps that need to be taken for the given program: First, we create a dictionary…
Q: Python question please include all steps and screenshot of code. Also please provide a docstring,…
A: The python program is given below:
Q: you did not answer the question, and I said breif
A: Object.clone could be modified to use a @Cloneable annotation instead of the Cloneable marker…
Q: Define swapping in?
A:
Q: Discuss The Types Of Digital Systems.
A: Operating system. The "OS" stands for "operating system," which refers to the software that controls…
Q: A manager of a department at Google wants to schedule 15-min coffee chat between two employees every…
A: In this question we have to write the python program for the given problem statement of employee…
Q: Please answer the following questions in your own definition (not wikipedia): 5. Explain method…
A: Method overloading which refers to the one it is a form of polymorphism in object oriented…
Q: Explain What Are Gated Latches.
A:
Q: Write code to determine how many different ways there are to represent n cents given an infinite…
A: As a result of the fact that this issue is recursive, let's determine how to compute makeChange(n)…
Q: Take the Linked List from Problem 2 and let's create a linked list of songs. To achieve this, create…
A: Algorithms: START Create a class Song private type char *title; char *author; char *genre;…
Q: Write any class definition of your choice that has at least two methods besides the constructor (it…
A: Class Pet : Pet(String name , String voice) // it is constructor void speak() // is a method that…
Q: Write a Note on Chomsky Hierarchy.
A:
Q: b.Consider the following two assignments: my_module = ['Part', '1', 'Block', '2', 'TMA02']…
A: Python: Python is an object-oriented and structured programming language. It multiparadigm language.…
Q: What is meant by memory segmentation?
A:
Q: What is the advantage(s) and disadvantage(s) of using map method compared to algebraic manipulation…
A: Advantage: 1.Minimizes boolean articulations without the need utilizing different boolean hypotheses…
Please help me create a matching game using java and 2D arrays. Create a reset button and title
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- Please help me fix this java code which is supposed to be a Pac-Man game Java program is below import java.awt.*; import javax.swing.JFrame.*; public class ManyPacMans extends JFrame { public void paint(Graphics g) { g.drawghostShape(60,30,40); setBackground(Color.BLUE); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.PINK); g.fillghostShape(130, 30,100, 80); g.drawghostShape(60,30,40); setBackground(Color.RED); g.fillghostShape(130, 30,100, 80); g.drawOvalpacman(30,130,50, 60); setForeground(Color.yellow); g.fillOval(130,130,50, 60); } public Ghost(String imgPath, int x, int y, int speed, boolean ip) { super(imgPath, new int[] {0,0}, GHOST_WIDTH, GHOST_HEIGHT, GHOST_FRAMERATE, x, y); super.addFramesForAnimation("scatter", "ghost_scatter.png", 0, 0, 22,0); super.speed = speed; startX = x; startY = y; scoreValue = 200; } public ManyPacMans() { initUI(); } private void initUI() { add(new…Modify this code to make a moving animated house. import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.Graphics2D; /**** @author**/public class MyHouse { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(750, 500); panel.setBackground (new Color(65,105,225)); Graphics g = panel.getGraphics(); background(g); house (g); houseRoof (g); lawnRoof (g); windows (g); windowsframes (g); chimney(g); } /** * * @param g */ static public void background(Graphics g) { g.setColor (new Color (225,225,225));//clouds g.fillOval (14,37,170,55); g.fillOval (21,21,160,50); g.fillOval (351,51,170,55); g.fillOval (356,36,160,50); } static public void house (Graphics g){g.setColor (new Color(139,69,19)); //houseg.fillRect (100,250,400,200);g.fillRect (499,320,200,130);g.setColor(new Color(190,190,190)); //chimney and doorsg.fillRect (160,150,60,90);g.fillRect…Please help me fix the errors in the java program below import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Halloween extends JFrame implements ActionListener { int hallo[][] = { { 4, 6, 2 }, { 1, 4, 3 }, { 3, 5, 2 }, { 2, 3, 5 }, { 4, 1, 3 } }; int rows = 3; int cols = 5; JButton pics[] = new JButton[rows * cols]; public Halloween() { setSize(600, 600); JPanel grid = new JPanel(new GridLayout(rows, cols)); int m = 0; for (int x = 0; x < rows; x++) { for (int y = 0; y < cols; y++) { pics[m] = new JButton(createImageIcon("back.png")); pics[m].addActionListener(this); pics[m].setActionCommand(m + ""); pics[m].setPreferredSize(new Dimension(100, 100)); grid.add(pics[m]); m++; } } add(grid); setVisible(true); } public void actionPerformed(ActionEvent ae) {}if(e.getActionCommand().equals("Reset")) { for (int m = 0; m…
- PLEASE ADD SOME DESIGNS ON MY JAVA PROGRAM, LIKE FONTS, BACKGROUND COLOR ETC. import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; //class declaration public class foodtest extends JFrame implements ActionListener { // declare global variables JCheckBox cbBurger, cbEggs, cbFriedChicken, cbBrownRice, cbIceCream; JLabel lblTitle, lblBurger, lblEggs, lblFriedChicken, lblBrownRice, lblIceCream; JButton b1Calculate, b2Check, b3Reset, b4Cancel; JTextArea t1Output; int burgerCal = 295, eggsCal = 72, friedchickenCal = 260, brownriceCal = 111, icecreamCal = 300; int totalCal = 0; ArrayList<String> foodItems = new ArrayList<String>(); ArrayList<Integer> foodCalories = new ArrayList<Integer>(); // constructor public foodtest() { // set frame properties setTitle("IS YOUR FOOD HEALTHY?"); setSize(630, 520); setLayout(new FlowLayout());…1) Implement a class Moth that models a moth flying along a straight line. The moth hasa position, which is the distance from a fixed origin. When the moth moves toward apoint of light, its new position is halfway between its old position and the position ofthe light source. Find the instance variable(s), define and implement the constructor(s), then supplythe following methods:- public void moveToLight(double lightPosition) - public double getPosition()2) Document your class, generate Javadoc documentation and produce a test program ‘MothTester’that construct a moth, move it toward a couple of light sources, and check that the moth’s positionis as expected. 3) Add a comment to your class Moth that explains how you can make the Moth immobile after 10moves.1) Implement a class Moth that models a moth flying along a straight line. The moth hasa position, which is the distance from a fixed origin. When the moth moves toward apoint of light, its new position is halfway between its old position and the position ofthe light source. Find the instance variable(s), define and implement the constructor(s), then supplythe following methods:- public void moveToLight(double lightPosition)- public double getPosition()2) Document your class, generate Javadoc documentation and produce a test program ‘MothTester’that construct a moth, move it toward a couple of light sources, and check that the moth’s positionis as expected.3) Add a comment to your class Moth that explains how you can make the Moth immobile after 10moves.
- A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it actually moves by 2 * n steps. Implement a FastCritter subclass of Critter whose move method behaves as described. What do I need to change to make it work? import java.util.ArrayList; /** A simulated critter.*/public class Critter //superclass{ private int position; private ArrayList<String> history; /** Constructs a critter at position 0 with blank history. */ public Critter() { position = 0; history = new ArrayList<String>(); } /** Gets the history of this critter. @return the history */ public ArrayList<String> getHistory() { return history; } /** Adds to the history of this critter. @param newValue the desired state */ public void addHistory(String event) { history.add(event); } /** Gets the position of this critter. @return the position */ public int getPosition() {…Review: 4. What is the output of below javacode? ___________import java.util.*;class Array{public static void main(String args[]){int array[] = new int [5];for (int i = 5; i > 0; i--)array[5-i] = i;Arrays.fill(array, 1, 4, 8);for (int i = 0; i < 5 ; i++)System.out.print(array[i]);}} 5. Complete the sentence: The type parameter section is surrounded by ________.6. A method that introduces its own type parameter is a generic method. True/False.7. Complete the sentence: Generic type parameters can be restricted to a group of types that implement a given interface. You can do that byusing the keyword__________.8. Type parameters can represent ( stand for) reference types as well as primitive types. True/false.(Java) Q6 Explain the answer step-by-step and include verbal explanation. Thank you! Given the below class: public class Dog { private String name; private double weight; private static int numDogs = 0; public Dog(String name, double weight) { this.name = name; this.weight = weight; numDogs++; } public String getName() { return name; } public double getWeight() { return weight; } public static int getNumDogs() { return numDogs; }public static void increaseNumDogs() {numDogs++;}public void printGreeting() { System.out.println("Woof!"); } @Override public String toString() { return "Name: " + name + "\nWeight: " + weight; }} Call the printGreeting method. What is different about the way you call this method compared to the prior two methods.
- Class Die java.lang.Objectextended by Diepublic class Dieextends java.lang.ObjectDie - an n-sided die with given integer values. The given integer values are returned via nextRoll() with uniform probability., Constructor SummaryDie() Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6.Die(int[] outcomes) Creates a new Die instance with the given integer outcomes.Die(int sides, int min) Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value.Method Summaryint nextRoll() nextRoll - return one of the die values at random.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor DetailDie public Die(int[] outcomes)Creates a new Die instance with the given integer outcomes.Parameters:outcomes - an int[] value - an array of the integer values for each side of the die.Die public Die(int sides,int min)Creates a new Die with…Create a graphical JAVA program that simulates a simple arcade game (like Frogger) using the ACM graphical package. an example is written below. import acm.program.*;import java.awt.Color;import acm.graphics.*;import java.util.Random;import java.awt.event.KeyEvent; public class Frogger extends GraphicsProgram { GLabel gover = new GLabel("GAME OVER ", 50, 60);GImage[] car = { new GImage("car.png", 0, 145), new GImage("car.png", 200, 145), new GImage("car.png", 400, 145) };GImage frog = new GImage("frogsmall.png", 200, 325); public static void main(String[] args) {Frogger game = new Frogger();game.start();} public void drawImage() {for (int i = 0; i < car.length; i++) {add(car[i]);}add(frog); } public void run() { setBackground(Color.GREEN);// tell program to listen for keyboard eventsaddKeyListeners(); //set up game over labelgover.setColor(Color.RED);gover.setFont("Arial-30"); drawRoad();drawRoadMarkers();drawImage(); while (true) {// for every car in the arrayfor (GImage…Please fix errors for the java code below. The program is a t square fractal (image below) import javax.swing.*;import java.awt.*;import java.awt.geom.*; //main classpublic class SquareFractal { public static void main(String[] args) { FractalFrame tframe = new FractalFrame(); tframe.setTitle("T Square Fractal"); tframe.setVisible(true); }} //JFrame extended in fractal class class T_Fractal extends JFrame{ private JPanel panel; private int twidth, theight; private int x = 200; private int limit = 15; public T_Fractal() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //default height and width final int Width = 1000; final int Height = 1000; setSize(Width, Height); setLocation(200,50); panel = new JPanel(); Container t_content = getContentPane(); t_content.add(panel, "Center"); } public void paint(Graphics graphics) { super.paint(graphics); Graphics2D g2 = (Graphics2D) graphics; twidth = getWidth(); theight = getHeight();…