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]
2 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:
monitta2 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
What programming language supports relational databases?
WINSTONCH [101]

A programming language that supports relational databases is SQL (Structured Query Language)

Structured Query Language (SQL), is the principal method for communicating with Relational Databases.

A relational database is a group of data elements that are linked together by predefined connections. These elements are laid up in the form of a series of tables containing columns and rows.

  • Tables are utilized for storing data about the items that will be displayed in the database.
  • A column in a database contains a specific type of data, whereas a field records the actual value of an attribute.
  • The table's rows indicate a collection of linked values for a single item or entity.

Each entry in a database can be assigned a unique identity known as a primary key, and rows from other tables can be linked together via foreign keys. This data may be accessible in a variety of ways without having to reorganize the database tables itself.

Learn more about Relational Databases here:

brainly.com/question/8457395?referrer=searchResults

5 0
2 years ago
A user wants to quickly share pictures between mobile devices. The devices will be in close proximity so the necessity of a thir
BlackZzzverrR [31]

Answer:

NFC(Near Field Communication).

Explanation:

When user wants to share pictures quickly between the mobile devices which are in very close proximity we can use NFC(Near Field Communication).

Near Field Communication(NFC):-It is a group of communication protocols that lets two devices most of the times these are mobile phones to establish connection and the distance between them should be less around 4 centi meter.

8 0
3 years ago
If i were to give you free points woulld you take them?
kipiarov [429]

Answer:

D) friend me

Explanation:

6 0
3 years ago
Read 2 more answers
The space that helps you organize your PowerPoint or Web Page is called ______.
sergeinik [125]

Answer:

the internet

Explanation:

cause I said

8 0
2 years ago
Select the correct answer.
aliina [53]

Answer:

B

Explanation:

engineers design and carry out test cases and evaluate exit criteria (by following the scope set in the planning phase). They create bug reports describing detected defects and report to the stakeholders on the test findings and the completion status. Testing may be repeated to check for errors.

7 0
3 years ago
Other questions:
  • The process of executing a program is also called ________.
    8·1 answer
  • Find the largest and smallest byte,short,int,long,float, and double. Which of these data types requires the least amount of memo
    5·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • Which sentence is correctly punctuated? WILL GIVE YU MONEY GIVE ME YOUR CASH APP PLS
    12·2 answers
  • Question 1(Multiple Choice Worth 5 points)
    9·1 answer
  • The wildcard character * (asterisk/start) and ? (question mark) are the same and can be use interchangeably.
    6·1 answer
  • 8.3 code practice edhesive PLEASE HELP AND HURRY
    9·1 answer
  • Helppppppppppp please
    5·2 answers
  • 2. Explain the difference between a JMP instruction and CALL instruction
    6·1 answer
  • Is it a way to get robuc 4 free
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!