Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclusive, 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.

Answers

Answer 1

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.


Related Questions

What should you do first when designing a program?

Answers

Answer: talk about da progrm

Explanation:

Answer:

Step-by step Explanation:

I will give brainliest!!!
When you have a kWh reading you get a number. But look at the example below
67, 659 kWh
67,659 kWh
In the first one there is a space after the comma
Which is right?

Answers

Answer:

The second one is correct you don't put a space after the comma.

Explanation:

What function is used to return the results in column D?

What function is used to return the results in column E?

Vehicles that are $20,000 or less and are the color red describes the data in which column?

Answers

Answer:

abd

Explanation:

a,b,d

A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit will cost 100. Judge and print total cost for user.

Answers

Answer:

The program in Python is as follows:

qty = int(input("Quantity: "))

price = 100 * qty

if qty >1000:

    price = (100 - 0.10 * 100) * qty

print("Cost: "+str(price))

Explanation:

This prompts the user for the quantity

qty = int(input("Quantity: "))

This calculates the price or cost, without discount

price = 100 * qty

This checks if the quantity is greater than 1000

if qty >1000:

If yes, this calculates the price or cost, after discount

    price = (100 - 0.10 * 100) * qty

This prints the calculated cost

print("Cost: "+str(price))

In the Business world people are often measured by their???

A- soft skills
B- hobbies
C- iq
D- technical skills

Answers

it is D technical skills

In the business world, people are often measured by their technical skills.

The technical skills that people possess in the business world are those computational and technological skills that are makes them suitable for the job positions they occupy.

People are to have specialized trainings and they should be experts in their fields. This would make it easier for them to achieve tasks.

These are practical skills that could be in:

Information technologyAccountingData analysisTechnical writing and lots more.

Here is a similar question https://brainly.com/question/23155579?referrer=searchResults

Yo, my Lenovo laptop keeps showing this screen but I can't sign in, can someone help me?

Answers

break your laptop and get a new one
Try completely restarting it 1 or 2 times and see if that works first

List and describe 3 parts (often referred to as 'elements') of a web page?

Answers

Answer:

Content

Design

Development

Explanation:

The design and management of sites is internet explorer; it is the research that takes place over time to make a site look fantastic, work quickly and function well with a smooth user interface.

Software that displays advertising material when online.

A. Adware

B. Advertisware

C. Consumerware

D. Sellware

Answers

Answer:

adware

Explanation:

Adware is a software that shows ads etc online, but also sometimes on the desktop.

Advertisware is not a real term, this is to throw you off.

Sellware is a website not a type of software

Adware is software that displays advertisements automatically once installed.

Software that requires excessive disk space or memory.

A. Malware

B. Excessware

C. Ransomware

D. Bloatware

Answers

The correct answer is D. Bloatware

A bubble starts by comparing the first item in the list to all the remaining items, and swaps where the first item is ____ a later item.
greater than
less than
equal to

Answers

Answer:

greater than

i think

A bubble starts by comparing the first item in the list to all the remaining items, and swaps where the first item is greater than a later item. Thus, option A is correct.

What happens in a binary sort?

Such a binary sort, in which we keep comparing the pairs of items, swapping them if they are not in order, until the smallest item bubble to the top of the list, therefore creating a sorted list which is known as bubble sort.

A Binary search tree (BST) is a type of data structure used in computer science that consists of nodes arranged in a hierarchical structure. Each node in a BST contains a value, and the left child node contains a value that is smaller than its parent, while the right child node contains a value that is larger than its parent.

This makes BSTs ordered, as the elements are arranged in a specific order. They are also sometimes called sorted binary trees, as the values are sorted in a specific order. BSTs are commonly used in computer algorithms, as they allow for efficient searching, insertion, and deletion of elements.

Thus, option A is correct.

Learn more about algorithms on:

https://brainly.com/question/22984934

#SPJ3

How much data can be transmitted with a digital signal?

Answers

Answer:

two possible

Explanation:

In most digital circuits, the signal can have two possible valid values; this is called a binary signal or logic signal. They are represented by two voltage bands: one near a reference value (typically termed as ground or zero volts), and the other a value near the supply voltage

Question # 1 Multiple Select Which of the following shows the assignment of a string to a variable? Select 3 options. answer = "23" answer = (23) answer = '23' answer 23 answer = input("How old are you?") ​

Answers

Answer:

answer = input("How old are you?")

Explanation:

Answer is a variable The Input function takes a string

Answer:

answer = input("How old are you? ")answer = '23'answer = "23"

Explanation: Correct on Edg 2020/2021.

5. Robotics deals with the design, construction, operation, and use of robots, as well as computer systems for their control, sensory feedback, and information processing.
These technologies are used to develop machines that can substitute for humans and
replicate human actions.
a) False
b) True

Answers

The answer would be

True

HELP! WILL GIVE BRAINLYEST!
Complete the sentence describing an analog signal.
An analog signal is a continuous signal, transmitted in the form of sine waves of varying
______.

Answers

Answer:

An analog signal is a continuous signal transmitted in the form of sine waves of varying amplitude

Explanation:

An analog signal is a step varying analog waveform that conveys information in a manner that is continuous in both amplitude and time

An analog process is one whose signal continuously varies, maintains a basic shape, and is transferable between mediums such that information is conveyed by analog signals based on analogy, which is one quantity tending to mimic another quantity's behavior

Signals of sound, voltage, data, voltage, or electric current can be transmitted as analog signals

What properties can be standardized when a theme is applied to a document? Check all that apply. the font styles used in a document the colors of the text in a document the size of the pages in a document the number of words in a document the color of the pages in a document

Answers

Answer:

✓the font styles used in a document

✓the colors of the text in a document

✓the color of the pages in a document

Explanation:

Standardizing a document are ways to bring the best out of the documents, and this can be achieved in various levels when working on the documents. Standardization can be performed on the structure and the content of the documents as well as the layout. Information models can be of use when standardizing. A theme can also be applied which which gives overall look for the documents in term of fonts, effect as well as colors. Some properties can be standardized when applying theme to a document, and these properties are ;

✓the font styles used in a document

✓the colors of the text in a document

✓the color of the pages in a document

To use Microsoft word in application of theme to a document, these steps can be followed;

✓click on " Design tab"

✓click on "theme" to select choices.

Answer:

case, color, size, and style

Explanation:

edge2021

What was your first experience with listening to kpop?

For me the first kpop song I heard was Gangnam Style, but I never got further into it after listening to psy. For me Got7 really got me into kpop with their song 'Just Right'. Hearing the recent news about Got7 made me really sad, I hope
they do well in the future!

(Girl in the photo- Momo from Twice)


Groups I currently Stan in order:
Twice
Red Velvet
Loona
April
CLC
ITZY
Apink
SNSD (Girls Generation)
Gfriend
Fromis 9
Dreamcatcher
Mamamoo
StrayKids
Oh My Girl
NCT
Got7 (I still don't know if they disbanded or just left jyp)
Iz*one
G-idle
Blackpink

I can't think of anymore :(
(and yes I LOVE a lot solo artists)

Answers

Answer:

My first experience with kpop was when I was six I just danced to it lol I forgot the name of the song but it was funny watching the video of me.

Explanation:

Answer:

My older brother got me into kpop at a very young age. I grew up listening to big-bang and exo and girls generation.

oh yea I share the same birthday as G-dragon

Here dude this is what I was talking about

Answers

Answer:

go to your email and refresh the page and if it didnt work just email them

Put ur number if I dosent work then send them a email

explain how do compare and contrast graphic organizers help you to synthesize information?

Answers

Answer:

Answer: Given two or more sets of features of items, people, events, etc; compare and contrast graphic organizers help you to see what the sets have in common and what difference one set from the others, that is, what characteristics are unique from each set.

Explanation:

Given two or more sets of features of items, people, events, etc; compare and contrast graphic organizers help you to see what the sets have in common and what difference one set from the others, that is, what characteristics are unique from each set

A histogram titled Greeting card sales has date on the x-axis and cards (millions) on the y-axis. January is 1 card, February: 11, March: 1, April: 1, May: 9, June: 7, July: 1, August: 1, September: 1, October: 9, November: 7, December: 12. The histogram shows the monthly sales for a greeting card company in one year. Which best describes the data for May–June and October–December? clusters no frequency gaps symmetry

Answers

Answer:

Clusters

Explanation:

Given

The histogram

Required

What does May-June and October-December represents

The data for May-June is:

[tex]May: 9[/tex]

[tex]June: 7[/tex]

For October-December, it is:

[tex]October: 9[/tex]

[tex]November: 7[/tex]

[tex]December: 12[/tex]

Notice that these data are close to each other.

This implies that they are clusters

Answer:

the answer is a

Explanation:

You can raise an object to a height of 2 meters by pulling down a distance of 8 meters on a pulley with a force of 40 N. How heavy an object can you lift with his effort?

Answers

Answer:

160 N

Explanation:

Since, work done by effort = work done by load,

Fd = F'd' where F = effort force = 40 N, d = distance moved by effort = 8 m, F = load and d' = distance moved by load = 2 m.

So, Fd = F'd'

40 N × 8 m = F' × 2 m

320 Nm = 2F m

So, F = 320 Nm/2m

= 160 N

So, the object that can be lifted is an object of 160 N

PLEASE HELP ASAP!!! Prompt
What is the Bcc address field for?

Answers

Answer:

For security and privacy reasons, it is best to use the Blind Carbon Copy (BCC) feature when sending an email message to a large number of people. When you place email addresses in the BCC field of a message, those addresses are invisible to the recipients of the email.

Explanation:

You wrote a program to allow to guess a number chosen randomly.

How did you check to see whether the guess was equal to the correct answer?

if guess
BLANK
answer:

A: ==
B:!=
C:=

Answers

I think that it is A as well

An eReader has a 956-pixel x 1290-pixel grayscale display with each pixel able to display 32 shades of gray. What is the KiB size of the display memory for the device

Answers

Answer:

752.71 kilobytes

Explanation:

Given ;

956-pixel x 1290-pixel

Shades of gray, = 32

Bit depth (n) = 2^n

32 = 2^5

Bit depth, n = 5 bits / pixel

The size of display memory :

Pixel dimension * n

(956 Pixel * 1290 pixel) * 5 bits /pixel

= 6166200 pixel * bits / pixel

= 6166200 bits

Converting bits to kilobytes :

1 bit = 1/8 bytes

1 byte = 1/1024 kilobytes

Hence,

1 bit = 1/(8 * 1024) kilobytes

1 bit = 1/8192 kilobytes

6166200 bits = (1/8192 * 6166200) kilobytes

= 752.7099609375 kilobytes

= 752.71 kilobytes

Name and define (or list the set that defines) three of the four common data types in programming.

Answers

Answer: this is the  Answer your question

Which technology will a business use to figure out who accessed confidential files on a company's computer system

Answers

Answer:

insaj cdsjl ljhwbalfhb

Explanation:

A structure that organizes data in a list that is commonly 1- dimensional or 2- dimensional
Group of answer choices

Array

Linear Section

Constant

No answer text provided.

Answers

Answer:

  (a)  Array

Explanation:

An array is a data structure that can be used to organize 1- or 2-dimensional data in a list.

Answer:

(a) Array

Explanation:

Need Help! Asap 7.5 code practice (Edhesive)

Answers

Answer:

Make main function

def main():

Make some constants for the grades

A = 5.0 or 4.0

B = 4.0 or 3.0

C = 3.0 or 2.0

D = 2.0 or 1.0

F = 1.0 or 0.0

In the main function call the function you made and make sure to use those constants for help

also don't forget to call your main function or nothing will work

Explanation:

Making the main function is good programming practice for your future

Making the constants is also helpful to your programming.

Now how it works you call the function you wrote to calculate the grade.

I don't know how helpful this was this is one of my first answers. I am `also answering how I would do it

What is the output for the following program? numB = 2 while numB < 15: numB = numB + 5 print(numB) Output:

Answers

The following program is a while loop that will output the following data

7,12,17.

In the first iteration, the variable numB is 2, since 2 is less than 15, the program will run the command

numB = numB+5 and it will print 7

The second iteration is still valid because numB is now 7 and is less than 15, so the program will run the command

numB = numB+5 and it will print 12

The third iteration is still valid because numB is now 12 and is less than 15, so the program will run the command

numB = numB+5 and it will print 17

The fourth iteration is not valid because numB is now 17 and is greater than 15, so the program will not run the command

Learn more:

https://brainly.com/question/19344465

Answer: 7,12,17.

Explanation: got it right on edgen

This is your data.
A= [5, 10, 15]
B = [2, 4, 6]
C = ['dog','cat', 'bird']
You can implement an array of this data with

Answers

Answer:

This is your data.

A =  [5, 10, 15]

B =  [2, 4, 6]

C =  ['dog','cat', 'bird']

You can implement an array of this data with  

either by using lists or by using the array module

ALSO

This is your code.

>>> A = [ 'dog', 'red']

>>> B = [ 'cat', 'blue']

>>> C = [ 'fish', 'green']

You can implement an array of this data by using  

by using lists but not by using the array module

Explanation:

Edge2020

A= [5, 10, 15],  B = [2, 4, 6], C = ['dog','cat', 'bird']. You can implement an array of this data either by using lists or by using the array module.

What is an Array?

An array is a type of data structure used in computer science that holds a set of elements that are all uniquely recognized by at least one array index or key. Each element of an array is recorded such that a mathematical formula may be used to determine its location from its index tuple.

Indexed arrays, multidimensional arrays, and associative arrays are the three types of arrays.

A procedure called indexing selects a subset of values from an array. A value's position inside an array is indicated by its index. The location of the value in an array differs from the value itself.

To read more about Array, refer to - https://brainly.com/question/14375939

#SPJ2

Which of the following is NOT a standardized size for an editorial design?

11 inches by 14 1/2 inches

5 1/2 inches by 8 1/2 inches

8 1/2 inches by 11 inches

14 1/2 in by 24 inches

Answers

Answer:

14 1/2 in by 24 inches

Explanation:

Editorial designing belongs to the graphic design. It refers to the designing of the newspapers, books, magazines, and many more. Editorial designs are also made in online publications. Various online advertising agencies use them to provides ad online.

The main objective of an editorial design is to make the publication visually very interesting, attractive for the readers and should be easily understood by the reader.

There are various format sizes for publishing an item in editorial designing. The standard sizes are :

a).[tex]11 \ \text{inches by} \ 14 \frac{1}{2} \ \text{inches}[/tex]

b). [tex]8 \frac{1}{2} \ \text{inches by} \ 11 \ \text{inches}[/tex]

c). [tex]5 \frac{1}{2} \ \text{inches by} \ 8 \frac{1}{2} \ \text{inches}[/tex]

Other Questions
According to Interland (2009), the art of economics consists in looking not merely at the immediate but at the longer effects of any act or policy; it consists of tracing the consequences of that policy not merely for one group but for all groups. Discuss Which of the following represents y as a function of x? A group of friends really love to go bowling together. Here are a set of final scores from a recent bowling trip: 147, 160, 80, 110, 121, 164, 62, 90, 76, 83, 110Required:What is the mean? The department of transportation was doing a study and found thint at the intersection in front of the schoolthat an average of 19 cars per minute go through the intersection. Based on this statistic, how many carswould you estimate go through that intersection in a year? Gloria is an artist and is making paintings for a show 6 months from now. She made a purchase of items she would need in order to create her paintings. The paints and brushes she purchased were enough for all of her paintings for a 6 month period. She also need canvas' to paint on and planned to purchase them as needed over the 6 month period. The equation to represent her total cost is given by T = $38.40c + $2,472.00 where T is the total cost and c is the number of canvas' Gloria purchased. Choose 3 answers to answer the 3 questions. a) How much did Gloria pay for the brushes and the paints? b) How much will Gloria pay for each canvas? c) If Gloria makes a total of 35 paintings, what is her total cost? Some help pleaseThank you Why does your heart rate increase while exercising? Boden's account has a principal of $800 and a simple interest rate of 3.9%. Complete the number line. How much money will be in the account after 4 years, assuming Boden does not add or take out any money? please help its urgent Proofthatif A is a subset of B then AnB =A by contrapositive statement A fox population used to have white fur. In recent years, tan and lightbrown colors started to appear in the population.Which option would cause such a change? 6. How did the art of the Byzantine Empire help preserve the traditions of the Roman Empire? Which President WAS NOT impeached?Group of answer choicesTrumpClintonNixonJohnson B. If as the price of good Y rises from $1.25 to $1.35, the quantities demanded of good X become those shown in column 4, it can be concluded that X and Y are (substitute, complementary) ____________________ goods. Help plsssss I will mark as brainlest if correct 5 5/3 =solve this right and get points! Why does the moon looks a little different each night? is this a good sentence it's about being grateful if it's not good what do you recommend I change or work onMy second reason is food there are people out there who dont even have anything to eat and starving many people dont even appreciate that they have enough to buy food and they dont have to be hungry all the time. My third reason is Shelter I'm lucky that I have a house to live in and there's people who have to sleep outside and I get to sleep in a house that protects me from the weather and gives me security and comfort there's people who take their shelter for granted not everyone gets that luxury. Brainlist for real if you help me those four question. I swear i will give you a brainlist 1. What is the gravity like on Mars, or Saturn?2. Could there be places with more gravity than the Earth has?3. Could there be places with even less gravity than the moon has?4. Could there be a planet with so little gravity that you could jump over a basketball hoop!? At a sale, dresses were sold for $24 each. This price was 12% of a dress's original price. How much did a dress originally cost? what's the answer to question c in the graph below