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
The Align Center option in the Alignment grouping on the Table Tools Layout tab will _____.
AnnyKZ [126]

the awnser would be d center the text vertically and horrizontaly in the cell

6 0
3 years ago
Read 2 more answers
Given an ofstream object named output, associate it with a file named yearsummary.txt for output in a way that truncates (erases
timurjin [86]

Answer:

The answer is output.open("yearsummary.txt", ios::trunc)

Explanation:

Given an ofstream object named output, associate it with a file named yearsummary.txt for output in a way that truncates (erases) any existing data in the file. The file is output.open("yearsummary.txt", ios::trunc)

4 0
3 years ago
What characters are in Tekken 3
MrMuchimi

Answer:Tekken 3 features a largely new cast of characters, including the debut of several now-staple characters such as Jin Kazama, Ling Xiaoyu, Bryan Fury, Eddy Gordo and Hwoarang, with a total of twenty-three characters.

Explanation: I feel like the answer is pretty strait forward.

6 0
4 years ago
3-5 paragraphs on how and why robotics are used in nuclear fields
Dmitriy789 [7]
Robots can be used in fabrics where they now use them to help do the work faster and do somethings that humans cant do.
3 0
4 years ago
Read 2 more answers
Which computer discipline involves the widest scope of computer-related
noname [10]

Answer: D, computer science

Explanation: Computer engineering is a specific field of computer science, as well as B and Software Engineering

5 0
2 years ago
Read 2 more answers
Other questions:
  • What is the command to use the memory diagnostics tool?
    11·1 answer
  • Which one of these is the most commonly used hardware interface for attaching peripherals to a microcomputer?
    8·1 answer
  • Can someone please help me with this question??
    12·1 answer
  • In order to make burger a chef needs the following ingredients one piece of chicken meat 3 lettuce leaves 6 tomato slices Write
    8·1 answer
  • Write a class named Episode. An instance of this episode class will represent a single episode of a TV show, with a title, a sea
    12·1 answer
  • WILL UPVOTE ALL plz
    13·1 answer
  • Universal Containers has a sales team focused on renewals. They will use many of the same Opportunity fields as other teams, but
    13·1 answer
  • Ex: If the input is: Pat Silly Doe the output is: Doe, P.S.
    9·1 answer
  • Device driver:<br> System software or application software
    11·2 answers
  • What enables image processing, speech recognition, and complex game play in artificial intelligence?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!