Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[IN PYTHON] Number Averager Write a script that prompts the user for two numbers, a and b. Then, prompt the user to enter a type

[IN PYTHON] Number Averager Write a script that prompts the user for two numbers, a and b. Then, prompt the user to enter a type of average out of the three options below. Make it so the user would just type in a number 1, 2 or 3 for the average (i.e. 1 for arithmetic mean, 2 for geometric mean, or 3 for root-mean-square). This numerical selection is an example of how to give the user a simple response that will get around potential spelling errors and head off user frustration. This design decision makes the user interaction more robust. No requirement to round or format n image text in transcribed

5) (15 points) Number Averager Write a script that prompts the user for two numbers, a and b. Then, prompt the user to enter a type of average out of the three options below. Make it so the user would just type in a number 1, 2 or 3 for the average (i.e. 1 for arithmetic mean, 2 for geometric mean, or 3 for root-mean-square). This numerical selection is an example of how to give the user a simple response that will get around potential spelling errors and head off user frustration. This design decision makes the user interaction more robust. No requirement to round or format numbers for this problem. Output the correct average, based on what the user selected. 1. The arithmetic mean: (a + b)/2 2. The geometric mean: Vab 3. The root-mean-square: 2 Save your script as: averages.py

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions