1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lostsunrise [7]
3 years ago
9

The following program draws squares recursively. Fill in the missing code. import javax.swing\.\*; import java.awt\.\*; public c

lass Test extends JApplet { public Test() { add(new SquarePanel()); } static class SquarePanel extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); int width = (int)(Math.min(getWidth(), getHeight()) * 0.4); int centerx = getWidth() / 2; int centery = getHeight() / 2; displaySquares(g, width, centerx, centery); } private static void displaySquares(Graphics g, int width, int centerx, int centery) { if (width >= 20) { g.drawRect(centerx - width, centery - width, 2* width, 2 * width); displaySquares(________, width - 20, centerx, centery); } } } }
Computers and Technology
1 answer:
ExtremeBDS [4]3 years ago
8 0

Answer:

The missing code to this question is g.

Explanation:

In this question firstly import packages. Then declaration of the class Test that inherits the JApplet. In this class, we declare the default constructor. In this constructor, we call the add function. Then we declare another class that is SquarePanel. This class inherits JPanel. In this class, we define a method that is paintComponent(). In this method, we define an integer variable. In this method, we perform calculations and pass it to another function that is displaySquares(). In this function, we pass the value as the arguments. So in question the missing code or argument is g.

You might be interested in
In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called _________.
KonstantinChe [14]

In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function

For better understanding, let us explain what the reshape function means

  • The numpy package helps to give the right tools for scientific and mathematical computations in python . it includes functions that cam be used to perform common linear algebra operations, fast Fourier transforms, and statistics The reshape function simply alter or change the row and column arrangement of data in numpy function and it is said to just give new shape to an array without the altering of its data.

from the above, we can therefore say that the answer In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function is correct

learn more about reshape function  from:

brainly.com/question/24728884

3 0
2 years ago
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th
Burka [1]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

8 0
2 years ago
Which is the shortest and simplest tax form? <br> 1040 long form <br> 1040EZ<br> 1040A<br> 140E
Kay [80]
The answer is 1040EZ. That is the shortest and simplest tax form. 
7 0
3 years ago
Read 2 more answers
Once a business determines that change needs to occur, what ahould the
Lady bird [3.3K]

Answer:

D. Business strategy

Explanation:

Kono Dio Da!!

7 0
3 years ago
Can i have two e-mail accounts on my android
Scrat [10]
Yes, if you download an app such as gmail or yahoo mail. hope this answered your question.
5 0
3 years ago
Other questions:
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • In a video, a motionless image is called
    7·2 answers
  • Jane is debugging a code consisting of 25 lines. The code starts executing at line 11. At line 13, the code calls another method
    10·2 answers
  • An air-conditioning system's automatic controller might directly control the
    7·2 answers
  • The computer system for a major retail store was hacked. Many addresses, credit card numbers, and other pieces of customers’ per
    7·2 answers
  • PLEASE ANSWER!! If my pixel has an RGB value of (R - 150, G - 0, B - 100), what is the dominant value? Why?
    14·1 answer
  • Suppose that a 2M x 16 main memory is built using 256kB x 8 RAM chips and memory is word addressable, how many RAM chips are nec
    6·1 answer
  • Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
    7·1 answer
  • What is connectivity?
    15·2 answers
  • Help me. thank you very much
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!