Question

8.8 LAB: Warm up: People's weights (Lists)

(1) Prompt the user to enter four numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output the list. (2 pts)

Ex:

Enter weight 1:

236.0

Enter weight 2:

89.5

Enter weight 3:

176.0

Enter weight 4:

166.3

Weights: [236.0, 89.5, 176.0, 166.3]

(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)

(3) Output the max list element with two digits after the decimal point. (1 pt)

Ex:

Enter weight 1:

236.0

Enter weight 2:

89.5

Enter weight 3:

176.0

Enter weight 4:

166.3

Weights: [236.0, 89.5, 176.0, 166.3]

Average weight: 166.95

Max weight: 236.00

(4) Prompt the user for a number between 1 and 4. Output the weight at the user specified location and the corresponding value in kilograms. 1 kilogram is equal to 2.2 pounds. (3 pts)

Ex:

Enter a list location (1 - 4):

3

Weight in pounds: 176.00

Weight in kilograms: 80.00

(5) Sort the list's elements from least heavy to heaviest weight. (2 pts)

Ex:

Sorted list: [89.5, 166.3, 176.0, 236.0]

Output the average and max weights as floating-point values with two digits after the decimal point, which can be achieved as follows:

print('{:.2f}'.format(your_value))

need the code in python please

Answer #1

Output each floating-point value with two digits after the
decimal point, which can be achieved as follows:
printf("%0.2lf", yourValue);
(1) Prompt the user to enter five numbers, being five people's
weights. Store the numbers in an array of doubles. Output the
array's numbers on one line, each number followed by one space. (2
pts)
Ex:
Enter weight 1:
236.0
Enter weight 2:
89.5
Enter weight 3:
142.0
Enter weight 4:
166.3
Enter weight 5:
93.0
You entered: 236.00 89.50 142.00...

15.20 Ch 9 Warm up: Parsing strings (C++)
(1) Prompt the user for a string that contains two strings
separated by a comma. (1 pt)
Examples of strings that can be accepted:
Jill, Allen
Jill , Allen
Jill,Allen
Ex:
Enter input string:
Jill, Allen
(2) Report an error if the input string does not contain a comma.
Continue to prompt until a valid string is entered. Note: If
the input contains a comma, then assume that the input also
contains...

Please use Python 3
4). Write a program that asks the user to enter 10 numbers. The
program should store the numbers in a list and then display the
following data:
• The lowest number in the list •
The highest number in the list
•The total of the numbers in the list
• The average of the numbers in the list
Sample input & output:
(Prompt) Enter Number 1: (User enter) 4
(Prompt) Enter Number 2: (User enter) 7...

This is C. Please write it C.
1) Prompt the user to enter a string of their choosing. Store
the text in a string. Output the string. (1 pt)
Ex:
Enter a sample text:
we'll continue our quest in space. there will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. nothing ends here; our hopes and our journeys continue!
You entered: we'll continue our quest in space. there will be...

5.27 LAB*: Program: Soccer team roster (Vectors)
This program will store roster and rating information for a
soccer team. Coaches rate players during tryouts to ensure a
balanced team.
(1) Prompt the user to input five pairs of numbers: A player's
jersey number (0 - 99) and the player's rating (1 - 9). Store the
jersey numbers in one int vector and the ratings in another int
vector. Output these vectors (i.e., output the roster). (3
pts)
Ex:
Enter player...

PLEASE POST IN C++ : Thank you!!
5.27 LAB*: Program: Soccer team roster (Vectors)
This program will store roster and rating information for a
soccer team. Coaches rate players during tryouts to ensure a
balanced team.
(1) Prompt the user to input five pairs of numbers: A player's
jersey number (0 - 99) and the player's rating (1 - 9). Store the
jersey numbers in one int vector and the ratings in another int
vector. Output these vectors (i.e., output...

This program will store roster and rating information for a
soccer team. Coaches rate players during tryouts to ensure a
balanced team.
(1) Prompt the user to input five pairs of numbers: A player's
jersey number (0 - 99) and the player's rating (1 - 9). Store the
jersey numbers in one int vector and the ratings in another int
vector. Output these vectors (i.e., output the roster). (3
pts)
Ex:
Enter player 1's jersey number:
84
Enter player 1's...

x86 irvine library assembly code
Write a complete program that: 1. Prompt the user to enter 10
numbers. 2. save those numbers in a 32-bit integer array. 3. Print
the array with the same order it was entered. 3. Calculate the sum
of the numbers and display it. 4. Calculate the mean of the array
and display it. 5. Rotate the members in the array forward one
position for 9 times. so the last rotation will display the array
in...

USING C++
Topics:
Friend functions
Copy constructor
-----------------------------------------------------------------------------------------------------------------------------------------
Lab 3.1
Create your objects in the stack (not on the heap). Add
a friend function, kilotopound, which will convert kilograms to
pounds. Change your weight mutator to ask whether weight is input
in kilograms or pounds. If it is kilograms, call the friend
function kilotopound to convert it to pounds and return
pounds.
There are 2.2 pounds in one kilogram.
Create an object on the stack with the following
information:
...

1. For each value below, enter the number correct to four
decimal places.
Suppose an arrow is shot upward on the moon with a velocity of 57
m/s, then its height in meters after tt seconds is given by
h(t)=57t−0.83t2h(t)=57t-0.83t2. Find the average velocity over the
given time intervals.
[4, 5]:
[4, 4.5]:
[4, 4.1]:
[4, 4.01]:
[4, 4.001]:
2. A ball is thrown into the air by a baby alien on a planet in
the system of Alpha Centauri...

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 4 minutes ago

asked 8 minutes ago

asked 10 minutes ago

asked 25 minutes ago

asked 35 minutes ago

asked 42 minutes ago

asked 58 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago