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
bixtya [17]
3 years ago
15

In traditional programming, probably the most often used error-handling outcome was to ____.

Computers and Technology
1 answer:
Harman [31]3 years ago
3 0

In traditional programming, doubtless the error-handling outcome that is most often used was to terminate the program<span> in which the offending statement occurred, or at least to terminate the module (if not the entire program) in which the offending statement occurred.</span>

You might be interested in
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
o-na [289]

Answer:

I am writing a Python program. Let me know if you want the program in some other programming language.        

import string  #to use string related functions

def wordcount(filename):  # function that takes a text file name as parameter and returns the number of occurrences of every word in file

   file = open(filename, "r")  # open the file in read mode

   wc = dict()  # creates a dictionary

   for sentence in file:  # loop through each line of the file

       sentence = sentence.strip()  #returns the text, removing empty spaces

       sentence=sentence.lower() #converts each line to lowercase to avoid case sensitivity

       sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  #removes punctuation from every line of the text file

       words = sentence.split(" ")  # split the lines into a list of words

       for word in words:  #loops through each word of the file

           if len(word)>2:  #checks if the length of the word is greater than 2

               if word in wc:  # if the word is already in dictionary

                   wc[word] = wc[word] + 1  #if the word is already present in dict wc then add 1 to the count of that word

               else:  #if the word is not already present

                   wc[word] = 1  # word is added to the wc dict and assign 1 to the count of that word                

   for w in list(wc.keys()):  #prints the list of words and their number of occurrences

       print(w, wc[w])  #prints word: occurrences in key:value format of dict        

wordcount("file.txt") #calls wordcount method and passes name of the file to that method

Explanation:

The program has a function wordcount that takes the name of a text file (filename) as parameter.

open() method is used to open the file in read mode. "r" represents the mode and it means read mode. Then a dictionary is created and named as wc. The first for loop, iterates through each line (sentence) of the text file. strip() method is used to remove extra empty spaces or new line character from each sentence of the file, then each sentence is converted to lower case using lower() method to avoid case sensitivity. Now the words "hello" and "Hello" are treated as the same word.

sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  statement uses two methods i.e. maketrans() and translate(). maketrans() specifies the punctuation characters that are to be deleted from the sentences and returns a translation table. translate() method uses the table that maketrans() returns in order to replace a character to its mapped character and returns the lines of text file after performing these translations.

Next the split() method is used to break these sentences into a list of words. Second for loop iterates through each word of the text file. As its given to ignore words of length 2 or less, so an IF statement is used to check if the length of word is greater than 2. If this statement evaluates to true then next statement: if word in wc:   is executed which checks if the word is already present in dictionary. If this statement evaluates to true then 1 is added to the count of that word. If the word is not already present  then the word is added to the wc dictionary and 1 s assigned to the count of that word.

Next the words along with their occurrences is printed. The program and its output are attached as screenshot. Since the frankenstein.txt' is not provided so I am using my own text file.

4 0
3 years ago
each term to the appropriate definition. DBMS data mining hash file index key field locking protocol relation roll back schema S
ikadub [295]

Answer:

1. DBMS

C. <em>A storage system that provides efficient access to randomly chosen items</em>

G. <em>Performs database operations requested by application software</em>

2. data mining

B. <em>The process of extracting hidden information</em>

3. hash file

A. <em>A. means of locating a particular record within a file</em>

4. index key field

F. <em>An item used to identify records uniquely</em>

5. locking protocol

E. <em>A system to guard against database errors due to performing transactions concurrently</em>

6. relation

D. <em>A structural unit (with rows and columns) in a popular database model</em>

7. roll back schema

I. <em>A "road map" of a particular database's design</em>

J. <em>To "unwind" a transaction</em>

8. SQL

H. <em>A popular language that implements relational database operations.</em>

5 0
3 years ago
Which of the following statements is not true of web storage?
slavikrds [6]

Answer:

The data in web storage is passed to the server with every HTTP request.

Explanation:

There are basically two Web storage APIs Session storage and local storage.Both can store data up to 5MB. They are supported by every modern browser.You can store data in local storage indefinitely and for browser session in session storage.There is no data or information in HTTP request header.So we conclude that option 4 is the answer.

3 0
3 years ago
What are the two ways to use the help menu
neonofarm [45]
What help menu are you talking about?
6 0
3 years ago
Read 2 more answers
Which best explains a password attached to a document?
Otrada [13]
That is encryption. Encrypted files usually have a password assigned. In order to decrypt the file, you need to have the password.
3 0
3 years ago
Other questions:
  • I need help please?!!!
    15·1 answer
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even numb
    8·2 answers
  • Preesure is drived quantity? why​
    15·2 answers
  • The following slide was created as part of a presentation that trains new employees how to use the scheduling and calendar softw
    14·2 answers
  • Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr
    15·1 answer
  • Computers help eliminate the repetitiveness of manual tasks. How can this benefit you in your overall career?
    9·2 answers
  • Do you think it’s better for a young designer to use free, open-source art programs or to pay for commercial programs? Explain y
    14·1 answer
  • Do you think Mortal Combat is cool?
    10·2 answers
  • What was the name of first computer?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!