Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python 3 please. 1.4 Program: Weight Data (1) Prompt the user to enter a series of numbers, each corresponding to a person's weight in

In Python 3 please. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1.4 Program: Weight Data (1) Prompt the user to enter a series of numbers, each corresponding to a person's weight in pounds. Keep asking for wieghts until the use enters a 'Q' or a 'q'. Store all weights in a list and the print the list. (2 pts) An example output is: Enter weight: 228.9 Enter weight: 105.3 Enter weight: 89.7 Enter weight: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds (2) Output the average of the list's elements with two digits after the decimal point. Hint: Use a conversion specifier to output with a certain number of digits after the decimal point (1 pt) An example output is: Enter weight: 228.9 Enter weight: 105.3 Enter weight 3: 89.7 Enter weight 4: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds Average weight: 147.55 (3) Output the highest weight with two digits after the decimal point (1 pt) An example output is: Enter weight: 228.9 Enter weight: 105.3 Enter weight 3: 89.7 Enter weight 4: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds Average weight: 147.55 Max weight: 228.90 (4) Prompt the user to get a specified weight (using an integer, 1 for the first entry, 2 for teh second entry, etc.). Check the entry to make sure it's valid and print the corresponding weight at the user specified location along with corresponding value in kilograms. (1 kilogram is equal to 2.2 pounds). (3 pts) An example output with a valid number is: Enter weight: 228.9 Enter weight: 105.3 Enter weight 3: 89.7 Enter weight 4: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds Average weight: 147.55 Max weight: 228.90 Enter a list index location: Weight in pounds: 89.70 Weight in kilograms: 40.77 An example output with an invalid number is: Enter weight: 228.9 Enter weight: 105.3 Enter weight 3: 89.7 Enter weight 4: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds Average weight: 147.55 Max weight: 228.90 Enter a list index location: Entry not valid! (5) Sort the list's elements from least heavy to heaviest weight. (2 pts) EX Enter weight: 228.9 Enter weight: 105.3 Enter weight 3: 89.7 Enter weight 4: 163.0 Enter weight: Weights: 226.0 pounds 105.3 pounds 89.7 pounds 166.3 pounds Average weight: 147.55 Max weight: 228.90 Enter a list index location: Weight in pounds: 89.70 Weight in kilograms: 40.77 Sorted weight list: [89.7,105.3,163.0, 228.91

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_2

Step: 3

blur-text-image_3

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 And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions