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
True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
Feliz [49]
The answer to question is true
5 0
3 years ago
Read 2 more answers
Pls help I will mark you the brainliest
ehidna [41]

Answer:

c

Explanation:

6 0
3 years ago
Read 2 more answers
If a computer reboots itself on its own the computer might have a(n)
MissTica

Answer:

D. Software Problem

Explanation:

It could be that the software is bootlooping which will power on and off until its fixed.

4 0
3 years ago
PLS HELP SOON AS POSSIBLE WILL GIVE BRAINLIEST!!!
Evgesh-ka [11]

The best reason that the title of an article published on a website might not help to determine if the information is reliable is that titles attract readers; they do not guarantee accuracy

  • The title of an article tells the reader what the work or article is all about. It summarizes the whole work into a single text. Website in bid to attract more people to their page most times uses attractive titles or commonly search words but this does not show that the work is accurate.

  • People often make or select a title that grabs attention and one that makes people want to read further

Conclusively we can say that The title of an article published on website is meant to attract readers as they do not guarantee accuracy

Learn more from

brainly.com/question/11427677

5 0
2 years ago
Assuming there are 7.481 gallons in a cubic foot. Write a program that asks the user to enter a number of gallons, and then disp
34kurt

Using the knowledge in computational language in C++ it is possible to write a code that asks the user to enter a number of gallons.

<h3>Writting the code:</h3>

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>       float gallons, cufeet;</em>

<em>       cout << "\nEnter quantity in gallons : ";</em>

<em>       cin >> gallons;</em>

<em>       cufeet = gallons / 7.481;</em>

<em>       cout << "Equivalent in cublic feet is " << cufeet << endl;</em>

<em>       return 0;</em>

<em />

<em>}</em>

See more about C++ at brainly.com/question/19705654

#SPJ1

6 0
1 year ago
Other questions:
  • Which of the following jobs are most likely to be in greater demand due to the increasing prevalence of mobile computing? deskto
    13·1 answer
  • The act of engaging in crime through the use of a computer or similar type of device is called:
    8·1 answer
  • Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
    10·2 answers
  • One purpose of the dual ignition system on an aircraft engine is to provide for?
    7·2 answers
  • The operating system of a computer is an example of ________ software. science-forum
    7·1 answer
  • What is software that helps a computer operate efficiently and keeps track of data on a computer?
    14·1 answer
  • Which of the following lists contains the five essential elements of a computer? Group of answer choices: 1. inputs, returns, pr
    11·1 answer
  • Television, radio, newspapers, magazines, the Internet, and other forms of communication are collectively referred to as thea. W
    15·1 answer
  • How will Mario know which words are misspelled in his document?
    11·2 answers
  • Which statement assigns the value 140 to the variable streetNumber in Python?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!