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
TEA [102]
3 years ago
7

Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, wh

at part of the compiler detects them. Using your favorite imperative language, give an example of each of the following.a. A lexical error, detected by the scannerb. A syntax error, detected by the parserc. A static semantic error, detected by semantic analysisd. A dynamic semantic error, detected by code generated by the compilere. An error that the compiler can neither catch nor easily generate code to catch (this should be a violation of the language definition, not just a program bug)(Use the same language for parts (a)-(d). You may use a different language for part(e) -- this part could be challenging in Java, for example.)
Computers and Technology
1 answer:
CaHeK987 [17]3 years ago
4 0

Answer:

The chosen language in this instance is Java. The errors are explained below

Explanation:

a. Lexical error, detected by the scanner: ‘aa’ is the string and not the character so ‘a’ will not be assigned the data type char.

b. Syntax error: Missing ‘;’ at the end of a statement.

c. A static semantic error, detected by semantic analysis: arr[10.5], the array will become out of bounds.

d. A dynamic semantic error, detected by code generated by the compiler:

int [] array = new int [10];

array [10] = 0;

The array here, has been assigned value 0 which is not with in the bounds.

e. An error that the compiler can neither catch nor easily generate code to catch (this should be a violation of the language definition, not just a program bug:

int a;

if (false)

{

x =10;  

system.out.println(“Error”);

}

Here, the value of x is unreachable, yet error will not be reported.

You might be interested in
The most important task in developing a new computer system/app is to: a) choose the most current technologies such as operating
Ede4ka [16]

Answer:

c) establish a good relationship with the user and develop detailed and complete user requirements.

Explanation:

A new computer system/app is a computer software designed to perform a group of coordinated functions, tasks, or activities for the benefit of the user. It must be designed to help people carry out an activity.

6 0
3 years ago
PLS HURRY!
Debora [2.8K]

Answer:

D. All of the options listed are correct.

Explanation:

A macro, in excel sheet, is an action or series of action that repeats the keystrokes or mouse actions as many times as one wants. To view macro, shortcut key is to Pres Alt+F8; to delete, one needs to select the macro one wants to delete and press Delete button.

The another way to view macro is to go to the Developer tab, and select the Macro option in Code group. And, then select macro need to delete, and press Delete button.

Another shortcut is to press Alt+F11, and click  on Tools tab, click on Macros and then select macro need to be deleted, and press Delete.

So, all the options stated above are correct.

Therefore, option D is correct answer.

8 0
3 years ago
How do films use camera shots?
lorasvet [3.4K]
These advanced camera shots, or angles, are used in film to convey an effect or emotion rather than exemplify a sense of space. Before filming, cinematographers will write out their shot list in order to plan how each scene of their film should be shot
7 0
3 years ago
Read 2 more answers
# q7 - create function readFileFirstLast() to meet the conditions below
MAVERICK [17]

Answer:

See explaination

Explanation:

def readFileFirstLast(filename):

# doc string

''' Function accept the filename and opens the fle

and reads all lines and strips new line character and

stores first and last in a string and return that string'''

#eception handle if file not found

try:

#opening the file

f = open(filename)

#reading the first line and striping the ne line

string = f.readline().strip()

#iterating until last line

for line in f:

pass

#concate the last line after strip the new line character to the string

string = string + " " + line.strip()

#return the string

return string

except:

#if file not found

return "File not found"

#taking the file name from user

filename = input("Enter a file name: ")

#printing the doc string in function

print("\ndoc_sting: \n"+ readFileFirstLast.__doc__+"\n")

#printing the returned string by calling the readFileFirstLast()

print("output string :")

print(readFileFirstLast(filename))

3 0
3 years ago
A certain audio compact disc (cd) contains 783.216 megabytes of digital information. each byte consists of exactly 8 bits. when
kakasveta [241]
You are not putting the question but I can guess that it asking for the CD duration. To answer this question, you need to convert the CD capacity unit(783.216 megabyte) into megabits which were used for the cd read rate (1.4 megabits/s). The calculation would be:

CD duration: CD capacity / rate= 783.216 megabytes *(8 megabits/megabyte) / (1.4 megabits /s)= 4475.52 second or 74.6 minutes
3 0
4 years ago
Other questions:
  • Suppose you are the security manager of a company and one of your goals is to design security mechanisms based on three security
    10·1 answer
  • Which statement is FALSE? If a method does not return a value, the return-value-type in the method declaration can be omitted. P
    8·1 answer
  • 3. A hyperlink is important because it allows you to ___________. (1 point) click on the link to go directly to a website insert
    9·1 answer
  • __________bits equal one byte.EightTenSixty-fourThirty-twoSix
    10·1 answer
  • Assume v is a vector of integers that has been declared and initialized. Write a statement that adds the value 42 to the vector.
    14·1 answer
  • What adds the element carbon to the environment
    10·2 answers
  • By observing human behavior,_______are able to understand the cause and effect relationship between the supply of things we want
    13·2 answers
  • This inventor made their own fortune. They had little to no help in become one of the first black millionaires. They invented a
    9·1 answer
  • Write down the functions of network layer in your own words.ASAP
    14·1 answer
  • What type of malicious software tries to gather information about you without your consent?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!