Karel Code HS questions with complete solutions 2023
Karel Code HS questions with complete solutions 2023The command to move in karel move(); To place a ball putBall(); To take a ball away takeBall(); What is a street in a Karel world? a row What is an avenue in a Karel world? a column command to turnleft turnLeft(); command to turn right function turnRight(){ turnleft(); turnleft(); turnleft();} What is a function using known terms to create new ones The first thing you should write when creating a script function start(){ script } What is top down design? Top down design is a way of designing your program by starting with the biggest problem and breaking it down into smaller and smaller pieces that are easier to solve. What is a code comment? A way to give notes to the reader to explain what your code is doing What commands does SuperKarel know that regular Karel does not? turnAround() and turnRight() What is the best way for Karel to move 10 times? for (var i = 0; i 10; i++) { move(); } How is a general if statement definition written correctly if(condition) { //code } Why do we use if statements in JavaScript? To do something only if a condition is true What does an if/else statement look like in JavaScript? if (condition) { //code } else { //code } Why do we use if/else statements in JavaScript? To either do something if a condition is true or do something else Why do we use while loops in JavaScript? To repeat some code while a condition is true Which general while loop definition is written correctly? while (condition) { //code } What do we use control structures for in JavaScript? Control the flow of the program; how the commands execute. Which of the below are examples of control structures? (I) if (II) if/else (III) while (IV) for You need to write a program where Karel will take a ball if there is a ball present, otherwise Karel should put down a ball. Which control structure do you need to use? If/Else statement You need to write a program that has Karel move if the front is clear, but if it isn't clear, Karel will do nothing. Which control structure do you need to use? If Statement You need to write a program that has Karel put down a tennis ball if the world has dimensions of 1x1. Which control structure do you need to use? If Statement You need to write a program that has Karel move 6 times and then put a ball. Which control structure do you need to use? For loop You need to write a program that has Karel take all the tennis balls where Karel is standing if there are any there. Karel should end up with no tennis balls on that spot. Which control structure do you need to use? While Loop
Escuela, estudio y materia
- Institución
- Code HS
- Grado
- Code HS
Información del documento
- Subido en
- 17 de marzo de 2023
- Número de páginas
- 3
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
karel code hs questions with complete solutions 2023
-
the command to move in karel move
-
to place a ball putball to take a ball away takeball
-
what is a street in a karel world a row what
Documento también disponible en un lote