Karen CodeHS Questions (A+ Graded solutions)
Why does a programmer indent their code? correct answers Easier for other people to understand, it helps show the structure of the code, and it's a key part of good programming style! Which of these is a valid way to write a single line comment in Java? / / This is a comment + + This is a comment This is a comment / / / * This is a comment correct answers / / This is a comment What is a method in Karel? correct answers A method is a command that Karel can do. It has a name and a set of instructions What is a code comment? correct answers A way to give notes to the reader to explain what your code is doing Why do we use if/else statements in Java? correct answers To either do something if a condition is true or do something else What is wrong with this method declaration? public karelDance() [ move(); turnLeft(); move(); turnLeft(); move(); ] correct answers Not using curly brackets Missing void Using public instead of private Which of these is a valid Karel command in Java? move() move(); move; MOVE correct answers move();
Información del documento
- Subido en
- 29 de mayo de 2023
- Número de páginas
- 8
- Escrito en
- 2022/2023
- Tipo
- Examen
- Contiene
- Preguntas y respuestas