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
pogonyaev
3 years ago
10

Write a method that takes a Regular Polygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclu

sive, 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 a Regular Polygon perimeter.
Computers and Technology
1 answer:
Fantom [35]3 years ago
8 0

Answer:

Answered below

Explanation:

//Program is written in Java programming language

Class RegularPolygon{

int sides = 0;

int length = 0;

}

public void randomize(RegularPolygon polygon){

int randomSides = (int) 10 + (Math.random() * 20);

double randomLength = 5 + (Math.random() * 11);

polygon.sides = randomSides;

polygon.length = randomLength;

}

You might be interested in
Write a program that accepts a positive integer N as command-line argument, and outputs True if N is the square of some integer,
Ann [662]

Answer:

In Python:

N = int(input("Positive integer: "))

if N > 0:

   flag = False

   for i in range(1,N+1):

       if i * i == N:

           flag = True

           break

   print(str(flag))

else:

   print("Positive integer only")

   

Explanation:

N = int(input("Positive integer: "))

If the number is positive

if N > 0:

This initializes a boolean variable to false

   flag = False

This iterates from 1 to the input integer

   for i in range(1,N+1):

This checks if th number is a square of some integer

       if i * i == N:

If yes, flag is set to true

           flag = True

The loop is exited

           break

This prints either true or false, depending on the result of the loop

   print(str(flag))

If otherwise, that the number is not positive

<em>else:</em>

<em>    print("Positive integer only")</em>

3 0
2 years ago
If AL contains binary 1000 1111, which one will show the information of the binary bits in AL after performing operation SHR AL,
padilas [110]

Answer:

a) AL will contains 0011 1100

Explanation:

In assembly language, shifting bits in registers is a common and important practice. One of the shifting operations is the SHR AL, x where the x specifies that the bits be shifted to the right by x places.

SHR AL, 2 therefore means that the bits contained in the AL should be shifted to the right by two (2) places.

For example, if the AL contains binary 1000 1111, the SHR AL, 2 operation will cause the following to happen

Original bit =>                                        |   1  |  0 |  0  |  0  |  1 |  1 |  1 |  1 |

Shift once to the right =>                |  1 |   0 |  0  |  0  |  1 |  1 |  1 |  1 | (0) |

Shift once to the right =>          |  1 |  0 |  0  |  0  |  1 |  1 |  1 |  1 | (0) | (0) |

Notice;

(i) that there are two shifts - one at a time.

(ii) that the bits in bold face are the bits in the AL after the shift. Those that in regular face are those in the carry flag.

(iii) that the new bits added to the AL after a shift are the ones in bracket. They are always set to 0.

5 0
3 years ago
I hate school...............
butalik [34]

Answer:

Check your email.

Explanation:

8 0
2 years ago
Read 2 more answers
Coordination in a global information system requires a _____ architecture for data, standardization within departments.
Phantasy [73]

Coordination in a global information system requires a decentralized architecture for data, standardization within departments

6 0
2 years ago
1. Which of the following describes a way of memorizing a poem using a mnemonic device?
xenn [34]

Answer:

Singing the words of the poem to the tune of Happy Birthday"

Explanation:

Mnemonic devices are those tools which can be used to improve a persons ability to remember something efficiently. In short, it a technique to memorize something in short period of time and remember it for longer period of time.

Memorizing a poem by singing it to the tune of Happy birthday is also a technique to remember the poem and memorizing it efficiently.

3 0
3 years ago
Other questions:
  • I dopped my Fujifilm Instax mini 8 and now the case won't close and it takes blank pictures can anyone tell me what to do, pleas
    6·2 answers
  • In what year was google launched on the web?
    14·1 answer
  • What command prompts should be used to assign an IP address to:
    9·1 answer
  • When is Hytale coming out?<br><br><br> P.S it might be Mine-craft 2.0<br><br><br> :)
    7·1 answer
  • which of the following types of software is for organizing analyzing and storing data in a table A spreadsheet software B databa
    11·1 answer
  • Explain the difference between undecidable problems and unreasonable time algorithms. Be specific.
    5·1 answer
  • Which of the following guidelines about the subject line of e-mail messages is most appropriate?
    15·2 answers
  • With SQL, how do you select all the columns from a table named "Persons"?
    8·1 answer
  • Please help fast
    5·1 answer
  • 1. Fill in the blanks with appropriate word. 5°1-5 is a collection of raw unprocessed facts, figures, and symbols ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!