A program to asks the user to enter integers

Assignment Help Computer Engineering
Reference no: EM132113569

Python Programming:

Write a Python program that does the following:

asks the user to enter integers - they can indicate they are finished by typing DONE

print the following:

number of positive integers

number of negative integers

sum of all entered numbers

average of all entered numbers (displayed with 1 digit to the right of the decimal)

Be sure to label all of your output and format it appropriately.

Be sure to think about all of the test cases for your application - what if the user enters DONE immediately, for example?

Bonus +2:

Provide a function called getValidInput. It accepts NO parameters.

It should continually ask the user to enter a number until they enter a valid integer (without letters or punctuation or spaces in their entry). It should RETURN a valid integer.

Reference no: EM132113569

Questions Cloud

Identify the explanatory and response variables : Identify the explanatory and response variables, indicating which one is each, and whether the variable is categorical or quantitative.
A program to display the amount of the discount : Write a program that asks the user to enter the nmber of packages purchased. the program should then displa the amount of the discount.
Prepare a module that has the functions and caller program : Consider the three words: STAM, TRAM,PRAM. Find the union, intersection, difference (STAM,TRAM) using arguments.
Write a read_temperature_data function that take in the name : Write a read_temperature_data function that takes in the name of a file as filename. Return a list with all of the temperature values.
A program to asks the user to enter integers : Write a Python program that does the following: asks the user to enter integers - they can indicate they are finished by typing DONE.
Create an empty dictionary called word_frequency : Write an if statement that checks whether the word is already in the dictionary. Create an empty dictionary called word_frequency.
Process for creating a random sample of size : Which of the following describes a correct process for creating a random sample of size 20 from a numbered list of 10,000 individuals? Check all that apply.
Create an application to help track donations : The local humane society has asked you to create an application to help track donations.
Write a function gcd that return the greatest common divisor : Write a function gcd(a, b) that returns the greatest common divisor of the parameters a and b.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Constructing truth table of converter circuit

Construct the truth table of the converter circuit using character a , b, c and d (d represents Least Significant Bit) in order to denote the literals input of BCD. Use w, x, y and z (z as Least Significant Bit) in order to represent the output li..

  What is the model of the hp touchsmart machine

What is the model of the HP TouchSmart machine that you have problem with?

  Choose one of the ubuntu shells and discuss how you can

choose one of the ubuntu shells and discuss how you can perform a minimum of 20 commands or functions. these commands

  Predicate color and action paint using situation calculus

Predicate color and action paint using situation calculus

  Desktop pc and a computer suitable as a web server

This solution provides the learner with an understanding of two and 3 tierd architectures and explains the role of each architecture. Futher this solution explain the main differences between a desktop PC and a computer suitable as a web server.

  Write down a c function named liquid()

make a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups. The passed integer represents total number of cups, and the function is to determine the number of gallons, q..

  What is the efficiency of the link

A block of 200 7-bit ASCII characters (with 1-bit even parity) is to be transmitted over an RS 232 serial link. Calculate the number of bits transmitted and the efficiency of the link if the asynchronous link uses 2 stop bits. What is the efficien..

  Manufacturers are continuously releasing firm-ware upgrades

manufacturers are continuously releasing firmware upgrades for their products. if you were the manager of a wlan how

  Generalize the jayant quantizer to the nonuniform case

Simulate the performance of this quantizer over the same range of ratio of variances as we have done for the uniform case.

  Generate and show all power-of-two numbers

show an arbitrary user-input integer.generate and display all power-of-two numbers in the range +128 to -128.

  Calculate the minimum required initial velocity

Calculate the minimum required initial velocity for a home run, for baseballs hit at the angles 10°, 20°, 30°, and 40° from the horizontal.

  Match the flowcharting segments with the descriptions

Match the flowcharting segments with the descriptions to which they correspond. Four descriptions will be left blank.- Data on source documents are keyed to an offline disk.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd