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
Perform online or offline research to learn more about film elements. Then, write a short report on the essentials of filmmaking
pshichka [43]

Answer:

Screenplay

Financing

Theme

cinematography

editing

sound and music

Acting and Genre

Explanation:

There are various essential elements that needs to be considered to become a famous and a good filmmaker. A good filmmaker will take care of small elements and will consider minor details. The audience is very keen when it takes interest in the movie. They pay attention to even minor details in the movie. The filmmaker should take care of all the details and will have to decide on the main things such as screenplay, audio, editing, genre of the movie and similar. These elements are dependent on each other. If the audio of the movie is not appropriate or sound quality is not suitable then the overall impact of the movie will be slowed no matter how strong the content is. There is high dependency of all the elements and every element should be paid attention.

3 0
2 years ago
Suppose that in a 00-11 knapsack problem, the order of the items when sorted by increasing weight is the same as their order whe
frosja888 [35]

Answer:

Following are the response to the given question:

Explanation:

The glamorous objective is to examine the items (as being the most valuable and "cheapest" items are chosen) while no item is selectable - in other words, the loading can be reached.

Assume that such a strategy also isn't optimum, this is that there is the set of items not including one of the selfish strategy items (say, i-th item), but instead a heavy, less valuable item j, with j > i and is optimal.

As W_i < w_j, the i-th item may be substituted by the j-th item, as well as the overall load is still sustainable. Moreover, because v_i>v_j and this strategy is better, our total profit has dropped. Contradiction.

8 0
2 years ago
Is the following statement true or false information literacy is a subset of health literacy
BARSIC [14]

the answer is false because information literacy is a whole other type. you don't need it for the structure of health literacy.                              

4 0
2 years ago
The ____________________ chip handles the functions of the keyboard controller.
RoseWind [281]
I think the ROM chip handles the functions of a keyboard controller.
7 0
3 years ago
10 POINTS
Sunny_sXe [5.5K]

Answer:

True

Explanation:

They want to focus on their customers and their interests, so they market their products to a specific audience. hope this helps :)

4 0
2 years ago
Other questions:
  • How do you use a Hard Drive
    5·2 answers
  • Is it possible to learn java s. and c# at the same time? if so I need help who can assist me.
    5·1 answer
  • Which tasks can Kim complete using the Customize Ribbon dialog box? Check all that apply.
    14·1 answer
  • The method main of a class is called when you instantiate an object of that class like this: Box myBox = new Box();
    9·1 answer
  • Does any one here play destiny on xbox one
    12·1 answer
  • What 2 important components are found on a motherboard? (2 points each)
    13·1 answer
  • If you were required to give a speech identifying the risks of using computers and digital devices, which group of items would y
    7·1 answer
  • Which of the following symbols is a part of all spreadsheet functions?
    7·2 answers
  • How can she change that value so it is reflected in the chart in her presentation?
    5·2 answers
  • How does 5G technology enhance the Internet of Things (ioT) ?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!