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
I damaged a k12 laptop. do I have to pay for the damage? and if so how much?
Gnesinka [82]

You explain your situation, they send you a new computer, then mail to them the broken computer and later pay a $200-350 dollar fee. I think it depends on how much damage you made to it.

5 0
3 years ago
The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IE
belka [17]

<em>Answer:</em>

<em>A loosely organized collection of citizens and engineers who communicate mostly by email. </em>

Explanation:

6 0
3 years ago
If you see an advertisement for a 3TB portable drive, this is most likely a reference to the device having a capacity of three
Anika [276]
Hello there.

Question: <span>If you see an advertisement for a 3TB portable drive, this is most likely a reference to the device having a capacity of three _____.

Answer: It is 3 terabytes. .

Hope This Helps You!
Good Luck Studying ^-^</span>
4 0
3 years ago
A set of object that share a common structure and common behavior in database is called ​
Tcecarenko [31]
An Object Class. Hopefully this answer is right.
3 0
3 years ago
One author states that Web-based software is more likely to take advantage of social networking (Web 2.0) approaches such as wik
kodGreya [7K]

Answer:

Yes

Explanation:

I will say Yes. There are very much limitless possible and future we can expect from social media and even more from social networking. Its capabilities from upcoming software in the future. Since the Internet is in its early days of growing and cloud computing being introduced there are way more possibilities in the future.

Social media can be duely applied by CIT (Computer Information Technologies) graduates. It can be used to improve them in their career and also will helps them connect professionally. Quora is one such platform which is not exactly like LinkedIn but pretty much serves the purpose.

6 0
3 years ago
Other questions:
  • Jorge has $300 for work he performed. He expects to spend the money in the next few weeks to buy a new bike. Which type of accou
    8·1 answer
  • Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
    6·1 answer
  • Which of the following statements about the FAFSA process are TRUE?
    6·1 answer
  • Match the software requirements of a server to their purpose
    5·1 answer
  • Is there a way to get back old messages that you didn't mean to delete??? I have a Samsung S5 and I really really need help. I d
    11·2 answers
  • A _____ is a harmful program that resides in the active memory of a computer and duplicates itself. Select one: a. scareware b.
    7·1 answer
  • lance measured 0.485 liter of water. Angel measured 0.5 liter of water. lance said, "My beaker has more water than yours because
    6·2 answers
  • WHAT THE DEFINITION OD ENGINEER. No CHEAT
    5·2 answers
  • What sorts of changes have you been observing in your society in your society in comparison in last 3 years​
    13·1 answer
  • What is media ethics. Explain two forms of maintaining media ethics with examples​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!