How to design and implement a program

Assignment Help Python Programming
Reference no: EM132354833

Question

(Conditionals, and Loops)

How to design and implement a program that prompts the user for numbers.

the program should continue prompting for values until the user enters -1, at which point it should exit.

For each input provided, your program should print a running tally of the sum and average of numbers input so far.

When the user exits the program, it should print a summary line indicating the number of inputs provided, the sum of the input numbers, and the average of the numbers that the user provided as input to this program.

A sample run of your program might look as follows (human input is in bold/purple, and program output is in blue/italics):

Please enter a number (enter -1 to exit): -5

Stats for Inputs provided so far: Sum: -5. Average: -5.

Please enter a number (enter -1 to exit): 10

Stats for Inputs provided so far: Sum: 5. Average: 2.5.

Please enter a number (enter -1 to exit): -1

Stats for ALL Inputs provided: 2. Sum: 5. Average: 2.5.

Show how to design the program for maximal reuse by using modules and functions (as necessary).

Name the file: statsmain.py. If you make a module, name it stats.py.

Reference no: EM132354833

Questions Cloud

Find keys d and e for the RSA cryptosystem : Find keys d and e for the RSA cryptosystem where p=5, q=3. Encrypt the following plaintext BA. You must show all the steps of your work
Design the program for maximal reuse by using modules : When the user exits the program, it should print a summary line indicating the number of times the user provided an input to this program.
Evaluate the impact of technology on psychological profiling : As scholars, practitioners and leaders in the areas of psychology and criminal justice, it is important to not only understand the past as it applies.
Analyze the benefits and shortcomings of labeling an idea : Analyze the benefits and shortcomings of labeling an idea, organization, or person as a liberal or conservative, and apply these benefits
How to design and implement a program : How to design and implement a program that prompts the user for numbers. The program should continue prompting for values until the user enters.
Manufacturing firm as a potential acquisition target : What criteria would you use to select a manufacturing firm as a potential acquisition target? Why?
Anti-democratic threat to integrity of legislative process : Has ALEC simply beaten other interest groups at political game, or does ALEC actually pose an anti-democratic threat to the integrity of the legislative process
How much interest will you earn in the first year : Old Time Savings Bank pays 5% interest on its savings accounts. If you deposit $1,100 in the bank and leave it there:
Write a function that accepts two list of integers a1 and a2 : Write a function named zero_out that accepts two lists of integers a1 and a2 as parameters and replaces any occurrences of a2 in a1 with zeroes.

Reviews

Write a Review

Python Programming Questions & Answers

  Create a cheat commands in the game

ISCG5420 Programming Fundamentals - Create a cheat commands in the game so player can pick up any item he wants from any location in the map.

  Write program to gather-display results of golf tournament

Write a program to gather, then display the results of the golf tournament played at the end of March. The Club president Mr. Martin has asked you

  Programming in Python Project - Word Cookies Game

CE 364 Programming in Python Project - Word Cookies Game. Create a test file from the sample input tiles provided. Your code should be robust and resilient

  Define function that convert number value to character digit

COP 1500 Intro Computer Science Number Systems Project Assignment - Then define a function that can convert a number value to a character digit

  Write a program that contains an introductory docstring

Implement the algorithm using Python programming language for given specifications/requirements - Create programs based on incremental development processes

  Write a function called make payment

Write a function called "make payment(P)" that takes as an argument the total payment on the credit card ($P) and prints "Success" or "Retry."

  Write a program that prints the longest substring

HIT137 SOFTWARE NOW - Charles Darwin University - Write a program that prints the longest substring - Write a python program that allows the user to navigate

  Data file is a comma separated

The data file is a comma separated text values stored in a file with '.CSV' extension. The file has five columns corresponding to employee data fields listed above.

  Write a progra m that creates two objects

Write a progra m that creates two objects, object of the ProductionWorker class and an object of ShiftSupervisor r class.

  Prepare a program to simulate the grocery store

A small grocery store has one checkout. You have been asked to write a program to simulate the grocery store as it checks out customers.

  Define a class for representing a distance

Define a class for representing a distance (with one attribute that represents the distance in inches).

  Write a function to convert celsius to fahrenheit

Write a 2-part program as follows: Write a function to convert Celsius to Fahrenheit. Write a function to convert Fahrenheit to Celsius.

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