• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

Chapter 7-12 Final Exam Javascript with correct answers 100 %

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

Chapter 7-12 Final Exam Javascript with correct answers 100 % All JavaScript mistakes will be pointed out automatically by the computer and cause the code to not run. - Correct Answer False Strict mode causes more errors in JavaScript, but can be helpful for debugging. - Correct Answer True A common bug in JavaScript is a type mismatch. - Correct Answer True Manual testing is more work than automated testing initially, but saves time in the long run. - Correct Answer False Find the bug: line 1: var investment=1000; //investment is $1,000line 2: var interestRate = .1; //interest is 10% (or 10/100 or .1)line 3: var goal = 1500; //goal is $1500 line 4: var nbrYears = 0; line 5: //while my investment is less than the goal, keep counting the yearsline 6: while (investment goal) {line 7: var interestEarned = investment * interestRate;line 8: investment + interestEarned;line 9: nbrYears++;line 10: }line 11: ("It took "+nbrYears+" years to reach the goal"); - Correct Answer The bug is on line 8. The investment will never increase because the result of the addition is not being set to the variable investment. Find the bug: line 1: var investment=1000; //investment is $1,000line 2: var interestRate = .1; //interest is 10% (or 10/100 or .1)line 3: var goal = 1500; //goal is $1500 line 4: var nbrYears = 0; line 5: //while my investment is less than the goal, keep counting the yearsline 6: while (investment goal) {line 7: var interestEarned = investment * interestRate;line 8: investment += interestEarned;line 9: nbryears++;line 10: }line 11: ("It took "+nbrYears+" years to reach the goal"); - Correct Answer The bug is on line 9. The variable nbryears is not the same as nbrYears because variables are case sensitive. Therefore, the program will always say it took 0 years to reach the goal. Which of the following is NOT a debugging tool recommended by the JavaScript textbook used in class? - Correct Answer Asking Siri Error Propagation can always be prevented by returning a -1 value from a function. - Correct Answer False Exceptions break out of a section of code which cannot proceed as intended. - Correct Answer True Which keyword is used to signify a section of code which should be executed following an exception? - Correct Answer catch A JavaScript programmer should never allow an unhandled exception. - Correct Answer False Which of the following indicates a range of characters when used within square brackets? to - Correct Answer - Match the regular expression shortcuts with their meaning 1. d 2. w 3. s 4. D

Vista previa del contenido

Chapter 7-12 Final Exam Javascript
with correct answers 100 %
All JavaScript mistakes will be pointed out automatically by the computer and cause the code to not run.
- Correct Answer False



Strict mode causes more errors in JavaScript, but can be helpful for debugging. - Correct Answer True



A common bug in JavaScript is a type mismatch. - Correct Answer True



Manual testing is more work than automated testing initially, but saves time in the long run. - Correct
Answer False



Find the bug:

line 1: var investment=1000; //investment is $1,000line 2: var interestRate = .1; //interest is 10% (or
10/100 or .1)line 3: var goal = 1500; //goal is $1500

line 4: var nbrYears = 0;

line 5: //while my investment is less than the goal, keep counting the yearsline 6: while (investment <
goal) {line 7: var interestEarned = investment * interestRate;line 8: investment + interestEarned;line 9:
nbrYears++;line 10: }line 11: console.log("It took "+nbrYears+" years to reach the goal"); - Correct
Answer The bug is on line 8. The investment will never increase because the result of the addition is not
being set to the variable investment.



Find the bug:

line 1: var investment=1000; //investment is $1,000line 2: var interestRate = .1; //interest is 10% (or
10/100 or .1)line 3: var goal = 1500; //goal is $1500

line 4: var nbrYears = 0;

line 5: //while my investment is less than the goal, keep counting the yearsline 6: while (investment <
goal) {line 7: var interestEarned = investment * interestRate;line 8: investment += interestEarned;line 9:
nbryears++;line 10: }line 11: console.log("It took "+nbrYears+" years to reach the goal"); - Correct
Answer The bug is on line 9. The variable nbryears is not the same as nbrYears because variables are
case sensitive. Therefore, the program will always say it took 0 years to reach the goal.

, Which of the following is NOT a debugging tool recommended by the JavaScript textbook used in class? -
Correct Answer Asking Siri



Error Propagation can always be prevented by returning a -1 value from a function. - Correct Answer
False



Exceptions break out of a section of code which cannot proceed as intended. - Correct Answer True



Which keyword is used to signify a section of code which should be executed following an exception? -
Correct Answer catch



A JavaScript programmer should never allow an unhandled exception. - Correct Answer False



Which of the following indicates a range of characters when used within square brackets?

to - Correct Answer -



Match the regular expression shortcuts with their meaning

1. \d

2. \w

3. \s

4. \D

5. \W

6. \S

7. \i

8. . - Correct Answer 1. any digit

2. alphanumeric

3. whitespace

4. Not a digit

5. nonalphanumeric

6. nonwhitespace

Información del documento

Subido en
1 de noviembre de 2025
Número de páginas
5
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$9.39

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Wairimumburia
3.5
(2)
Vendido
25
Seguidores
3
Artículos
2826
Última venta
1 semana hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes