Write the method drawSquare below.
/** Precondition: 0 ≤ x < 10, 0 < y ≤ 10, and len > 0.
* Draws a square on a 10-by-10 xy-coordinate grid
* and prints the square’s side length and area.
* The upper left corner of the square will be located
* at the coordinate (x, y) and the side length of the * square will be len (or as large as will fit in the grid).
*/
public void drawSquare(int x, int y, int len)

Answers

Answer 1

The method drawSquare is an illustration of functions; functions are named program statements that are executed when called

The method drawSquare

The method drawSquare written in Java, where comments are used to explain each action is as follows:

//This defines the function

public static void drawSquare(int x, int y, int len) {

//This checks if x + len exceeds 10

       if(x+len>10){

           len = 10-x;}

//This checks if y + len exceeds 10

       if(y+len>10){

           len = 10-y;}

//The next four lines draw the square

       drawLine(x, y, x+len, y);

       drawLine(x+len,y,x+len,y-len);

       drawLine(x+len, y-len, x, y-len);

       drawLine(x, y-len, x, y);

   }

Read more about java programs at:

https://brainly.com/question/19271625


Related Questions

explain with example how does delay marriage help for population management​

Answers

Answer:

Explanation:

The population in western richer countries is decreasing but the population in some poorer developing countries is increasing and normally in the poorer communities where education is minimal or not encouraged then men and women tend to get married young and have many children. Population management is not necessary because when men and women are educated and have good standard of living with a good social system of caring for the old then married couples will tend to have one or two kids or none at all. Population control was practised by PrC and it managed to alleviate 60% of the people out if poverty and reduced the population by implementing one child policy. Now China has more male than female creating social problems of finding a wife. In the West with good social system to care for the elderly more couples are not having children. In the west where living conditions and educational level are better the Caucasian race is not having that many children as the other races in developing countries. Education and financial independence of women will encourage married women to have one or two kids so that they can still pursue their career after marriage. With modern contraception you can delay having children until you are ready for them. The concept of delaying marriage to reduce population does not hold true. However the whites’ population is decreasing every year as compared to the other non white races. The reason is that in the poorer non white countries the population is higher because of subservient position of the women who have no say in birth control

Can someone come and see if I have answered this question correctly? Please ...
if i have a mistake or somewhere i can go deeper can you correct me? Thank you

Answers

Answer:

presentation or visualization

Presentation or visualization

Which word describes an important characteristic of good computer
algorithms?
O A. Numerical
B. Complex
C. Lengthy
D. Literal

Answers

I personally would pick Numerical but lengthy would work as well tbh both would work

The word that describes an important characteristic of good computer algorithms is Numerical. Thus, option A is correct.

What is computer algorithms?

The term computer algorithms has been defined as the a set of the instructions that would describes a step-by-step process for solving a specific problem. It has been often used in computer programming to automate repetitive tasks and streamline complex operations.

When an algorithm has integrated into a computer program, the process becomes automated, allowing the computer to perform the task repeatedly with minimal input from the user.

Therefore, the algorithm lacks the instructions for handling unexpected or the unanticipated results, the computer program may halt or encounter errors, potentially causing significant disruptions to the process.

Learn more about Algorithm on::

brainly.com/question/20533936

#SPJ7

Read the scenario and answer the question. Audrey had problems with her computer software recently. One of her programs shut down unexpectedly, but not because of a virus. Unable to troubleshoot the problem herself, Audrey called a computer technician, who gave her a checklist of things to look for and fix. Her software began to work again, but not for long. The following week, Audrey had the same problem with her software. What is the first step Audrey should take? Refer to the troubleshooting checklist. Scan the computer for viruses. Remove all unwanted files from the computer. Pay to have a technician repair the computer.

Answers

Answer:

Refer to the troubleshooting checklist.

Explanation:

I got it right in edge:)

Answer:

The answer is a btw

Explanation:

thanks for deleting my answer

Please post detailed answers to the following questions. Please use complete sentences.

Pick a piece of art, music, or architecture and explain how it reflects our era. What will historians in the future learn about us by studying the elements of our culture?

Answers

Answer:

Music

Detailed Paragraph:

            I believe that those who really love and care about music are the ones who grew up listening to songs that touched them and spoke to them in a profound way. I remember being in middle school when the music I listened to defined so much of my identity. Thus, in return, it's almost our unspoken job to create a sound that will be amplified to the next generation, impacting them and impacting our society in return. If we can gain a more comprehensive awareness of how our art form is making a difference around us, we will undoubtedly become better musicians – musicians with a purpose.

Which sections should you survey while reading difficult material?
a. Diagrams
C. Main ideas
b. Visual Aids
d. All of these
Please select the best answer from the choices provided
Ο Α
OB
ОС
D

Answers

I would say all of the above since they all can help to some degree. If I’m right can you mark brainliest?

When reading difficult material, pay close attention to diagrams, key points, visuals, and so on. As a result, the answer to this question is D, or all of them.

What is survey?

A survey in human subjects research is a set of questions designed to elicit specific information from a specific group of people.

Surveys can be conducted over the phone, by mail, on the internet, or even on street corners or in shopping malls.

Reading comprehension, vocabulary, phonics, fluency, phonemic awareness, and a variety of other skills must all be considered when reading. Each of them has a distinct role to play in any literary work.

Before reading, each reader must meet a number of requirements. When conducting the survey, you must prioritize the diagram because it quickly and efficiently interprets all of the data.

However, the primary ideas and visual aids are equally important in order to absorb the information quickly.

Thus, the correct option is D.

For more details regarding survey, visit:

https://brainly.com/question/17373064

#SPJ7

Select the correct answer. What is the key function of a sales team? A. to maintain customer-retailer interaction B. to create appealing advertisements C. to maintain fan–developer communication D. to develop customer–fan relationships

Answers

Answer:

B

Explanation:

to make people want it buy it is the purpose

Which of the following shows the assignment of a string to a variable ? Select 3 options.
A. answer = 23
B. answer = '23'
C. answer = input (" How old are you ? ") D. answer = (23)
E. answer = " 23 "​

Answers

The answer is going to be D
the answer is D answer = (23)

True or False? A list can be linear (items are arranged one after the other) or linked (each item has a pointer to the next item in the list).

Answers

Answer:

True

Explanation:

True

Reasoning it’s true because a list can be linear items arranged one after the other one

Can anyone tell me what wrong with this code the instructions are "Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a random number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed." My code runs but it hasa EOF. My code is

import random
random.seed(1,10)
a = random.randint (1,10)
b = random.randint (1,10)
print ("What is: " + str(a) + " X " + str(b) + "?")

ans = int(input("Your answer: "))

if (a * b == ans):
print ("Correct!")
else:
print ("Incorrect!")

Answers

Answer:

import random

a = random.randint(1,10)

b = random.randint(1,10)

answer = a * b

print(str(b)+" * "+str(a)+" = "+str(answer))

Explanation: So I am guessing you are on Edhesive Module 2.5 Intro to cs. Sorry it took so long but hopefully this works.

1. P_OP_EW_RE
2.H_R_W_R_
3._ON_E_TI_IT_
4.P_OC_D_RE
5._O_TW_R_​

Answers

Answer:

poopaewr4vh23rbu2rfbu2rfu

Explanation:

[Python] Spot the errors in the code
x = int(input()
if x == 5
print(x is equal to 5)
else:
print("x is not equal to 5")

Answers

Answer:

There's no string double quotes in the print statement on line 3.The input statement on line 1 is wrong. It should actually be the following ⇒ print(input(Hello World))

All print statements must contain double quotes around a string. Otherwise, it will be interpreted as a number, and will lead to an error.

This motherboard already has 1GB of RAM installed in the DIMM1 slot. The customerwould like to upgrade to 4GB total memory, use the existing module if possible, and usedual-channel. What memory modules are needed? What capacities and how many ofeach capacity are required?

Answers

Answer:

The two phases to the context of this discussion are listed follows.

Explanation:

Solution 1: Delete 1 GB of current RAM as well as install another DIMM0 Chan A slot through one 2 GB of double-channel RAM. (thinkable unless the 2 GB RAM is provided by the motherboard in what seems like a DIMM0 Chan A slot)  Solution 2: whether there's an unused or blank slot, perhaps one 1 GB dual-channel Ram could be mounted in some other slot at around the same speed or frequency.  

It's quite safer to mount memory with appropriate frequencies across both situations.

The two phases are as follows:

Delete 1 GB of current RAM and install another DIMM0 Chan A slot through one 2 GB of double-channel RAM. (thinkable unless the 2 GB RAM is given by the motherboard in what seems like a DIMM0 Chan A slot)  .In the case when there's an unused or blank slot, so one 1 GB dual-channel Ram could be mounted in some other slot at around the similar speed or frequency.  

It's quite safe to mount memory having appropriate frequencies across both situations.

Learn more: brainly.com/question/17429689

What do you like least about coding in python?​

Answers

Something I dislike is it emphatically controverts decades of programming experience with its syntax.

explain why a holiday on a cruise liner will be an ideal holiday​

Answers

Answer:

The great thing about a cruise holiday is that everyone in your party can please themselves yet still have a real holiday together. The kids can make new friends and take part in fun and educational activities during the day, while the adults unwind by the pool, learn a new skill or hit the casino.

In Fantasy Football, participants compete against one another by choosing certain players from different NFL teams that they think will do the best on any particular week. Top Fantasy Football players spend hours every day looking at statistics of the players and the teams. Spreadsheets and software tools are used to choose the best players. This process would be considered __________.
a. Data persistence
b. Data divide
c. Data collection
d. Data mining

Answers

This process that would be considered in the above scenario is Data mining.

What is data mining?

Data mining is known to be the act or method of knowing more about data via;

Leaning raw data.Finding patterns.Forming models.Testing those models.

Note that  It is a method that uses statistics, machine learning, and database systems and it will be good tool to be used in the scenario above.

Learn more about Data mining from

https://brainly.com/question/14776357

This software application can be used to create multimedia presentations.
Excel
OneDrive
PowerPoint
Word

Answers

it would be powerpoint

Answer:

power point i think

Explanation:

can someone give me an window blur code in javascript like i mean full coding

Answers

Answer:

uh wha- what?!?!

Explanation:

no

find it urself

:P

jekqfjewil bored anyways

After the Afton family dies what animatronics do their souls posses. Michael Afton dose not posses an animatronic but what dose Michael become and what is his animatronic "friend". UwU

Answers

Answer:

Michael becomes Golden Freddy.

Explanation:

I hate I know this and I know it's a joke but here we go

In theory, they all become -

Mrs. Afton - Ballora

Elizabeth - Circus Baby

William Afton - Doesn't really become anyone but he is inside Springtrap

The Crying Child - Theorised to be Golden Freddy

Michael Afton - Doesn't become anyone at all, but does have robot spaghetti of all the Sister Location animatronics// his friend is Eggs Benedict but no one knows for sure.

In a function template, the programmer substitutes __________ for __________. Group of answer choices arguments, parameters angle brackets, parentheses parameters, data types None of these parameters, arguments

Answers

Answer: parameters, data types

Write a code segment that uses a while loop and the random.randint and print functions to generate and print random integers between or including 1 and 6 until a 6 is rolled. The code segment must also count the number of times the number 3 was generated and display that value once at the very end of its execution.

Answers

In python:

import random

i = 0

while True:

   w = random.randint(1,6)

   if w == 6:

       break

   elif w == 3:

       i += 1

   print(w)

print(f"3 was generated {i} times")

I don't exactly know how you want the output but you should be able to modify my code according to your needs. I hope this helps!

   

Write Python code for the following flowcharts

Answers

print("Enter a number")

number = input()

if number >= 1000: print("Bigger or equal to 1000")

else: print("Smaller than 1000")

Digital citizenship focuses on _____. Select 3 options.

Answers

Respect, Education, and Protect.

Digital citizenship focuses on the following:

B. helping and leading others

C. targeting potential cyber criminals.

D. creating positive online experiences

What is digital citizenship?

The capacity to operate a keyboard, mouse, and other components of the digital system, as well as to interact with others online, is known as digital citizenship.

It also refers to learning how to behave with respect and decency on digital platforms, as well as how to communicate effectively online and build relationships.

The major goal of digital citizenship is to foster a pleasant environment by teaching others about cybercrime and bullying and raising their awareness of these issues.

Thus, the correct options are B. helping and leading others

C. targeting potential cyber criminals.

D. creating positive online experiences

To learn more about digital citizenship, refer to the link:

brainly.com/question/11542933

#SPJ5

The question is incomplete. You most probably the complete question is given below:

enforcing your rights on others

helping and leading others

targeting potential cybercriminals

creating positive online experiences

promoting the common good

Write 200 words about Japan? ​

Answers

Japan, island country lying off the east coast of Asia. It consists of a great string of islands in a northeast-southwest arc that stretches for approximately 1,500 miles (2,400 km) through the western North Pacific Ocean. Nearly the entire land area is taken up by the country’s four main islands; from north to south these are Hokkaido (Hokkaidō), Honshu (Honshū), Shikoku, and Kyushu (Kyūshū). Honshu is the largest of the four, followed in size by Hokkaido, Kyushu, and Shikoku. In addition, there are numerous smaller islands, the major groups of which are the Ryukyu (Nansei) Islands (including the island of Okinawa) to the south and west of Kyushu and the Izu, Bonin (Ogasawara), and Volcano (Kazan) islands to the south and east of central Honshu. The national capital, Tokyo (Tōkyō), in east-central Honshu, is one of the world’s most populous cities.

The option to send a publication in an e-mail is available in the _____ tab.

File
Home
View
Review

Answers

Answer:

File

Explanation:

Select the correct technical term for each definition by using the drop-down menus.
A keyboard, mouse, and microphone are examples of
А
Mis an input device used to display video for video conferencing,
A
is an input device that responds to finger touch.
DONEN

Answers

The answer response are:

A keyboard, mouse, and microphone are examples of input devices.A display device is an output device used to display video for video conferencing.A touchpad is an input device that responds to finger touch.

What are the input devices?

Input devices are devices that allow users to input information into a computer, such as a keyboard, mouse, or microphone.

A display device is an output device that is used to present information in visual form, such as a computer screen or television screen. Display devices are used for video conferencing to show visual information to participants.

In all, a keyboard, mouse, and microphone are examples of input devices, a display device is used for output and video conferencing, and a touchpad is a type of input device that responds to finger touch.

Learn more about input devices from

https://brainly.com/question/12081537

#SPJ1

Which term refers to a secure systems ability to protect against the unauthorized modification or destruction of information?.

Answers

Answer:

Integrity

Explanation:

Who makes "white box" computers?
O non-major companies
O Microsoft
Asus
Apple

Answers

Answer:

O NON- MAJOR COMPANIES.

how do u type please help

Answers

Answer:

use your keyboard

Explanation:

listen your 2 years old i know you can type daughter

Answer:

maybe try doing the same thing that you did a few minutes ago to type the exact same thing?

Explanation:

I am not about to explain every move that has to be taken to type a sentence -_-

In access, what are the different parts of a database application called?.

Answers

Answer:

An application part can be as simple as a single table, or it can include several database objects, including tables, forms, reports, and even relationships. In Access, you can open up the Application Parts gallery to view the built-in parts.

Explanation:

Other Questions
According to Thomas Hobbes, what do men have to do in order to avoid war?you agree with Hobbes? Explain.DoHelp me and Ill mark u brainliest Write a code segment that uses a while loop and the random.randint and print functions to generate and print random integers between or including 1 and 6 until a 6 is rolled. The code segment must also count the number of times the number 3 was generated and display that value once at the very end of its execution. (25 POINTS) How does sediment size around a river affect erosion? Which of the following is in correct order in terms of increasing intermolecular forces? Whose temple did Medusa work in? A) Athena B) Zeus c) Posedion why did the ancient greeks travel on the seas help me please Which term describes the two groups of plants that do not need water to reproduce?Paleozoic plantscotyledonsspermatophytesembryophytes If a snail moves 1 1/2 feet in 3 3/4 hours, what is its speed in feet per hour? Show yousimplify your answer. Jack and Jill each planted flowers in their garden. Jack spent $41 on 4 daylilies and 7 roses Jill spent$81 on 12 daylilies and 7 roses.How much do the daylilies cost? How much do the roses cost? Jack and Jill added tulips to their garden. Jack added 10 tulips to bring his total to $51. Jill added 8 tulipsto her garden to bring her total to $89. Their friend Tanya also decided to plant a garden. She spent $71on 4 daylilies, 14 roses, and 9 tulips.How much to tulips cost? How did the ideas of the enlightenment lead to the creation of the United States. I'll mark brainliest!! In each stanza, count the number of syllables in each line and determine the correct meter. Colo elaborar un diagrama de flujo de un proceso: separacion de agua, alcohol, sal y aceite How much heat does it take to raise 50.0 g of liquid water to 50 c if its initial temperature is -50 c? Mr. Tan's rectangular swimming pool has an area of (81x2 - 144y2) square feet. What are the dimensions of his pool? HI will someone please help Find the circumference of the given circle given a diameter of 40 cm.Use 3.14 as an approximation of TT 40 cm please help me guys During research in the 1940s and 1950s, no variations in personalities were found across cultures. Please select the best answer from the choices provided T F. ASAPPP PLSSSS to what extent were immigrantion laws of 1920 a reaction to fear about radicals?????? Solve this expression. 2.2-0.5(0.6x-1.8)