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
sladkih [1.3K]
4 years ago
7

Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th

ese to integers and print the sum of these three integers. However, if any variable has a value that cannot be converted to an integer, print out, the string "bad value(s) in: " followed by the names of the variables that have bad values (separated by spaces, in alphabetically ascending order). For example, if the values of x, y and z were respectively "3", "9", "2" then the number 14 would be printed; but if the values were "abc", "15", "boo" then the output would be: bad value(s) in: x z
Computers and Technology
1 answer:
sineoko [7]4 years ago
5 0

Answer:

Required code is given below:

Explanation:

x, y, z = "abc", "15", "boo"

errors = []

try:

   x = int(x)

except ValueError:

   errors.append('x')

try:

   y = int(y)

except ValueError:

   errors.append('y')

try:

   z = int(z)

except ValueError:

   errors.append('z')

if len(errors) == 0:

   print(x+y+z)

else:

   print('bad value(s) in: ' + ' '.join(errors))

You might be interested in
Which of the following is an advantage of batch processing?
alina1380 [7]

Answer:

it can balance computing resources by time

Explanation:

this this is as it involves multiprogramming

8 0
4 years ago
Match the feature to its function. 1. Normal view provide rows of icons to perform different tasks 2. Notes view an area in whic
pashok25 [27]

Answer:

Match the feature to its function.  The answers are as below:

1. Normal view the place where creating and editing occurs  

2. Notes view an area in which information for handouts can be added  

3. Slide pane the place where the slide order can be changed

4. Menu bar contains lists of commands used to create presentations  

5. toolbars provide rows of icons to perform different tasks  

Explanation:

It is the normal view where the editing and the creation of the slides occur. And it's the notes view where you can add the information for handouts. You can arrange the slides in the slide pane. And you can get a list of commands for creating the presentation in the Menu bar. Also, Toolbar is the rows of icons which helps in performing a various set of tasks. And all these are definitions and prove our above selections are correct.

6 0
3 years ago
Read 2 more answers
How would Microsoft Word inform you of the error in the sentence below? (Tip: The error is in bold.)
Artist 52 [7]
It's the second answer since there's not really an error for Microsoft Word to actually catch.
3 0
3 years ago
The cost of a given amount of computing power has _____.
lana [24]

Answer:

decreased drastically over the last five decades

Explanation:

I would say it is that answer because a few decades ago we needed huuuge computers that filled rooms to compute simple tasks. Now we have cellphones, which are basically computers that can fit into the palm of our hands. Our phones can do more than what those huge computers of the past did and they're easier to produce. So cost must have drastically decreased.

3 0
3 years ago
Read 2 more answers
The operating system (OS) of an information system contains the software that executes the critical functions of the information
Feliz [49]

Answer:

a. True

Explanation:

An information system (IS) can be defined as a set of components or computer systems, which is used to collect, store, and process data, as well as dissemination of information, knowledge, and distribution of digital products.

Generally, it is an integral part of human life because individuals, organizations, and institutions rely on information systems in order to perform their duties, functions or tasks and to manage their operations effectively. For example, all organizations make use of information systems for supply chain management, process financial accounts, manage their workforce, and as a marketing channels to reach their customers or potential customers.

Additionally, an information system comprises of five (5) main components;

1. Hardware.

2. Software.

3. Database.

4. Human resources.

5. Telecommunications.

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

On a related note, the software application that executes the critical functions of an information system (IS) are contained in its operating system (OS).

Basically, the computer's memory, processes, softwares and hardwares are typically being managed by the operating system (OS). Thus, an OS makes it possible for different programs to run simultaneously (more than one software program running concurrently) and access the computer's memory, central processing unit (CPU), and storage.

4 0
3 years ago
Other questions:
  • You have installed a point-to-point connection using wireless bridges and Omni directional antennas between two buildings. The t
    9·1 answer
  • What panel in the unity Editor shows the objects in the scene
    11·1 answer
  • Which statement is false? Classes are reusable software components. A class is to an object as a blueprint is to a house. Perfor
    6·1 answer
  • In C++ Please :
    6·1 answer
  • Do you see traffic flowing from the internet into your system or from your network to the internet? explain why or why not:
    6·1 answer
  • Images are available in many formats, such as tif, bmp, gif, jpeg, and ____.
    5·1 answer
  • Draw a flow chart except the principle, time and date from the user. and display the simple interest and amount as output.​
    9·1 answer
  • You designed a program to find the midpoint of two points. Which step below corresponds to finding the average of the x-coordina
    15·1 answer
  • Write a C program that reads two hexadecimal values from the keyboard and then stores the two values into two variables of type
    15·1 answer
  • Fiber optic cable from a service provider can be delivered directly to the end user. which implementation delivers data to a cab
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!