Can anyone fix this code for me?


// This function has karel move across a world of 14 columns, moving if the

// front is clear, or jumping a hurdle if it is blocked.

function start(){

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

if(frontIsBlocked()){

jumpHurdle();

}else (frontIsClear()){

move();

}

}

}


// This function has karel jump a hurdle and end up on the other side.

// Precondition: Karel is facing east in front of a hurdle (one wall high)

// Postcondition: Karel is facing east on the other side of the hurdle

function jumpHurdle(){

turnLeft();

move();

turnRight();

{

move();

turnRight();

}

move();

turnLeft();

}

Answers

Answer 1

Answer:

function start(){

move();

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

move();

move();

jumpHurdle();

if(frontIsClear()){

move();

}

}

move();

move();

move();

function jumpHurdle(){

turnLeft();

move();

turnRight();

move();

turnRight();

move();

Answer 2

The corrections are =

1) Added curly braces.

2) Removed the unnecessary curly braces.

3) Added semicolons.

Given is an incorrect code we need to make corrections in it,

The corrected code is,

// This function has Karel move across a world of 14 columns, moving if the

// front is clear, or jumping a hurdle if it is blocked.

function start() {

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

   if (frontIsBlocked()) {

     jumpHurdle();

   } else {

     move();

   }

 }

}

// This function has Karel jump a hurdle and end up on the other side.

// Precondition: Karel is facing east in front of a hurdle (one wall high)

// Postcondition: Karel is facing east on the other side of the hurdle

function jumpHurdle() {

 turnLeft();

 move();

 turnRight();

 move();

 turnRight();

 move();

 turnLeft();

}

Here are the changes I made:

Added curly braces {} after the else statement to define the block of code to be executed when the condition is met.

Removed the unnecessary curly braces {} after the turnRight() statement in the jumpHurdle() function.

Added semicolons ; at the end of each statement to terminate them properly.

Learn more about Coding click;

https://brainly.com/question/31517409

#SPJ6


Related Questions

( BRANLIEST)
Compare different types of (monitors). Mention advantages and disadvantages of each types.
IF ANYONE ANSWER IT I WILL GIVE **BRAINLIEST**

Answers

Answer:

A monitor is an electronic output device that is also known as a video display terminal (VDT) or a video display unit (VDU). It is used to display images, text, video, and graphics information generated by a connected computer via a computer's video card. Although it is almost like a TV, its resolution is much higher than a TV. The first computer monitor was introduced on 1 March 1973, which was part of the Xerox Alto computer system.

Older monitors were built by using a fluorescent screen and Cathode Ray Tube (CRT), which made them heavy and large in size and thus causing them to cover more space on the desk. Nowadays, all monitors are made up by using flat-panel display technology, commonly backlit with LEDs. These modern monitors take less space on the desk as compared to older CRT displays.

Answer:

I think answer is

Explanation:

Type of monitor

I.Touch screen monitor

II.LED Monitor

III.DLE Monitor

Advantage

i.Energy Consumption

Ii.Multipule Screen

Disadvantages

i.Screen Flicker

radiation

Which business function is most critical for maintain overall organization, including meeting established standards and deadlines?a)Management)Finance)Sales)Human resources

Answers

The business function that is most critical for maintaining overall organization, including meeting established standards and deadlines, is the "Management."

This is because the function of management in any firm involves crucial decision making such as establishing standards, creating project timelines and deadlines, and maintaining the whole organization to achieve desired results.

Management as a business function creates goals for the business. They also establish standards, policies, visions, and missions.

Management responsibilities also include creating short-term and long-term goals, including maintaining the business's key assets.

Hence, in this case, it is concluded that the correct answer is option A. "management."

Learn more here: https://brainly.com/question/12109980

Answer:

Management

Explanation:

What is the answer I will give brainliest

Answers

Answer:

It should display

1

2

1

or

2

1

2

Explanation:

not positive, correct me if im wrong

1
2
1
orr
1
2
3
brainliest?

Which of the following is an example of Boolean data?a) 12b) "Hello"c) TRUEd) 12 + 3

Answers

Answer:

C. True

Explanation:

a boolean is an expression that evaluated either true or false.

HELP ME!! DUE SOOON AND I DONT UNDERSTAND PLSSSS

Answers

i think that it’s isss 4

a person who uses computers to gain unauthorized access to data.

Answers

Answer:

Hacker

Explanation:

They break password codes to get access to unauthorized data.

Answer:

a hacker

Explanation:

Borrowing other images and videos are allowed as long as ________?​

Answers

Answer:

as long as there appropriate

What are the consequences of digital footprint ?

Answers

Answer:

The digital footprint that is left behind can have repercussions in all areas of your teen's life, potentially resulting in missed job opportunities, public sharing of personal information, ruined relationships — or, in what is likely more relevant to them right now: Their parents finding out what they've been up to

Explanation:

Edhesive 1.6 code practice: question 2

Answers

Answer:

Explanation:

?

write a boolean expression that is true if s references the string end.

Answers

Boolean expressions are those expressions whose value can only be true or false.

The required boolean expression is: s == "end"  

From the question, we have the following highlights

The string variable is sThe string value is "end"

For the boolean expression to be true, then we need a comparison operator.

For this purpose, we make use of the == operator

Hence, the required boolean expression is: s == "end"  

Read more about boolean expressions at:

https://brainly.com/question/16843003

PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Read the list of courses from a technical school (w3schools).

Which courses would prepare for you for a career in web development?
(Choose more than one answer)

Designing for Usability
Introduction to Networks
Technical Writing
Cybersecurity

Answers

The answer was, a). Designing for Usability and c). Technical Writing

A function that can be used to add cells is?

Answers

Answer:

The SUM function is used to add all the values in the cells

Explanation:

Sum a range of cells -- SUM Function

The quickest way to sum a range of cells is to use the AutoSum button. It automatically enters a SUM function in the selected cell. The SUM function totals one or more numbers in a range of cells.

Sorry if the answer is wrong

I HOPE IT HELPS

Select the three type of undesirable software.

virus
firewall
peer-to-peer
nannyware
adware
malware
VPN

Answers

Virus, Adware, Malware

what is the deffinition of a bus network topology. along with a list of benifits and disadvantages of using a bus topology with many devices attatched. will give brainliest if answer is complete and good.

Answers

Answer:

all nodes in the network are connected directly to a central cable that runs up and down the network. When there is a tiny network, it works quite well. The needed wire length is smaller than in a star topology. It's simple to add or delete devices from this network without affecting others. When compared to other network topologies such as mesh and star, it is quite cost-effective.

Explanation:

what should you do if you want word to apply a coordinated set of styles to ensure there is consistent formatting across the entire document?

Answers

Answer:

I'm pretty sure you can right click on a style and add it to a preset, if that's what you're asking.

Explanation:

Order the steps for sharing a contacts folder in Outlook 2016

Answers

Answer:

Enter the Contacts view-Select folder in the navigation pane-Click Share Contacts-Fill the To: field with a recipient's address-Click Send.

Explanation:

Got it right on Edge  

Outlook is a management application that includes personal information.  The first step in sharing the contact folder includes entering the contact view.

What is contact sharing?

Outlook is the web platform that contains the personal information of the client and also, the messages, contact cards, calendars, and webmails. etc.

To share contact the contact view should be opened and then the folder should be selected in the navigation pane. The button for sharing contacts should be selected.

In the share contact pop-up, fill out the field to whom the contact is to be shared with their address. After entering the receiver's name and address click the send button to share the contact card.

Learn more about Outlook here:

https://brainly.com/question/19026125

#SPJ2

Area Triangolo Rettangolo in c++

Scrivere un programma in C per il calcolo dell'area di un triangolo rettangolo, si richiede codice in c.
Dati di input: cateto1 e cateto2
Output: Area del Triangolo

Answers

Answer:

#include <iostream>

using namespace std;

void askCat(int &cateto1, int &cateto2);

int AreaRett(int cateto1, int cateto2, int &area);

void stampaRisultato(int area);

int main()

{

  int cateto1, cateto2, area;

  askCat(cateto1, cateto2);

  area = AreaRett(cateto1, cateto2,area);

  stampaRisultato(area);

}

void askCat(int &cateto1, int &cateto2)

{

 cout << "Inserisci lunghezza cateto1: ";

 cin >> cateto1;

 cout << "Inserisci lunghezza cateto2: ";

 cin >> cateto2;

}

int AreaRett(int cateto1, int cateto2, int &area)

{

 area = (cateto1*cateto2)/2;

 return area;

}

void stampaRisultato(int area)

{

 cout << "L'area del triangolo rettangolo e': " << area << endl;

}

Which design principle is the subject of a photo or image?

A) Focal Point
B) Framing
C) Field of view
D) Space
E) Rule of thirds

Answers

Answer:

B) Framing is the answer to your question

Indicate if the statement is true or false False 1. A spreadsheet cannot recalculate after you have changed data in your worksheet. 2. A spreadsheet uses formulae to carry out operations on numerical data. 3. A range is a group of cells that form a rectangle. 4. A value is titles and headings used in a spreadsheet. 5. You cannot format a spreadsheet like a word processing document by bolding and underling headings. 6. A label is a text entry. 7. You cannot copy a formula in a spreadsheet. 8. To find the largest value in a set of values the formula is: MAX(first Cell:Last Cell) You can produce a chart to represent the data in a spreadsheet.​

Answers

Answer:

False

Explanation:

a spread sheet can recalculate any number of times

There are different kinds of software. The answers are below;

A spreadsheet cannot recalculate after you have changed data in your worksheet is a false statement. A spreadsheet uses formulae to carry out operations on numerical data is a true statement. A range is a group of cells that form a rectangle on a screen is a true statement.  A value is titles and headings used in a spreadsheet is a false statement.  You cannot format a spreadsheet like a word processing document by bolding and underling headings is a false statement.A label is a text entry is a true statement.You cannot copy a formula in a spreadsheet is a false statement To find the largest value in a set of values the formula is: MAX(first Cell:Last Cell) is a false statement.

What is a Spreadsheet?

This is known to be a kind of arrangement of cells usually in columns and rows. It is used to organize, analyze, calculate and report any kind of information and it is often done in numerical form.

Learn more about spreadsheet from

https://brainly.com/question/4965119

Give examples of hardware​

Answers

Answer:

monitor

keyboard

mouse

CPU

UPS

printer

Scanner

and many more

Explanation:

hope it will help you

brainliest plz

-8irwqe4srxtfvgybuhjjbhvgfgvuybi

Answers

Answer:

I dont understand the question?

Explanation:

máy tính coá j vui giải thích choa tui biết đi

Answers

Answer:

sorry didn't know this language

We perform the following assignment commands: x:=1; y:=9; z:=x+y; z:=z*y; The result is

Answers

Answer:

"z" in z=x+y is 10. The first "z" in z=z*y equals 90.

Explanation:

Let's start with the first equation, z=x+y. Since we have our given values, all we have to do is add them. If "x" is 1 and "y" is 9, adding 1+9 gives us 10.

Now for the second equation, z=z*y. Since we have both values on the right hand side of the equation, we can already multiply to get our answer. The second "z" in the equation is the answer of "z" in the first equation, which is 10. Since "y" equals 9, multiplying 10 by 9 yields us 90.

Hope this helps buddy!

what does it mean that the right mouse button is context-sensitive?

Answers

Answer:

The menu items available will differ depending on the context of what you are right-clicking . You would like to add some frequently used buttons to the Quick Access Toolbar. ...

Explanation:

It means that the mouse has  used menu commands that are used in terms of  situation when a person clicked the right mouse button.

What is  context-sensitive menus about?

A context-sensitive menu is one that often show up when clicking the right mouse button.

Note that A context-sensitive menu is one that only show the lists that are often used menu commands that are applicable to the scenario when a person clicked the right mouse button.

Learn more about mouse from

https://brainly.com/question/11262969

#SPJ2

the retention of encoded information over time refers to

Answers

It refers to Storage

what is another name for folder ​

Answers

File, binder, document case, envelope, wrapper, wallet

Answer:

Portfolio

Explanation:

..............

When it's unlikely that your data will change, what's the best option for pasting a chart

Answers

the answer is embed workbook

When it's unlikely that your data will change, what's the best option for pasting a chart embed workbook.

What is embed workbook?

Right-click the workbook on OneDrive and select Embed. Select Customize how this embedded worksheet will appear to others after selecting Generate. Click what you want to display in your blog in the What to show box. Show a chart, a named range, a pivot table, or a table, or display the whole workbook.

Click Object under the Text group on the Insert tab. On the Create from File tab, click. Select the desired file by clicking Browse and then choosing it. Select the Display as icon check box if you wish to add an icon to the spreadsheet rather than display the contents of the file.

In Excel, embedding often refers to inserting an object made in another program (such as Word, PDF, etc.). The procedure is called embedding.

Thus, embed workbook.

For more information about embed workbook, click here:

https://brainly.com/question/14271749

#SPJ5

the portion of the web that general search engines often fail to find is referred to as the:

Answers

Answer:

deep web

Explanation:

why is computer called an information processing device ?​

Answers

Since, the computer accepts raw data as input and converts into information by means of data processing, it is called information processing machine (IPM).

Computer is called information processing machine because it gives you meaningful information after processing raw data......

The stop-and-wait protocol is highly inefficient:______.
a. when there is a short distance between source and destination and the transmission rate is low
b. when there is a large distance between source and destination and the transmission rate is high
c. when there is a large distance between source and destination and the transmission rate is low
d. when there is a short distance between source and destination and the transmission rate is large

Answers

The answer should be c
Other Questions
Translate this sentence into an equation.The sum of and Han's age is .Use the variable to represent Han's age Who shot Abamham Lincoln Es __________ libro. how will you decide which browser security settings to allow and which ones to block? The sum of four consecutive even integers is 132. What are the integers? (show your work) X hi phong kin trung Quc hnh thnh vo thi gian no? ?????????????????? Please Help me i really need this .no spam PLS FAST WILL GIVE BRAINLIEST!! A photographer would be most likely to use a small aperture (larger f-stop number) to create depth of field for which type of photograph?actionlandscapemacroportrait a study perportetdly conducted by james vicary teaches us what about the part of subliminal perception and its effect on advertising? Which statements help explain why the Community created the position of Receiver? (Select all correct answers.) A: Sharing stories about the past is a boring pastime without purpose.B: Knowledge of other ways to live could make people want choices.C: Memories of pain and suffering create a burden that the Elders don't want.D: Wisdom is needed to solve some problems faced by the Community. We seldom see each other anymore.A.sometimesC.frequentlyB.occasionallyD.Rarely a. Aside from, email and web page give one other examples of global communication are you familiar with? Explain Why would Neolithic man need pottery or woven baskets? Imagine everyone in the United States exhibited the character traits we have been discussing. In what ways would America be different?Now imagine no one in American exhibited any of those character traits. In what ways would America be different? 9. The narrator states that Hazel has "average intelligence." Based on her words and actions,what can you INFER about how the government's policies have AFFECTED ITS CITIZENS?Be sure to write a RACE (re-state, answer, cite, and explain) answer!(4 Points)Enter your answer 9.There are only red beads and green beads in a bag.The ratio of the number of red beads to the number of green beads is 5:9(a) What fraction of the beads are red? WILL GIVE BRAINLIST!!solve for the mean. I have six different clams the lengths of the clams are listed below. What is the mean length of the clams.lengths: 12 mm, 19 mm, 17 mm, 24 mm, 9 mm, 3 mm.A. 24B. 84C. 6D. 14 why did justinian claim poetically that hagia sophias gigantic dome seemed to hang suspended on a ""golden chain from heaven""? An object of mass 300 kg is observed to accelerate at the rate of 4 m/s 2 . Calculate the force required to produce this acceleration