This graphics program should draw a caterpillar. A caterpillar has NUM_CIRCLES circles. Use a for loop to draw the caterpillar, centered vertically in the screen. Every other circle is a different color. When i is even, the circle should be red. When i is odd, the circle should be green. Remember that 0 is an even number. Be sure that the caterpillar is still drawn across the whole canvas even if the value of NUM_CIRCLES is changed. (PYTHON, CODEHS 4.6.6 Caterpillar.)

Answers

Answer 1

Answer:

radius = (get_width() / NUM_CIRCLES / 2)

x = radius

for i in range(NUM_CIRCLES):

   circ = Circle(radius)

   if i % 2 == 0:

       circ.set_color(Color.red)

   else:

       circ.set_color(Color.green)

   circ.set_position(x, get_height() / 2)

   add(circ)

   current_spot = x

   x = current_spot + (radius * 2)

Explanation:

Answer 2

Answer:

var NUM_CIRCLES = 15;

var radius=getWidth()/(NUM_CIRCLES*2);

var x=radius;

function start(){

   for (var i=0; i<NUM_CIRCLES; i++){

       if (i%2==0){

           drawRedWorm();

           

       }else{

           drawGreenWorm();

       }

       var xPosition=x;

       x=xPosition+(radius*2)

   }

}

function drawRedWorm(){

   

   var circle=new Circle(getWidth()/(NUM_CIRCLES*2));

   circle.setPosition(x , getHeight()/2 );

   circle.setColor(Color.red);

   add (circle);

}

function drawGreenWorm(){

   

   var circle=new Circle(getWidth()/(NUM_CIRCLES*2));

   circle.setPosition(x , getHeight()/2 );

   circle.setColor(Color.green);

   add (circle);

}

Explanation:

codeHs


Related Questions

Given an array A[a1,a2,a3,...an] of size n.Create an array B[] from A[] where b1=a1,b2=a1+a2,b3=a1+a2+a3, bn=a1+a2+a3+...+an.
(Java or c++)

Answers

   public static void main(String[] args) {

       int A[] = {1,2,3,4};

       int B[] = new int[A.length];

       for (int x = 0; x < A.length; x++){

           if (x == 0){

               B[x] = A[x];

           }

           else{

               B[x] = B[x-1] + A[x];

           }

       }

       for (int w:B){

           System.out.println(w);

       }

       

   }

   

}

I created my solution in java. I hope this helps!

Which type of evaluation requires that the program be fully implemented before the evaluation can begin

Answers

Answer:

Around the world, there exist many programs and interventions developed to improve conditions in local communities. Communities come together to reduce the level of violence that exists, to work for safe, affordable housing for everyone, or to help more students do well in school, to give just a few examples.

But how do we know whether these programs are working? If they are not effective, and even if they are, how can we improve them to make them better for local communities? And finally, how can an organization make intelligent choices about which promising programs are likely to work best in their community?

Over the past years, there has been a growing trend towards the better use of evaluation to understand and improve practice.The systematic use of evaluation has solved many problems and helped countless community-based organizations do what they do better.

Explanation:

Despite an increased understanding of the need for - and the use of - evaluation, however, a basic agreed-upon framework for program evaluation has been lacking. In 1997, scientists at the United States Centers for Disease Control and Prevention (CDC) recognized the need to develop such a framework. As a result of this, the CDC assembled an Evaluation Working Group comprised of experts in the fields of public health and evaluation. Members were asked to develop a framework that summarizes and organizes the basic elements of program evaluation. This Community Tool Box section describes the framework resulting from the Working Group's efforts.

Despite an increased understanding of the need for - and the use of - evaluation, however, a basic agreed-upon framework for program evaluation has been lacking. In 1997, scientists at the United States Centers for Disease Control and Prevention (CDC) recognized the need to develop such a framework. As a result of this, the CDC assembled an Evaluation Working Group comprised of experts in the fields of public health and evaluation. Members were asked to develop a framework that summarizes and organizes the basic elements of program evaluation. This Community Tool Box section describes the framework resulting from the Working Group's efforts.Before we begin, however, we'd like to offer some definitions of terms that we will use throughout this section.

By evaluation, we mean the systematic investigation of the merit, worth, or significance of an object or effort. Evaluation practice has changed dramatically during the past three decades - new methods and approaches have been developed and it is now used for increasingly diverse projects and audiences.

By evaluation, we mean the systematic investigation of the merit, worth, or significance of an object or effort. Evaluation practice has changed dramatically during the past three decades - new methods and approaches have been developed and it is now used for increasingly diverse projects and audiences.Throughout this section, the term program is used to describe the object or effort that is being evaluated. It may apply to any action with the goal of improving outcomes for whole communities, for more specific sectors (e.g., schools, work places), or for sub-groups (e.g., youth, people experiencing violence or HIV/AIDS). This definition is meant to be very broad

I HOPE THIS HELPS YOU ALOT THANKS!

In a program you need to store identification numbers of 5 employees and their weekly gross pay.
a. Define two arrays that may be used in parallel to store the 5 employee identification numbers and weekly gross pay amounts.
b. Write a loop that uses these arrays to print each of the employees identification number and weekly gross pay.

Answers

Solution :

a). The two arrays that are used in parallel in order to store the identification of two numbers of 5 employees and their weekly gross payments is  :

  int id_array[5];

  double gross_pay[5];

b). The loop that uses the arrays for printing the identification number and the weekly gross payment  is given below :

 for(int i=0; i<5; i++)

  {

  count <<id_array[i] <<" " << gross_pay[i] << end;

  }

What is wrong with my code? (python)


When entering a input 8 characters long without a "!", the code still accepts it

Answers

Answer:

You can fix this in multiple ways.

1) Use single quotation marks instead of double, this will do the same thing.

'Enter a password with at least 8 characters and a "!" : '

What happened was "" tells the interpreter when a string begins and ends. It looks for those connecting quotation marks.

2) You can use \" to tell the interpreter that this is not the end of a string.

"Enter a password with at least 8 characters and a \"!\" : '

3) Use multiple double quotation marks (can also be used for multi-line strings).

"""Enter a password with at least 8 characters and a "!" : """

Answer:

password = input("Enter a password with at least 8 characters and a \"!\": ")

if ("!" not in (password) or (len(password) < 8)):

   print("Your password does not meet the requirements.")

Explanation:

You might notice this is a bit different from your code. Firstly, I added escape characters around the ! and changed it from "!" to \"!\" This is because a backslash "\" is considered an escape character. I'm going to explain this as best I can but I'm not the best at explaining things so bare with me. You see how the ! is white text in your code? That's because your compiler is going to read the code like follows. The phrase "Enter a password with at least 8 characters and a " is going to be seen as a string, then, the ! is going to be read as a function call or some sort of variable, and it will probably error out because it doesn't know what the fk you want to do with it. This can be solved by using escape characters. An escape character tells the compiler, 'hey, I'm going to put a special character here to represent some data, don't stop reading this phrase as a string just yet'. That being said, if you change it to \"!\", then the ! color will turn green, because the compiler is reading it properly (as a string). Also, I change your if statement logic. What you saying to the compiler is " if there is NOT a ! in password AND the password is less than 8 chars long, then its a bad password ". This means that if the password is 9 characters long, and DOESNT have a !, it will still pass. Because you're checking to make sure it fails both before you say "hey this is a bad password". This is a simple fix, you just change it the "and" to "or". And then it will read: "Hey, if their password doesn't have a ! in it OR is less than 8 chars, it's not a good password." Sorry for the wall of text, hopefully it helped you learn something though. :)

Graphic design is a form of communication. What kinds of communication are possible using graphic design? (choose all that apply)
Persuasive - convinces
Descriptive - paints a picture
Expository - gives the facts
Narrative - tells a story

Answers

Answer:

descriptive

Explanation:

paints and picture you can tell whats going by looking at pictures

Answer:

b and c

Explanation:

Which is the correct code to declare a catch-all handler?
a. catch (AllException excpt) {…}
b. catch (Exception excpt) {…}
c. catch (Throw excpt) {…}
d. catch (Throwable excpt) {…}

Answers

Answer:

A

Explanation:

Hopefully this helps

On the Audio Tools contextual tab, which tab will control how the audio file appears, if it appears, on the slide
itself?
A.) Bookmarks
B.) Playback
C.) Format
D.) Design

Answers

B is the correct answer

Answer:

Format

Playback doesn't show how it appears.

send me the answers

Answers

Answer:

???...................???

What do we call stores in a physical world?


non-virtual stores

location stores

brick-and-mortar stores

physical stores

Answers

Answer:

brick and mortar stores i believe

Type the correct answer in the box. Spell all words correctly.
Which carmera option shOWs tirne to be rmoving slowly?
Another term for slow motion, where time appears to be moving slowly in a video, is

Answers

Answer:

25 speed. If you are recording on a phone it would be the slow-motion option:)

Hope you get it right:)

Which is an example of oversharing using GPS?
O A. Constantly asking others to tell you their locations
O B. Revealing your location every few minutes in messages
C. Posting an online message when your plane has landed
O D. Giving too much personal information on social networks

Answers

Answer:

It’s B

Explanation:

The option that is an example of oversharing using GPS is Revealing your location every few minutes in messages.

What is oversharing?

Oversharing is known to be a term that connote when something is done too much at a time. It is sharing too much information.

Conclusively, The option that is an example of oversharing using GPS is revealing your location every few minutes in messages as one will be distracted because of the constant messages coming in.

Learn more about GPS from

https://brainly.com/question/9795929

#SPJ2

When using the protection options in Excel 2016, what does the Protect Workbook function do?

O It protects all the worksheets in a workbook from being reformatted or typed into.

O It adds a password to access the worksheet.

O It prevents worksheets from being inserted, deleted, or moved.

O It saves a workbook in a way that will allow only a select group of people to access it.

Answers

Answer:

it saves the workbook in a way that will allow only a select group of people to access it

The Protect Workbook function helps to saves a workbook in a way that will allow only a select group of people to access it.

What does protecting a worksheet do?

The act  protecting a worksheet is known to be often done so as to hinder unauthorized  users from making changes, moving, or deleting any type of data from a worksheet.

Conclusively, This is often done by locking the cells on your Excel worksheet and then one can use password protection on the sheet and one can only allow only a select group of people to access it..

Learn more about workbook  from

https://brainly.com/question/25130975

To help ensure that an HTML document renders well in many different web browsers, it is important to include which of the following at the top of the file.
an tag
a doctype declaration
a tag
a tag

Answers

Yeahhhhhhh mane you already know! A tag

Answer:

I think it is:

B. a doctype declaration

Explanation:

factors to consider when selecting an operating system to install in a computer ​

Answers

Answer:

what do you want your computer to do, how do you want your computer to look, how fast do you want your computer to run, etc

A Web site that allows users to enter text, such as a comment or a name, and then stores it and later display it to other users, is potentially vulnerable to a kind of attack called a ___________________ attack.a. Two-factor authenticationb. Cross-site request forgeryc. Cross-site scriptingd. Cross-site scoring scripting

Answers

Answer:

Option(c) is the correct answer.

Explanation:

Cross-site scripting is the type of security breach that are usually found in the  software applications.The main objective of cross site scripting it is used by the hackers to exploit the data security.

The cross site scripting is the collection of web pages  that enables people to insert the text like comment,  name stores it afterwards it save the data and then  it appears to the other users.Others options are incorrect because they are not related to given scenario.

Suppose that a NAT is between the Internet and a company's network. Now suppose that the NAT crashes, but quickly restarts, in a very short amount of time. How would a short-lived reboot impact the users and machines in the company's network?

Answers

Answer:

There would be no internet connection during the duration of the reboot.

Explanation:

NAT or network address translation protocol is used to translate or substitute private IPv4 network addresses with public IPv4 addresses to gain access to internet resources. Private IPv4 addresses are not routable on the internet and due to the exhaustion of the IPv4 addresses, the NAT maps the private network with a limited amount of public addresses (public IPv4 network addresses are routable on the internet).

Nicolas is watching a video in his social studies class. Which is the best note-taking method to use while viewing?
O charting
O Cornell
O SQRW
O recording
PLZ HELP IM TIMED

Answers

Cornell- it’s a sue sue system devised for taking notes and it’s an efficient process that helps students separate main ideas from key notes

A unique aspect of Java that allows code compiled on one machine to be executed on a machine of a different hardware platform is Java's

Answers

Answer:

Java's bytecode

Explanation:

To execute its operations, java programming languages uses bytecodes.

These bytecodes are literally instructions of a java virtual machine (or JVM). They are generated in form of a class file as soon as the java program is ran and executed. In other words, the java compiler compiles the code and generates the bytecode.

As soon as the bytecode is generated, it can be transferred to a different machine and platform completely and one can run this bytecode on this different machine.

Answer:

Java's bytecode

Explanation:

To execute its operations, java programming languages uses bytecodes.

These bytecodes are literally instructions of a java virtual machine (or JVM). They are generated in form of a class file as soon as the java program is ran and executed. In other words, the java compiler compiles the code and generates the bytecode.

As soon as the bytecode is generated, it can be transferred to a different machine and platform completely and one can run this bytecode on this different machine.

I need help picture above

Answers

Answer:

B. https at the very beggining of the URL

Explanation:

hoped I helped Im Eve btw Have a great day and consider marking this brainliest if you do thank you in advanced!

“https” at the very beginning of the URL

What is the most important job of a web server?
write web traffic information to a log file
capture data about visitors to a website
provide requested web pages to client computers
validate user login passwords

Answers

Answer:

Provide requested web pages to clients; the other tasks listed there are secondary to that.

Answer:

C. Provide requested web pages to client computers

Explanation:

Just took the test

Jeri wants to make sure she designs her web site for a specific group of people. What will help her plan who will visit the site?

a
Mockup

b
Rough draft

c
Sketchbook

d
Storyboard

Answers

Answer: Storyboard

Explanation: Im not sure but it says i got it right on the exam

Answer:

d: storyboard

Explanation:

the storyboard is basically a planning tool, it allows you to make revisions, and its easier to make changes on there than your actual web page

In general, the pilot and _______ approaches are the most favored conversion approaches.

Answers

Answer:

The correct approach is "Phased".

Explanation:

The pilot step requires just to validate the development's implementation goals and objectives and then when the SDMX objects were introduced to development, several perhaps all problems have indeed been detected as well as logged through so that they're being corrected either by the detailed technical advisory committee. The staggered or phased approach towards deployment provides the time possible to obtain the very next knowledge on evaluation criteria, staff including diverse cultures such that the strategy produced could be customized accordingly.

Write a function named countWords that reads in a line of text into a string variable, counts and returns the number of words in the line. For simplicity assume that the line entered only has characters and spaces.

Answers

Answer:

function countWords(sentence) {

return sentence.match(/\S+/g).length;

}

const sentence = 'This sentence  has five  words ';

console.log(`"${sentence}" has ${countWords(sentence)} words` );

Explanation:

Regular expressions are a powerful way to tackle this. One obvious cornercase is that multiple spaces could occur. The regex doesn't care.

A software engineering process (SEP), also known as a software development process, defines the ______ of developing software.

Answers

Answer:

The answer is "who, what, when, and how"

Explanation:

In the software engineering process, it includes software development, management activities such as the enforcement, analysis, layout, scripting, reviewing, and maintenance of requirements. These Methodologies were used to create applications that are only different ways to develop and differential equations.

What is the primary difference among a domain model, an analysis model, and a design model for the same project?

Answers

Answer:

The design model is the description of the model to be implemented, the analysis model is the model that links the design and the system or domain model while the domain model is the entire software implementation.

Explanation:

The domain model is the conceptual aspect of software engineering that comprises operational and data features. The analysis model is the schematic description of the system that links the design model to the system domain. The design model is also known as the object model as it shows an abstract representation of the implementation. It helps to test the quality of the software been developed.

NEED ANSWER ASAP. CORRECT ANSWER GETS BRAINLIEST! TY

Which part of project management considers if employees will work at home or in the office?

Analysis
Resources
Scope
Time

Answers

Answer:

scope because the scope will determine the Time for the employee to work

When you write contracts, should you list many definitions at the start of the document?

Answers

Answer:

You can.

Explanation:

If you want you can, but usually as you cover topics you should list the definitions for each topic then instead of all at the beginning you do not want it to seem like it is a lot.  

the page break option splits the document into two or more columns (true/false)​

Answers

Answer:

False

Explanation:

The page break option splits the document into two or more rows (not columns).

Good luck!

Is this statement true or false? To change the color of text, you must select the entire text to be changed.

Answers

Answer:

true is the correct answer to your questions

Write a nested loop to set values as follows: [0] [1] [2] [3] [4] [0] 1 2 3 4 5 [1] 1 2 3 4 5 [2] 1 2 3 4 5 [3] 1 2 3 4 5

Answers

Answer:

Following are the java code to this question:

for (int x= 0;x<x1.length;x++)//defining for loop for print column value

   {

   for (int y= 0;y<x1[x].length;y++)//defining for loop for print row value

   {

       System.out.print(x1[x][y]=y+1);//print array value

   }

   System.out.println();// use print method for line spacing  

   }

Explanation:

The full code is defined in the attached file please find it.

In the above-given code, the nested for loop is used, that's function can be defined as follows:

In the outer loop, an x variable is used, that starts from 0 and ends when its value is equal to its array length.

In the inner loop, a y variable is used that also starts from 0 and ends when its value is equal to the length of x, and inside the loop, the print method is used that uses an array to assign value and print in the given order.  

Other Questions
How has British rule affected India?Write a 12 paragraph editorial expressing your opinion as an Indian citizen. PLEASE HELP ME, PLEASE!!!Reuben wanted to test the Law of Conservation of Mass using different stages of water. He first measured the mass of a beaker with three ice cubes. After one hour, he measured the mass of the beaker with liquid water. Reuben observed that both measurements were almost the same. What would be a good explanation for Reuben observation?A: The amount of water as ice increased when the water turned into liquid.B: The mass of the beaker increased with the change in temperature, so it balanced the amount of water in the change of state.C: There is no mass in water as solid or liquid, so only the beaker mass was measured.D: The initial amount of water in the solid state (ice) was the same amount of water in the liquid state measured at the end, except for some water that might be evaporated. Of the fifth-grade students, 9 12 went to the book fair. Of the students that went to the book fair, 6 8 bought at least one book. What fraction of fifth-grade students bought at least one book? What is the role of the local government in promoting the government regarding the protection of our natural resources?help me please i give you the brainliness pleaseeee! Short Paragraph on my idea of fun weekend Everything government touches turn to poop. Ringo StarrAnyone think this is true?? Because I do. Based on your understanding of the scenario, which of the abbreviations mentioned primarily affect the lungs? Check all that apply.MSURIIBDADBAPE Arrange these fractions in least to greatest order: 1 6/7, 1 4/5,1 8/17, 1 10/11, 1 9/10,1 12/25,1 11/12. Im not any good with fractions. I need an answer soon. :( If f(x)=6-2x, Find the value for f(-1) According to the Get Fit and Be active book, page 5 talks about the phases of exercise, what is step 2? Question 2 options: Exercise Warm up Stretching Cool down What is the equation represented by the order pairs {(0,32),(1,16),(2,8),(3,4)}? The way people dress is a projection of howthey see themselves (their self-concept) andhow they want to be viewed by others..true or false What are some health problems people may experience due to tire pollution? What are some suggestions given to help reduce pollution in the atmosphere? Within a free-enterprise system, individuals have the right to support themselves and their neighbors Obtain a high level of education to decide the actual government official test into the profession they choose Ten years more than 3/5 of Jim's age is 28. How old is Jim? Which is an example of current electricity?A. A person's hair stands up as a wool hat is pulled off.B. A child rubs a balloon against the carpet and then sticks it to awall.C. Negatively charged particles are repelled by other negativelycharged particles.D. A battery provides electrical energy to power a phone.HURRY UP !!! What does the phrase "punctual as a star" most likely mean as it is used in line 14 ? should I buy this as my first truck ? In a criminal case, who may APPEAL the decision of the court? WHY do you think this is? Daniel has a sample of pure copper. It's mass is 89.6 grams, and it's volume is 10 cubic centimeters (cm^3). What is the density of the sample?