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
IRISSAK [1]
3 years ago
7

Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value

that is not a number, give the user a second chance to enter a value. After two mistakes in a row, quit the program. When the user enters 0, the function should return the sum of all correctly entered values. Use exception handling to detect improper inputs.
Computers and Technology
1 answer:
elena-s [515]3 years ago
5 0

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

You might be interested in
You Could Never Size Me UP! Been Doing This Sh*t A Long ⏱time
SVETLANKA909090 [29]

Answer:

Have a nice day :) God Bless!

Explanation:

4 0
3 years ago
What is a traffic controller?what are its functions?
olchik [2.2K]

Answer:

A traffic controller is basically a system design to regulate traffic in a controlled manner with a set of traffic rules to follow so as to ensure public safety .

The main functions of a traffic light controller are listed below:

  • To direct  and regulate vehicular and pedestrian traffic
  • To ensure safety of construction workers, emergency response team and public in general in order to avoid accidents
  • These also uses CCTV and other monitoring system to manage flow of traffic and suggestion concerned with traffic congestion. These are provided by local or state authorities.
  • To ensure smooth traffic flow in order to save time and chaos.

4 0
3 years ago
Create a mobile app plan using PowerPoint slides to show mock-ups of screens,
TiliK225 [7]

Answer: Have you gotten an answer yet?

6 0
3 years ago
The term "Big Data" is relative as it depends on the size of the using organization.
oksano4ka [1.4K]

Answer:

A

Explanation:

8 0
4 years ago
Imagine that you are preparing a multimedia presentation. What are the four things you need to consider when getting started?
Marrrta [24]

Explanation:

Consider the Content

Create an Outline

Develop Your Presentation

PRACTICE!!

8 0
3 years ago
Read 2 more answers
Other questions:
  • ____ is an object-oriented programming language from Sun Microsystems which allows small programs called applets to be embedded
    13·1 answer
  • How to solve 3(x - 2) = 9x<br><img src="https://tex.z-dn.net/?f=3%28x%20-%202%29%20%3D%209x" id="TexFormula1" title="3(x - 2) =
    14·1 answer
  • Choose a project with a relatively simple description (building a LAN, designing a web page, inventing a new communication devic
    6·1 answer
  • You recently upgraded your computer and added an extra 512 MB of RAM. Consequently, you want to increase your swap space by addi
    10·1 answer
  • In general, smartphones do NOT hold as much personal information as tablets.
    11·1 answer
  • The merge sort algorithm____________.A. Can be used only on vectors of even length.B. Works by reducing vectors down to the base
    9·1 answer
  • The administrators of Tiny College are so pleased with your design and implementation of their student registra- tion and tracki
    13·1 answer
  • Coral Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the a
    6·1 answer
  • Ema Company for business .
    14·1 answer
  • How do you mark the brainiest?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!