Create a function called avgsumofsquares

Assignment Help Basic Computer Science
Reference no: EM131716446

Create a function called avgSumOfSquares that expects no arguments. Instead, this function gets its input from the user at the keyboard. The function asks the user to enter a series of numbers, one at a time. The user types end to indicate that there are no more numbers. The function computes the average of the sum of the squares of all the values entered. For example, given the values 6, -3, 4, 2, 11, 1, and -9, the sum of the squares would be (36 + 9 + 16 + 4 + 121 + 1 + 81) = 268. The average of the sum of squares would then be 268/7 = 38.285714285714285. The function then prints the average of the sum of the squares and returns that average. However, if end is entered before any values are entered, the function notifies the user that no numbers were entered and returns None. You may assume the user inputs are valid: they will either be a number or the string end. Here are some examples of how your function should behave:

>>> avgSumOfSquares()

Enter next number: 6

Enter next number: -3

Enter next number: 4

Enter next number: 2

Enter next number: 11

Enter next number: 1

Enter next number: -9

Enter next number: end

The average of the sum of the squares is: 38.285714285714285

38.285714285714285

Reference no: EM131716446

Questions Cloud

Describing test cases based on ontologies : Describing test cases based on ontologies - Test case abstraction after execution - Test case reuse models and frameworks
Examine the actions you will take to address : Identify the main resources that you will need in each of the following areas in order to implement the plan - economic, social / community, political.
Discuss some experiences of the later years : Discuss some experiences of the later years that may alter an older person's self-concept and may negatively influence their self-esteem
Determination of the person being affected : determination of the person being affected. Learning how to use the internet in moderation is often the main objective in the therapy
Create a function called avgsumofsquares : Create a function called avgSumOfSquares that expects no arguments. Instead, this function gets its input from the user at the keyboard.
About could be your cell phone service provider : what they need to keep doing to hold onto customers. One industry to think about could be your cell phone service provider.
Discuss loses eligibility to receive social services : termination is when a client leaves an institution for some reason or loses eligibility to receive social services
Discuss about the heavy cigarette smoker : The evidence that smoking is harmful to one's health continues to grow. Now smoking is linked not only to lung cancer, emphysema.
Briefly explain how it appears in the film : identify your specific concept and briefly explain how it appears in the film

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Article in the ny times

Read the following article in the NY Times. Defeat your opponent and hires. Need the following questions answer. What does this mean in terms of organizational behavior? How do you implement? Is this an ethical practice? How would this an ethical pra..

  What is the percentage of compression you achieve above

What is the percentage of compression you achieve above? (This is the average of the compression percentages achieved for each letter, weighted by the letter's frequency.)

  Investigate the standards development

Investigate the "Standards Development" process for IT type products and interfaces. Identify at least two ways that standards are agreed to.

  Design a combinational circuit

Design a combinational circuit that accepts a 4-bit number and output a 3-bit binary number that approximates the square root of the number

  Hand tracing table

Hand Tracing Table: Please complete the follow Hand Trace Tables. Using MS Word insert the table with proper numbers of columns and table header, below the "Hand Tracing Table Goes Here:" (2 points each, 8 points total).

  Ethical considerations draft

This week, you will submit your Ethical Considerations draft. This portion of the Course Project will provide an evaluation of the ethical considerations associated with the student's chosen technology in relation to its impact on humanity (roughl..

  Perplexing about vulnerability assessment

The first three chapters of your book cover physical design, vulnerability assessments, and security surveys/audits.

  Create or modify a user ea for a file

Write a program that can be used to create or modify a user EA for a file

  Individual retirement account

An individual earns an extra $2000 each year and places this money at the end of each year into an Individual Retirement Account (IRA) in which both the original earnings and the interest in the account are not subject to taxation. If the account ..

  What happens to the hash function

Suppose that you use open addressing to resolve collisions. Now imagine that your hash table is getting full. To avoid the bad performance that results from a nearly full hash table, you should create a new, larger hash table.

  Orientation program for these new employees

THEN, develop an outline of an orientation program for these new employees. Include your learning objectives, the length of the program.

  What conditions would optimize the surfactin production

Analyze the residuals from this experiment. Are there any indications of model inadequacy or violations of the assumptions?

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