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
A ____ is any key that uniquely identifies each row.
Mrac [35]
<span>A _superkey___ is any key that uniquely identifies each row.</span>
6 0
3 years ago
What is an example of a source that is less likely to be copyrighted?
Ivahew [28]
An example would be a: motorized vehicle aka a car or a bike etc.
8 0
3 years ago
Read 2 more answers
What is the difference between a manufacturing engineer and a materials engineer?
lyudmila [28]
<span> a </span>manufacturing<span> or industrial </span>engineer<span> are mechanical </span>engineers<span> with ... Process </span>Engineers<span> specialise in processes where raw </span>materials<span> are converted using chemical processes resulting in significantly </span>different<span> ...</span>
7 0
3 years ago
Read 2 more answers
What are some signs that could help you determine that a date and time was inserted as a special object instead of
Jlenok [28]

Answer:

i) It is difficult to put the mouse pointer's insertion point in the text

ii) A gray border appear around the time and date when you point to it

Explanation:

When the date and time is pointed to or hovered using the mouse pointer, we have, that the background of the text changes to a grey border around the text when the date and time is inserted as a special object using the insert date and time button on the insert menu in the word processing application

The mouse pointer behaves different when working with some applications, and it could be difficult to place the insertion point of the mouse pointer in the  text

Therefore, the correct options are;

<em>It is difficult to put the mouse pointer's insertion point in the text and</em>

<em>A gray border appear around the time and date when you point to it.</em>

3 0
2 years ago
The capacity of a communication channel is measured in _______.
PSYCHO15rus [73]
<span>The capacity of a communication channel is measured in gb and gps.</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • Software referd to the physical parts of the computer True or False
    9·2 answers
  • Which of the following is not an advanced strategy you may use to help you conduct a search on the Internet?
    12·1 answer
  • Order the steps to take when drawing electron dot diagrams.
    15·2 answers
  • If you have two redo log groups with four members each, what’s the optimal number of disks you need to provide appropriate prote
    5·1 answer
  • A company that manufactures machine parts orders a new system that makes products at ten times the speed of the earlier machine.
    15·1 answer
  • In black and white,<br><br> we must be more conscious of image
    11·1 answer
  • Differences between dot_mattix printer and a line printer
    12·1 answer
  • What is the output for the following code?<br><br> print (5*4+5)
    11·1 answer
  • What is the most common knowledge computer programmers need in order
    15·2 answers
  • Assume that students in a course are required to produce a written report on an ICT-related
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!