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
PtichkaEL [24]
2 years ago
10

Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus

ive, and sets its side length to a random decimal number greater than or equal to 5 and less than 12. Use Math.random() to generate random numbers.
This method must be called randomize() and it must take an RegularPolygon parameter.


Could someone help me out here thanks! C:
Computers and Technology
1 answer:
monitta2 years ago
8 0

Answer:

public static void randomize(RegularPolygon r){

   int side = (int)((20-10) * Math.random()) + 10;

   int length = (int)((12-5)  * Math.random()) + 5;

   // assuming the regularpolygon class has setSide and setLength methods.

   r.set.Side(side);

   r.setLength(length);

}

Explanation:

The randomize method is used to access and change the state of the RegularPolygon class attributes sides and length. The method accepts the class as an argument and assigns a random number of sides and length to the polygon object.

You might be interested in
Explain how can we determine that where is the strength of magnetic force maximum in a
snow_lady [41]

Answer:

by making a experiment

Explanation:

8 0
3 years ago
What Are the Components of a Web Address? *​
ipn [44]

Answer:

What Are the Components of a Web Address?

1.Protocol. The first component of a web address is the protocol, which is also known as the scheme. ...

2.Domain Name. The domain name part of the web address is the unique identifier for the website on the internet. ...

3.Domain Extension. ...

4.Path & Filename.

5 0
3 years ago
Read 2 more answers
what is the command used to retrieve the java files along with the string existence "Hello world" in it​
Leona [35]

Answer:

java” xargs grep -i "Hello World”

8 0
3 years ago
A company has implemented the capability to send all log files to a central location by utilizing an encrypted channel. The log
klemol [59]

Answer:

Install recommended updates.

Explanation:

To resolve this exploit the company has to install recommended updates. Since their encryption is prone or unsecured so to have better encryption or more secured encryption they have to install recommended updates.Since log files getting transferred over this channel so the company would not want to someone mess with their log files.

3 0
3 years ago
The sum of these 9 numbers is 36. 2, 2, 6, 2, 1, 8, 7, 5, 3 What is the mean of these 9 numbers?
fiasKO [112]

Answer:

4

Explanation:

The mean is the sum divided by the count of numbers, so 36/9 = 4

6 0
2 years ago
Read 2 more answers
Other questions:
  • Explain how buyers and sellers factor into setting the stock price for a company’s shares.
    13·1 answer
  • Zoom Vacuum, a family-owned manufacturer of high-end vacuums, has grown exponentially over the last few years. However, the comp
    11·1 answer
  • A ____________ is a set of commands which can be run by calling it by name.
    11·2 answers
  • a.Write a Python function sum_1k(M) that returns the sumí‘ í‘ = ∑1푘푘푀푀푘푘=1b.Compute s for M = 3 by hand and write
    15·1 answer
  • Encryption Using Rotate Operations Write a procedure that performs simple encryption by rotating each plaintext byte a varying n
    10·1 answer
  • Two system administrators who work in two different buildings for the same company want to open a communication channel between
    8·1 answer
  • What is the output of doublec= 12.0 / 5 Systemoutprintln (c)
    8·1 answer
  • Which tools do you use for LinkedIn automation?
    14·1 answer
  • How can she change that value so it is reflected in the chart in her presentation?
    5·2 answers
  • Which bits of the address would be used in the tag, index and offset in a two-way set associative cache with 1-word blocks and a
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!