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
Harman [31]
3 years ago
8

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.
Computers and Technology
1 answer:
Sergio [31]3 years ago
5 0

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

You might be interested in
I.d 9934607467<br> p.a.s.s 54321<br><br> P.L.E.A.S.E J.O.I.N. Z.O.0.M. M.E.E.T.I.N.G
dusya [7]

Answer:

You could just go to social medIa to say j.o.i.n z.o.o.m not brainly mate

7 0
3 years ago
Which of the following is the shortcut key combination for pasting copied text?
lys-0071 [83]
Ctrl + v pastes copied text, ctrl + p brings up a print menu, ctrl + x cuts and copies highlighted text, while ctrl + c copies the highlighted text.
3 0
3 years ago
Read 2 more answers
How has the Internet changed the design industry?
Alexandra [31]
<span>Loads of ‘easy to use’ programmes and ‘How To’ guides make it simple for anyone to put a brochure/newsletter/marketing piece together – how difficult can it be with so much help available? Technology has not only changed the way designs are accomplished, it’s changed the perception of ‘design’ from a hard earned skill to something you can learn in an afternoon off.

via </span>https://dmjcomputerservices.com/blog/technology-changed-design-industry/

4 0
3 years ago
Norman Bates has a very unusual hobby what is it?
Allushta [10]

Answer:

<h3>Norman only likes to stuff birds, not other animals.</h3>
8 0
3 years ago
A typical broadcast live events and use streaming technology in which audio and video files are continuously downloaded to your
Nikitich [7]

Answer:

Webcasts

Explanation:

The rest of the options don't need to be streamed as there isn't a continuous flow of information.

7 0
3 years ago
Other questions:
  • How to you put a color into a cell? <br> a.Shading<br><br> b.Fill<br><br> c.Color<br><br> d.Insert
    8·1 answer
  • Does time complexity depend on, which base arithmetic you use? like base 10, 2 or whatever else? Does time coplexity depned on t
    13·1 answer
  • Join my discord server! CODE IS (CebjBXN)​
    12·2 answers
  • When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignore
    5·1 answer
  • You can use pen and highlighter tools to emphasize information on a slide during a PowerPoint presentation. These tools are avai
    11·1 answer
  • Choose the answer. Janice's IT department found that her computer had a program on it that was collecting her personal informati
    5·1 answer
  • Wilma is looking for facts about social media for her research project. What fact should she use for her project?
    15·1 answer
  • Does anybody play nba2k21 On ps4
    8·2 answers
  • What what do these two parts of the lift do ​
    14·1 answer
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!