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
Which of the following statements about meta tags is TRUE?
Iteru [2.4K]

Answer:

I guess c no. is the answer

6 0
3 years ago
Read 2 more answers
What is a possible explanation for the issue described below? A user reports that ever since she or he began creating animations
Marat540 [252]
VRAM because VRAM is used for graphic intensive workloads
8 0
3 years ago
Read 2 more answers
Core component of the linux operating system is the linux kernel. if you were a linux systems administrator for a company, when
iragen [17]
You would only need to upgrade your kernel via linux if u were a mlg hacker and knoushs how to speakith the englith
5 0
3 years ago
Why does the, the, the does the, the does when you does the do the when during coding HTML?
umka2103 [35]

Answer:

huh this makes no sense

Explanation:

lol

4 0
3 years ago
A technician is building a thick client workstation that would be used to run a database and wants to ensure the best protection
Alexxandr [17]

Answer: ECC (Error-correcting code) memory

Explanation: Error correcting code memory is the memory that has the capability of detection and correcting the error arising in the data.The internal data is the most effected data from the corruption and damage.It is the memory used in the computer and other operating system because it has less tolerance towards data corruption.

The technician should use the ECC memory for the building of the client station.This will protect the system and the data from getting in any circumstance.

6 0
3 years ago
Other questions:
  • This question refers to a standard deck of playing cards. If you are unfamiliar with playing cards, there is an explanation in P
    10·2 answers
  • What is the first stage of perception
    6·2 answers
  • WILL MARK BRAINLYIST
    15·2 answers
  • Robert's computer is not starting due to an error in the BIOS. Which of these chips could have malfunctioned? Select the correct
    12·1 answer
  • Which browser folder contains previously viewed web pages?
    12·1 answer
  • Application software definition word excel powerpoint microsoft
    13·1 answer
  • If you are writing an algorithm and you aren’t confident that you understand the problem, what can you do?
    7·1 answer
  • PLEASEEEEEE HELP, ILL DO ANYTHING JUST ANSWER THESE CORRECTLY!!!!!TYSM!!!
    15·2 answers
  • Which types of scenarios would the NETWORKDAYS function help calculate? Check all that apply.
    15·1 answer
  • Helllp me you will git 16 points
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!