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
The understanding of computer function?
Licemer1 [7]
A specific skill or work done and carried out by a computer in order to gain information
8 0
3 years ago
What is the output of 1101×10==11000+10
aliya0001 [1]

Answer:

west ward cpt output

Explanation:

i know because i invented it

6 0
3 years ago
Which view shows how the document will look when printed?
DIA [1.3K]
Please provide photos for your question.
7 0
3 years ago
If a car's is malfunctioning, people in the car will become ill when driving long distances, especially if the windows are close
galben [10]
The Carbon Monoxide will build up in the inside of the car by venting through, causing the passengers to breathe it. It will first make them ill, then kill them. They cannot detect this gas
5 0
3 years ago
Read 2 more answers
How do you create a bot in discord?
Ksivusya [100]

Answer:

<em>Creating a Bot Account</em>

Explanation:

Personally, I found this website and it helped me a bunch whenever making a bot. https://discordpy.readthedocs.io/en/stable/discord.html

8 0
2 years ago
Other questions:
  • Which mistakes are NOT highlighted by the spell checker in a word-processing document?
    15·2 answers
  • Which network type connects each computer and device to a central device?
    5·1 answer
  • 2. Billys teacher asked him to type a report about asian food. Which paragraph format should he use?
    12·2 answers
  • ROM is designed for _________
    6·1 answer
  • George wants to pursue a career in web technology as a web developer. Which certifications can help him as a web developer?
    5·1 answer
  • What is ur Favorite anime
    8·1 answer
  • How does the post process alert the user if it detects a hardware problem during the post process?
    6·1 answer
  • Match the organelles to their functions.
    6·1 answer
  • How are software myths affecting software process?. Explain with example​
    9·1 answer
  • Which of the following best describes the difference between the domain and path of a URL?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!