Question

If your program contains an error that is detected by the compiler, that error is known...

If your program contains an error that is detected by the compiler, that error is known as a

a.

Syntax error.

b.

Linker error.

c.

Logic error.

d.

Runtime error.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer is option A.

If your program contains an error that is detected by the compiler, that error is known as a Syntax Error.

examples of syntax errors like semicolon at the end of the line, declaring all variables before its use in the program.

----->Linker Error:

These type of errors are occurs when your code compiles fine, but that some function or library that is needed cannot be found.

------>Logic Error:

As the name indicates, these type of errors are occurs due to the wrong logic of code. The code produce a output but it is not your desired output.

for example, if you want output as addition of two numbers, but you place minus symbol instead of plus, if performs subtraction of numbers. The code complies and excueted succesfully but output is not your expected. So, these errors are called Logic errors.

----->Runtime errors:

These errors are occured after compilation of code. but no output is produced.

for example divide by zero is a runtime error.

Add a comment
Know the answer?
Add Answer to:
If your program contains an error that is detected by the compiler, that error is known...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ​​​​​​ 11.   A _____________ error does not cause the compiler to generate an error, but does...

    ​​​​​​ 11.   A _____________ error does not cause the compiler to generate an error, but does cause the program to produce incorrect results. Syntax, logic, variable name, function name 12.   A syntax error occurs when the programmer violates one or more grammar rules of the C language. True or False 13.   Given this line of code: y = sqrt(x); x would be known as the argument. True or False 14.   A void function does not return a value to the...

  • A python program contains an import statement for a module that does not exist on the...

    A python program contains an import statement for a module that does not exist on the computer it is run on. I'm trying to determine which phase of a compiler would detect this error. I know it wouldn't be in the lexiacl analysis phase since the lexical analyzer doesn’t try to make sense of the program beyond trying to recognize tokens. I don't think this would be detected in the syntax phase since we are checking to see if the...

  • // 2. Practice debugging this program. It has approximately 22 compiler errors, 1 logic error and...

    // 2. Practice debugging this program. It has approximately 22 compiler errors, 1 logic error and //1 usability error. Identify them all. import java.util.scanner; //This program finds the average of three input values. public class Arithmeticx { public static void main( String [] args ) // declare variables double number1, number2, number3; // input data scanner in = newscanner( ); System.out.print( "Number 1? " ); System.out.print( "Number 2? " ); System.out.print( "Number 3? " ); number 1 = in.nextDouble; number...

  • What kind of error is it when your program has a syntax error? Exception Logic error...

    What kind of error is it when your program has a syntax error? Exception Logic error Run-time error Compile-time error ----------------------- Consider the following code snippet: public class Employee { private String empID; private boolean hourly; public Employee(String employeeID, boolean isHourly) { . . . } } Which of the following statements can be used to create an object of type Employee? Employee anAuto = new Employee("10548", true); Employee anAuto = new Employee("10548", "true"); Employee anAuto = new Employee(10548, true);

  • Specify whether each of the following errors is a syntax error, a runtime error or a...

    Specify whether each of the following errors is a syntax error, a runtime error or a logic error: a. using single quotes where command needs double quotes _____ b. dollar and cents amount on a bill is not formatted correctly _____ c. divide a number by zero _____ (8) Evaluate the following expressions: a. fabs (-25.2) b. pow(4.0, 3.0) c. squareroot (400) d. fabs (8.2) e. squareroot (-400) f. floor(-6.7) g. floor(6.7) h. ceil(-4.1) (4) Indicate which of the following...

  • Why float f = 10d will cause the compiler error/ and why int and double did...

    Why float f = 10d will cause the compiler error/ and why int and double did not cause any compiler error ? public class Main { public static void main(String[] args) { // write your code here char c = 38; int i = 'a'; double d = 10f; double d2 = 10; float f = 10d; System.out.println(a + b); } }

  • Comments used to document code should: A. be used as little as possible B. be insightful...

    Comments used to document code should: A. be used as little as possible B. be insightful and explain what the instruction's intention is C. only be included in code that is difficult to understand D. be used to define variables whose names are not easy to understand E. not be included with the program 2 points    QUESTION 2 The main method for a Java program is defined by: A. public static main( ) B. public static main(String[ ] args);...

  • in java Write a program that contains a bounds error. Run the program. What happens on...

    in java Write a program that contains a bounds error. Run the program. What happens on your computer?

  • Select a Java program that contains an exception error. The exception error can be one that...

    Select a Java program that contains an exception error. The exception error can be one that you have encountered yourself or one you located using the Internet. Describe your chosen exception error and explain potential implications. Be sure to include the actual code in your posting. Prior to submission, check your colleagues' postings, as your post must contain a different error message from your colleagues.

  • Assume that for a program, compiler A results in a dynamic instruction count of 8.0E8 and...

    Assume that for a program, compiler A results in a dynamic instruction count of 8.0E8 and has an execution time of 2.4 s, while compiler B results in a dynamic instruction count of 1.25E9 and an execution time of 1.8 s. a. [10] Find the average CPI for each program given that the processor has a clock cycle time of 2 ns. b. [10] Assume the compiled programs run on two different processors. If the execution times on the two...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT