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
Are you concerned that strangers may have access to the personal information you share on social media platforms? Why or why not
GuDViN [60]
It makes me a little uneasy at times, yes, but I know that they cannot find me unless I share way too much.
Hope this helps~!
~{Oh Mrs. Believer}
4 0
3 years ago
Create java program for these 2 question
morpeh [17]

1 see what you can do and go from their

7 0
3 years ago
Pick the correct statements regarding cell references.
shusha [124]

Statement two and three is correct.

Statement 1 is incorrect. A relative reference changes when a formula is copied to another cell while Absolute references remain constant. However, it is safe to say that an absolute address can be preceded by a $ sign before both the row and the column values. It is designated by the addition of a dollar sign either before the column reference, the row reference, or both. Statement C is also correct. A mixed reference is a combination of relative and absolute reference and the formula (= A1 + $B$2) is an example of a mixed cell reference.

7 0
4 years ago
Read 2 more answers
What is a good practice to remember when adding transitions to a presentation?
storchak [24]

Answer:

A. Use one type of transition throughout.

Explanation:

Edge 2021.

7 0
3 years ago
Read 2 more answers
Microsoft Windows is an example of ?
Ede4ka [16]

Answer:

an application software

Explanation:

4 0
4 years ago
Other questions:
  • What does nat stand for? network access trigger network administration timetable network address translation network association
    13·1 answer
  • B. Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represen
    7·1 answer
  • Why are some constraints automatically applied by the software
    9·1 answer
  • Which of the following is a typical concern for developers while using prototypes?
    6·2 answers
  • Which of these network connections would allow your smartphone to sync your photos to your online account? Choose all that apply
    8·1 answer
  • You don't have policies that force settings for the look of users' computer desktops. Each user's chosen desktop settings are ap
    15·2 answers
  • With a DUI charge on a driver’s record ______________.
    10·1 answer
  • A student is conducting an experiment in which he adds an inhibitor to an enzyme-catalyzed reaction that contains alkaline phosp
    14·1 answer
  • SimpleScalar is an architectural simulator which enables a study of how different pro-cessor and memory system parameters affect
    6·1 answer
  • Write a c++ program which has array in fifteen element sort the array by selection the search for in element using binary search
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!