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
Cloud [144]
2 years ago
13

What's wrong with these codes in code HS Karel challenges(7.1.2. Racing Karel) Codes: //Below is the program that have Karel mov

e around the race track 8 times, and end in his starting location. Everytime Karel hits a corner, he will put a ball down. At the end there should be 8 balls on each corner. function start(){ for(var i = 0; i < 5; i++){ ballSet(); wallRun(); turnLeft(); } function wallRun(){ while(frontIsClear()){ move(); } } function ballSet(){ putBall(); } }
Computers and Technology
1 answer:
Viktor [21]2 years ago
5 0

Answer:

The program only runs 5 five since the for loop statement is limited to loop only five times.

Explanation:

In programming, a for-loop statement is used to repeat a collection of events a definite number of times. The number of loops is specified and compared with a variable to execute a block of code.

The for-loop statement in the code above declares and initializes a variable "i" to zero, runs the block of code, and increments by one if it is less than 5.

To make it run eight times, the value five should be changed to 8 instead.

You might be interested in
What adaptation Judy and her parents have that help them run from predators coming?​
Elza [17]

Answer:

.57

Explanation:

3 0
3 years ago
Write the definitions for three function named max. Each receives two parameters, of the same type, and returns the larger of th
GenaCL600 [577]

Answer:

The method definition to this question can be given as:

Method definition:

double max(double x, double y)  //define method with double parameter  

{

if (x>=y)    //check condition.

return x;  //return value

else

return y;     //return value

}

double max(int x, int y)    //define method with integer parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;  //return value

}

double max(char x, char y)   //define method with char parameter

{

if (x>=y)    //check condition

return x;    //return value

else

return y;    //return value

}

Explanation:

The above method definition can be described as below:

  • In the first method definition first, we define a method that is "max()". In this method we pass two variables as a parameter that is "x and y" and the datatype of this is double. Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.  
  • In the second method definition, we define a method that is same as the first method name but in this method, we pass two integer variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
  • In the third method definition, we define a method that is same as the first and second method name but in this method, we pass two char variable that is "x and y". Then we use a conditional statement. In the if block we check if variable x is greater then equal to y then it will return x else it will return y.
8 0
3 years ago
Is it more costly to Andrew to go to graduate business school full time or part time if the tuition is the same for each? A. Par
andrezito [222]

Answer:

A. Part time

Explanation:

Since tuition is the same whether he goes part time or full time, in the long run he will end up paying tuition a greater number of times if he is a part time student.

4 0
3 years ago
Read 2 more answers
The type of operating system best suited to controlling a massive multiplayer online game is _____.
Nina [5.8K]

Answer:

Distributed

Explanation:

5 0
3 years ago
Sets of rules that a computer uses to solve problems?
jonny [76]

Protocal

I need to make this 20 charaters so ye

8 0
3 years ago
Read 2 more answers
Other questions:
  • The inflationary gap occurs when you obtain no increase in output, but only an increase in the Average Price Level from an incre
    13·1 answer
  • How might writing an online journal be different than writing in a paper one ​
    15·2 answers
  • Which one of the following parts of a universal motor does not move? A. The armature B. The field coil C. The shaft D. The commu
    5·1 answer
  • Suppose the length of each packet is L bits. Also, assume the path from a server to a client includes N links each of rate R (i.
    8·1 answer
  • Throughout the course we have covered a lot of topics in relation to information systems. Select one or two of the major topics
    14·1 answer
  • Different organizations implement different Information Systems base on their core business operations. explain
    14·1 answer
  • Is 5g harmful to the body ?
    9·2 answers
  • An
    9·1 answer
  • Which of the following is used to describe the information used in
    12·1 answer
  • Which precaution should be taken when working inside computer systems??
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!