Write a program that hints the user to input a different num

Assignment Help Computer Engineering
Reference no: EM132107936

## Programming language is python.

Write a program that hints the user to input a different number each time repetitively (both integer and float numbers are acceptable).

1. It should meet the requirements listed below:

There are three types of legitimate input for this program

numeric value---------used to calculate average

#---------------used to continue to the next input

done-------------- used to terminate the program

2. If the user input a number, add this number to all the existing numbers from user's previous input and calculate their real-time average. Display this real-time average (float number) in the next round of user input hint message in terms of "Please input a number. Current average is ..."

For instance, in the first round, I don't have any numbers from previous input. The program tells me that my currents average is 0 and asks for my input.

3.The input number should be different from any numbers previous entered. If I input a number that has already been added before, the program will not accept the number and instruct me to input a non-duplicated number in the next round. For example, if I enter 2 again, the program will tell me "No duplicate number" in the input hint message.

4.When user input "#", the program will skip to the next round of input without any changes being made. The average will remain the same.

5. When user input anything other than number, "#", and "done", the program will not accept the input. The program will tell user "Please provide meaningful input" in the input hint message in the next round. For example, if I enter "gh". The program will find out that it is not a valid input and warn me to input something meaningful instead in the next round

6. When the user input "done". The program execution stops and displays to the user the average of all the numbers previously entered by printing out "Program execution ended. The average is ...". Now I input "done," the program will stop executing and print out my final average value.

Reference no: EM132107936

Questions Cloud

Authoritarian budget processes and participatory budget : What is the difference between authoritarian budget processes and participatory budget processes?
Calculate the cost installing a fence around a rectangular : Create an application that can be used to calculate the cost installing a fence around a rectangular area.
What is the value of the stock : The risk-free rate of interest is 7 percent, the market return is 13 percent, and the stock's beta is 1. What is the value of the stock?
Prices of longer maturity bonds : Simple interest is charged on bank bills while compound interest is applied on bonds. Prices of longer maturity bonds are more sensitive to interest rate
Write a program that hints the user to input a different num : Write a program that hints the user to input a different number each time repetitively (both integer and float numbers are acceptable).
What is the present value of the offer : What is the present value of the offer if the discount rate is 10 percent?
Write a program to load the names in the combo box : Create an SQL or Access database with all your friends' information and write a program to load the names in the combo box.
Present value of the cash flows : What is the present value of the cash flows from your lottery winnings?
Test case a single line comprising the passages : IBM cognitive computing|IBM "cognitive" computing is a revolution| ibm cognitive computing|'IBM Cognitive Computing' is a revolution?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write an extensive literature review

Write an extensive Literature review and an analysis on how Job portals have helped tackle unemployment.

  What is the difference between the ditscap and the nist

What is the difference between the DITSCAP and the NIST 800-37, Based on your understanding, compare each phase of NIST

  Evaluate friction coefficient and heat-transfer conductance

Consider fully developed laminar flow between symmetrically heated parallel plates with constant heat rate per unit of duct length.

  Why would you add permissions to group instead of individual

Why would you add permissions to a group instead of the individual? List at least three different types of access control permissions you can enable for a file.

  Create a class called class to represent a class of students

Create a class called Class to represent a class of students. The class should store the name of the class (Biology, History, etc), the name of the instructor, the number of students, the average GPA of the students in the class, and finally the s..

  Peer-to-peer networking

Explain the term peer-to-peer networking? Describe why is bit torrent regarded to be a more efficient protocol? In the bit torrent context, explain how seeders and the leechers work.

  Define the difference between a tcp segment and an ip packet

What is the difference between a TCP segment and an IP packet, How are errors handled during transmission of segmented packets

  Why not use a sentinel to avoid the test in down heap

Why not use a sentinel to avoid the j

  Write a program to generate a series of pseudo random number

You will write a program to generate a series of pseudo random numbers, using a linear feedback shift register method. You will start with an arbitrary number (not zero) x with a representation in n bits.

  Describe in brief what is mean by the context of a thread

Describe in brief what is mean by the context of a thread, and what are the typical operations involved in switching between threads.

  How will your organization deal with sabotage

How will your organization deal with sabotage or misuse of the drones and many organizations already use electronic monitoring of employees.

  Describe in detail an implementation of a priority queue

Describe in detail an implementation of a priority queue based on a sorted array. Show that this implementation achieves O(1) time for operations min.

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