Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JavaScript Question 1 (1 point) When you debug an application, you Question 1 op

ID: 3914090 • Letter: J

Question

JavaScript

Question 1 (1 point)

When you debug an application, you

Question 1 options:

try to make the application fail

try every possible combination of input data and user actions that exist

fix the bugs that have been identified

test each function separately

Save

Question 2 (1 point)

Which of the following is NOT one of the three testing phases of a JavaScript application?

Question 2 options:

trying to make the application fail

using the W3C Markup Validation Service to validate the HTML

testing the application with valid data

testing the application with invalid data

Save

Question 3 (1 point)

A coding error that produces the wrong results when the application is run is known as a

Question 3 options:

runtime error

user error

logic error

syntax error

Save

Question 4 (1 point)

The easiest type of error to fix is

Question 4 options:

a runtime error because the program will halt when it gets to the error

a user error because you can rewrite the code to account for this

a syntax error because web browsers and IDEs provide helpful error messages

a logic error because the program will run even with a logic error

Save

Question 5 (1 point)

When you build an application with top-down coding and testing, you

Question 5 options:

start with a small portion of code and add one or two operations at a time

start by writing code for the easiest function first

only need to test code with invalid data

do all of the above

Save

Question 6 (1 point)

Code Example 5-1
1. var getResult = function() {
2.      var num1 = 54.95;
3.      var num2 = .1;
4.      var result = parseFloat(prompt("What is " + num1 + " * " + num2 + "?"));
5.      if (result != (num1 * num2)) {
6.          alert("Incorrect");
7.      }
8.      else {
9.          alert("Correct!");
10.     }

11. };

(Refer to Code Example 5-1) Why would “Incorrect” be displayed if the user entered 5.495 when prompted by this code?

Question 6 options:

The answer should only have two decimal places.

The user did the math incorrectly.

The results of arithmetic calculations that use floating-point numbers are imprecise.

The if statement has an error.

Save

try to make the application fail

try every possible combination of input data and user actions that exist

fix the bugs that have been identified

test each function separately

Explanation / Answer

1) fix the bugs that have been identified - During testing one finds out errors in the code, which are removed in debugging.

2) trying to make the application fail - the testing phases are check user interface, check woth valid inputs and check with invalid inputs

3) runtime error - This kind of error will only pop up when the application is run, and will not result in the successful execution of the program.

4) a syntax error because web browsers and IDEs provide helpful error messages - the error message usually shows the line number and along with it, possible solutions.

5) I believe that all of them are incorrect. Top-down takes the highest level functionalities and then break it down to simpler functions. These functions are then broken down until the actual low level functions are defined. The closest option that comes is

start by writing code for the easiest function first

6)The results of arithmetic calculations that use floating-point numbers are imprecise. - JavaScript has an issue when using float value arithmetic. They are usually accurate to maybe 10-11 decimal places, not more than that. Hence num1*num2 might not be exactly 5.495 as we think it would be, it will be 5.495000000000001 and that causes the issue

If you feel that this adequately answered your question, please do give a thumbs up. Thanks! :)

1) fix the bugs that have been identified - During testing one finds out errors in the code, which are removed in debugging.

2) trying to make the application fail - the testing phases are check user interface, check woth valid inputs and check with invalid inputs

3) runtime error - This kind of error will only pop up when the application is run, and will not result in the successful execution of the program.

4) a syntax error because web browsers and IDEs provide helpful error messages - the error message usually shows the line number and along with it, possible solutions.

5) I believe that all of them are incorrect. Top-down takes the highest level functionalities and then break it down to simpler functions. These functions are then broken down until the actual low level functions are defined. The closest option that comes is

start by writing code for the easiest function first

6)The results of arithmetic calculations that use floating-point numbers are imprecise. - JavaScript has an issue when using float value arithmetic. They are usually accurate to maybe 10-11 decimal places, not more than that. Hence num1*num2 might not be exactly 5.495 as we think it would be, it will be 5.495000000000001 and that causes the issue

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote