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
An associate is seeking advice on which device to purchase for a friend who is a business owner. The friend needs the ability to
spayn [35]

The best recommendation in the mentioned scenario would be a smart watch.

Answer: Option A.

Explanation:

The best device for a business owner who needs an access to chat as well as to be in touch with the home office would be a smart watch. A smart watch is similar to a mobile device, which is worn on a wrist and which has a touchscreen display.

The benefits of smart watch are numerous. It makes us updated about everything without using our smartphone. The smart watch will help the business owner to engage with others and to handle his work at the same time.

5 0
3 years ago
A(n) ________ is a group of senior managers from the major business functions that works with the chief information officer (CIO
Akimi4 [234]
Steering Committee.
7 0
3 years ago
Screenshot is the image of your active MS Word PowerPoint window<br>Is it true or false? ​
crimeas [40]

true

Screenshots are basically snapshots of your computer screen. You can take a screenshot of almost any program, website, or open window. PowerPoint makes it easy to insert a screenshot of an entire window or a screen clipping of part of a window in your presentation.

3 0
3 years ago
Explain what it means to have good file management skills.
sammy [17]
I think it means that people are good with files and organizing the files.
8 0
3 years ago
Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime
liberstina [14]

Answer:

Answered below

Explanation:

//Program is written in Java.

public void first three elements(int[] nums){

int I;

//Check if array has up to three elements

if(nums.length > 3){

for(I = 0; I < nums.length; I++){

while (I < 3){

System.out.println(nums [I]);

}

}

else{

System.out.print("Array does not contain up to three elements");

}

}

}

4 0
3 years ago
Other questions:
  • Implement the function calcWordFrequencies() that uses a single prompt to read a list of words (separated by spaces). Then, the
    8·1 answer
  • When you copy text, the selected text is copied from the original location and placed on the
    9·1 answer
  • You use different office apps to accomplish specific tasks, such a creating a newsletter or producing a sales presentation, yet
    8·1 answer
  • When powering off your computer is best down using?
    8·2 answers
  • Suppose we provide a new implementation of the transport layer protocol tcp providing the same functionality using different alg
    14·1 answer
  • A search engine attempts to catalog every Web page by topic through the use of a ____
    10·1 answer
  • What X coordinate does the center of a game begin at?
    9·1 answer
  • Do the following SQL questions. The resulting columns must all have descriptive names. You must show the result of the query. Fo
    6·1 answer
  • Which of the following is constantly changing and advancing?
    11·1 answer
  • Write a recursive function named canmakesum that takes a list of * integers and an integer target value (sum) and returns true i
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!