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]
4 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]4 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
If you want to load the "my-data.csv" file to Dataframe so that you can explore find out the number of data items in the data se
Juli2301 [7.4K]

If a person want to load the "my-data.csv" file to Dataframe one can use import pandas as pd.

<h3>What is pandas?</h3>

Pandas is known to be a tools that carry out data transformations. It often helps to filter and analyze any kind of data.

Note that for import one can use:

  • import numpy as np.
  • import pandas as pd.

Therefore, If a person want to load the "my-data.csv" file to Dataframe one can use import pandas as pd.

Hence, the second(2) option is correct.

Learn more about Dataframe  from

brainly.com/question/25525005

#SPJ1

8 0
2 years ago
Assume you have the following array: int[] values = new int[15]; What will happen if the following code is executed? int[15] = 2
andrey2020 [161]

Answer:

You are creating an array "values" which stores 15 integers. And if we will write int[15]=20, we are not following correct syntax. Hence, nothing will happen, and it might however, throw an error that the syntax is wrong.

Explanation:

int[15]=20 is a wrong syntax, and hence nothing will happen or computer might throw an error like that not correct syntax is being used. And if we write values[15]=20,  It will certainly throw ArrayIndexOutOfBoundsException as the maximum length is fixed to 15 and values[14] and not more than that.  

3 0
4 years ago
Whats the difference between firms that provide services and firms that sell products?
Sunny_sXe [5.5K]
One is for entertainment (e.g. movies) and one is an advertisement/commercial
4 0
3 years ago
Read 2 more answers
interpret the following SQL create table persons (person I'd int, last name varchar (255) first name varchar (255) address varch
zhuklara [117]

Answer:

Kindly check explanation

Explanation:

The SQL statement above could be interpreted as follows :

create table command is used to create a table named 'persons' with five columns which are labeled :

person I'd : whose data type is an integer

last name column with a variable character data type with maximum length of 255

first name column with a variable character data type with maximum length of 255

address column with a variable character data type with maximum length of 255

city column with a variable character data type with maximum length of 255

The VARCHAR data type is ideal since we expect the column values to be of variable length.

3 0
3 years ago
Who is known as Mecile Man of India?​
myrzilka [38]

Answer:

D A.P.J. Abdul Kalam. Dr. A.P.J Abdul Kalam was the 11th President of India. His work with the Defence Research and Development Organisation in developing military equipment like missiles and a civilian space programme earned him the title of Missile Man of India.

3 0
3 years ago
Read 2 more answers
Other questions:
  • If a = 3 and b = a+3 find value of b.
    14·2 answers
  • ATM is an abbreviation that stands for Automatic Teller machine?
    5·2 answers
  • WILL GIVE  BRAINLIEST!! WILL REPORT TOO....
    13·1 answer
  • How many words fit on a double-spaced page?
    11·1 answer
  • As a rising photographer who has recently been recognized for several impactful images, why might you explore copyright protecti
    13·1 answer
  • Riodic Table
    6·1 answer
  • The distance between Jupiter and the Sun is 5.2 AU. What is the distance in millions of kilometers? (One AU is about 150 million
    8·2 answers
  • What is the name given to the amount that a particular camera’s lens opens?
    12·1 answer
  • Que quiere decir analogico
    6·1 answer
  • HTML, the markup language of the web, specifies colors using the RGB model. It uses a two-digit hexadecimal (that is, base 16) r
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!