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
pantera1 [17]
3 years ago
14

Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus

e an exception c. a block of the statements that are most likely to cause an exception d. only the statements that might cause an exception
Computers and Technology
1 answer:
SVETLANKA909090 [29]3 years ago
5 0

Answer:

B) A block of statement that might cause an exception.

Explanation:

Exception handling is a good programming technique that prevents our program from crashing when an exception occurs during execution. The try clause is used with a catch to handle any exception that might occur, so whenever a statement that might cause an exception is to be used, this should be contained in a try statement block of code.

You might be interested in
What is the minimum number of bits you need to encode the 26 letters of the alphabet plus a space?Pace?
Andrei [34K]

Answer

5 bits

Explanation

A bit is the least or the smallest unit of data in a computer. They are  the units of information in information theory, consisting of the amount of information required to specify one of two alternatives 0 and 1. This is because A bit has a single binary value, either 0 or 1

If you use roman alphabet A to Z lets use log 2(26)=4.7 bits. when you round off it will be 5 bits.

8 0
3 years ago
Which type of connection is needed to synchronize data with a cloud service?
Svetllana [295]

Answer:

Internet

Explanation:

The "Cloud" is an Online service this means it works on the Internet and without the Internet you can't have access to it.

7 0
3 years ago
def getCharacterForward(char, key): """ Given a character char, and an integer key, the function shifts char forward `key` steps
zhenek [66]

Answer:

  1. def getCharacterForward(char, key):  
  2.    charList = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3.    if(len(char) > 1):
  4.        return None  
  5.    elif(not isinstance(key, int)):
  6.        return -1
  7.    else:
  8.        index = charList.find(char)
  9.        if(index + key <= 25):
  10.            return charList[index + key]
  11.        else:
  12.            return charList[(index + key)% 26]
  13. print(getCharacterForward("C", 4))
  14. print(getCharacterForward("X", 4))

Explanation:

Firstly, define a charList that includes all uppercase alphabets (Line 2). We presume this program will only handle uppercase characters.

Follow the question requirement and define necessary input validation such as checking if the char is a single character (Line 4). We can do the validation by checking if the length of the char is more than 1, if so, this is not a single character and should return None (Line 5). Next, validate the key by using isinstance function to see if this is an integer. If this is not an integer return -1 (Line 6 - 7).

Otherwise, the program will proceed to find the index of char in the charList using find method (Line 9). Next, we can add the key to index and use the result value to get forwarded character from the charList and return it as output (Line 11).

However, we need to deal a situation that the char is found at close end of the charList and the forward key steps will be out of range of alphabet list. For example the char is X and the key is 4, the four steps forward will result in out of range error. To handle this situation, we can move the last two forward steps from the starting point of the charList. So X move forward 4 will become B. We can implement this logic by having index + key modulus by 26 (Line 13).  

We can test the function will passing two sample set of arguments (Line 15 - 16) and we shall get the output as follows:

G

B

8 0
3 years ago
A personal computer uses a number of chips mounted on a circuit board called microprocessor. system board. daughter board. mothe
AveGali [126]
I am almost 100% sure that it is called a microprocessor 
8 0
3 years ago
Let's say you wanted to make an American Football game. What is an example of a legal issue you'd have to watch out for?
IgorC [24]

Answer:

Personal injury.

Explanation:

With a bunch of people running around on a field with a goal of <em>slamming into each other</em>, bodily injury becomes a relevant liability.

7 0
1 year ago
Other questions:
  • "This part of the computer fetches instructions, carries out the operations commanded by the instructions, and produces some out
    15·1 answer
  • Courteous behavior on the road will
    10·2 answers
  • Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed to
    12·1 answer
  • Name a piece of software you often use where it is easy to produce an error. Explain ways you could improve the interface to bet
    5·1 answer
  • Input is information a system uses to monitor and adjust itself to meet the goal.
    8·1 answer
  • What are 2 main differences betweenarrays andstructs?
    7·1 answer
  • Please select the word from the list that best fits the definition
    13·2 answers
  • B. Some of Company X's new practices and systems are unethical. Business ethics is a set of codes
    5·1 answer
  • Draw a flow chart to access the marks of three students. calculate the total avarage and display the result​
    11·1 answer
  • HELP THIS IS SO DIFFICULT
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!