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
In addition to regular watch features, which two features are often found on smart watches?
andriy [413]
Phone capabilities and fitness monitoring
5 0
3 years ago
Help me with this please
Ymorist [56]

Answer:

q1 chees

q2 web and digital continant

Explanation:

because haaa haaa haa dhum

7 0
3 years ago
Which is the shortest and simplest tax form? <br> 1040 long form <br> 1040EZ<br> 1040A<br> 140E
Kay [80]
The answer is 1040EZ. That is the shortest and simplest tax form. 
7 0
4 years ago
Read 2 more answers
Name at least TWO kinds of gaming experiences that are possible with these new control devices but were not possible on original
Pie

Yes the ansewer is c bc you can look it up!


6 0
3 years ago
An array of strings , names , has been declared and initialized . write the statements needed to determine whether any of the th
OLEGan [10]
#Python

hasempty = False
for name in names:
   if ( not name ):
      hasempty = True
      break  # speed things up
3 0
4 years ago
Other questions:
  • .How does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
    13·1 answer
  • Which osi layer is responsible for combining bits into bytes and bytes into frames?
    8·1 answer
  • The windows troubleshooting utility that identifies and eliminates nonessential files is called _____.
    15·2 answers
  • When Web users enter the URL www.CIWcertified.com in their browser address bar, they can access the official CIW Web site at the
    6·2 answers
  • WHAT 1 + 1 ???? ???????????????????
    15·2 answers
  • Maggle is preparing a document. She wants to open the help menu to sort out a formatting problem. Which key should she press to
    11·1 answer
  • You want to make the background of a Web page blue, click _____.
    13·2 answers
  • If you had an idea for a new software company, what would be the best approach to help make it a successful business? develop a
    5·2 answers
  • someone please please help with this we have to make a sketch of a hydraulic spreader or cutter I chose the spreader now we have
    14·1 answer
  • Give the value of the zero flag, the carry flag, the signflag, and the overflow flag after each of the following instructions if
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!