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
Design a 16K x 8 memory using the following ICs:
Montano1993 [528]

Answer:

Required memory size is 16k x 8

16k = 24 x 210 = 214

Hence, No. of address lines = 14

No. of data lines = 8

a) Size of IC 1024 x 1

Total number of ICs required = 16k x 8 / 1024 x 1 = 16 x 8 = 128

b) Size of IC 2k x 4

Total number of ICs required = 16k x 8 / 2k x 4 = 8 x 2 = 16

c) Size of IC 1k x 8

Total number of ICs required = 16k x 8 / 1k x 8 = 16 x 1 = 16

Explanation:

For a, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1024 memory locations present in a IC.

For b, 11 address lines from A0 to A10 are used to select any one of the memory location out of 2k=2048 memory locations present in a IC.

For c, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1k=1024 memory locations present in a IC.

3 0
3 years ago
Write a program that reads numbers from the user until a blank line is entered. Your
ddd [48]

Answer:

nums = []

while True:

   in = input()

   if in:

       nums.append(in)

   else:

       break

if nums:

   avg = sum(nums) / len(nums)

   for i in range(len(nums)):

       if nums[i] == avg:

           print(f"index: {i+1}")

           print(nums[i])

else:

   print(-1)  # if there aren't any values in nums

Explanation:

Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.

5 0
2 years ago
A product/process is referred to as a key Technology during which of the
Rufina [12.5K]

The correct answer is D. Mature Phase

Explanation:

Most products go through four different phases, this includes the emerging phase, the growing phase, the mature phase, and the decline phase. In each of these phases, the product has a different impact on the general market.

In the case of the mature phase, this occurs once the product is established in the market, which means the product is known by many people and is considered as key or necessary. For example, nowadays smartphones are in the mature phase because these are an important part of the market or are key. Moreover, this phase occurs after the product grows in the market, and before it declines. Thus, a product is a key technology during the mature phase.

5 0
2 years ago
With magnetic readers being rendered inefficient for security, what are in most debit and credit cards now to enhance security?
Lena [83]
It’s RFID because they didn’t have enough money
7 0
2 years ago
List out the process of Assembly in the film editing process. NO LINKS. answer ASAP
kobusy [5.1K]

Answer:

just try your best

Explanation:

7 1
2 years ago
Read 3 more answers
Other questions:
  • Match terms in the first column with the order descriptions in column two.
    11·1 answer
  • Generally speaking, mobile sites are good for acquiring new customers and inspiring new relationships while mobile apps are good
    6·1 answer
  • What is a spec sheet?
    9·1 answer
  • Click _______ to view each individual record of a mail merge document.
    5·2 answers
  • Why is e-mail better for informative and positive messages than for negative ones?
    6·1 answer
  • In c++ 11, the ________ tells the compiler to determine the variable's data type from the initialization value.
    6·1 answer
  • What is an infrastructure dedicated to one organization
    13·1 answer
  • What are the two types of electronic components
    15·2 answers
  • Question #2: How would you demonstrate professionalism in a video call with a teacher? Edmentum Digital world Please Help!!
    8·1 answer
  • Which TWO of these correctly describe a Trojan horse malware?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!