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]
3 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:
monitta3 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
What are the pieces of information that describe the appearance of a cells content
Allushta [10]

Answer:

Information about the parts of a cell, its location and role will help describe the appearance of a cell's content.

Organelles are cell structures that include the nucleus, cytoplasm, cell membrane among others. One can view these using a light microscope.

1. Cell Membrane is a fluid mosaic. It is the outer boundary of the cell.

2.Cytoplasm is the fluid inside the cell. It is located between the nucleus and the cell membrane.

3.Nucleus is the control center of the cell and is located at the center.

4 0
3 years ago
Printed versions of your presentation that contain the slides and blank lines below are called
m_a_m_a [10]

Answer:

Handouts

Explanation:

matches description

6 0
2 years ago
A file named data.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates two
dmitriy555 [2]

Answer:

I am doing it with python.

Explanation:

nums = '9 -8 -7 -6 -5 -4 -2 0 1 5 9 6 7 4'

myfile = open('data.txt', 'w')

myfile.write(nums)

myfile.close()

myfile = open('data.txt', 'r')

num1 = (myfile.read())

num1 = num1.split()

print(num1)

print(type(num1))

for x in num1:

   x = int(x)

   if x < 0:

       minus = open('dataminus.txt', 'a')

       minus.write(str(x) + ' ')

       minus.close()

   elif x>= 0:

       plus = open('dataplus.txt', 'a')

       plus.write(str(x)+' ')

       plus.close()

8 0
3 years ago
Read 2 more answers
Why is it important to identify where privacy data resides throughout your it infrastructure?
charle [14.2K]
<span>One of the key elements in reducing the attack surface of an IT enterprise is to determine the location and sensitive nature of all data, especially privacy data which if compromised, could result in litigation, financial loss, or customer confidence loss. Additionally, this information is part of the foundation of when drafting a Disaster Recovery or Business Continuity plan.</span>
7 0
3 years ago
50 POINTS!!!!! The managing director of a company sends a christmas greetings to all his employees through the company email. wh
seropon [69]

He uses an Enterprise International Private Network.

An Enterprise Internal Private Network is a type of network that is designed for private communication within an organization. The network could span multiple buildings using private communication lines.

Let me know if you have any questions.

6 0
3 years ago
Other questions:
  • What the benefits of folder when working with files
    15·2 answers
  • Assume you previously entered these lines of code.
    14·2 answers
  • You coded the following class: public class N extends String, Integer { }When you compile, you get the following message:N.java:
    9·1 answer
  • can you give me a tip to fix my SIM card becuaus when i put it on my phone it has no signal , can anyone fix this , thank you.​
    9·2 answers
  • A ____ is a a set of presentation rules that control how text should look. It is applied to an XML file to change the collection
    9·1 answer
  • Is jesus dead or alive
    11·1 answer
  • Which of these statements correctly describe aspects of testing code? Check all of the boxes that apply.
    14·1 answer
  • How are digital and analog data similar? How are they different?
    15·1 answer
  • What is the result of the following code?<br><br> x=7//2+10%2**4<br><br> print(x)
    15·1 answer
  • PLEASE ANSWER! I NEED IN 30 MIN.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!