1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
meriva
2 years ago
5

Using your favorite imperative language, give an example of each of the following. (a) A lexical error, detected by the scanner

(b) A syntax error, detected by the parser (c) A static semantic error, detected by semantic analysis (d) A dynamic semantic error, detected by code generated by the compiler
Computers and Technology
1 answer:
Travka [436]2 years ago
8 0

Explanation:

a. int foo+; (foo+ is an invalid identifier because + is not a valid char in identifiers)

b. foo int; (Syntax error is any error where the syntax is invalid - either due to misplacement of words, bad spelling, missing semicolons etc.)

c. Static semantic error are logical errors. for e.g passing float as index of an array - arr[1.5] should be a SSE.

d. I think exceptions like NullReferenceException might be an example of DME. Not completely sure but in covariant returns that raise an exception at compile time (in some languages) might also come in this category. Also, passing the wrong type of object in another object (like passing a Cat in a Person object at runtime might qualify for DME.) Simplest example would be trying to access an index that is out of bounds of the array.

You might be interested in
Do you agree with the EU's decision that people should be able to ask Google to remove search results that contain incorrect, un
AnnyKZ [126]

Answer: Yes

Explanation: One should not be able to just find negative information on someone just because they googled it (unless they're famous of course)

7 0
3 years ago
Read 2 more answers
A program is required to three (3) numbers. calculate and print their total
podryga [215]

A program that is required to three (3) numbers. calculate and print their total is given below:

<h3>The Program</h3>

import java.util.Scanner;

public class SumAndAverage {

public static void main(String[ ] args) {

System.out.println("Enter three numbers - ");

// Accepting and finding sum of numbers.

int sum = 0;

Scanner sc = new Scanner(System.in);

for (int i = 0; i < 3; i++)

sum += sc.nextInt( );

// Printing sum and average.

System.out.println("Sum - " + sum);

System.out.println("Average - " + (sum / 3f));

}

}

The output would request three different numbers, then add them up, and display the output of the sum and then display or print their total


Read more about programming here:

brainly.com/question/23275071

#SPJ1

5 0
1 year ago
The while loop and the do loop are equivalent in their expressive power; in other words, you can rewrite a while loop using a do
sleet_krkn [62]
I think False...

I hope this helps
8 0
2 years ago
In one sentence, how would you sum up the internet?
Slav-nsk [51]

Answer:

an informational system

Explanation:

6 0
2 years ago
Read 2 more answers
Which of the following is an example of a runtime error?
Rina8888 [55]

Answer:

missing quotation marks around a string literal

6 0
2 years ago
Other questions:
  • What's a qat on a computer
    12·2 answers
  • 3. What is the purpose of the conclusion in an expository essay? (1 point)
    8·2 answers
  • If you have configured your prompt so that it does not show your working directory, you can use the ____ command to verify in wh
    15·1 answer
  • Can anyone fill in the space please
    6·1 answer
  • If a user inserts a piece of clip art over some text but does not want the art to block the text, the user should select
    14·2 answers
  • Which of the following refers to a collection of colors, fonts, and effects that can be
    6·1 answer
  • In C++ please.
    8·1 answer
  • Looking for friends, anyone up for it?
    12·2 answers
  • Computer is a major source of informarion why​
    8·1 answer
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!