Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Programming Question:Data collections Projectiles. Write a program that has the user enter information on some projectiles: the name, mass mm in kg, and velocity

Python Programming Question:Data collections

Projectiles. Write a program that has the user enter information on some projectiles: the name, mass mm in kg, and velocity vv in m/s of each. This should be done using a loop-and-a-half construct; the projectiles should be saved in a list (each projectile itself being a list of the name, mass, and velocity). For example, the list might be [ ["A", 15, 23], ["B", 20, 0], ["C", 18, 15] ] (three particles called A, B, and C; A's mass and velocity are 15 kg and 23 m/s, and so on) this is similar to how the movie collection lecture example stores movies. Once all the points are entered, you should display:

all the particles, sorted by mass (most massive particles first);

all the particles, sorted by velocity (fastest particles first);

all the particles, sorted by kinetic energy (calculated as Ek=12mv2Ek=12mv2 the units are Joules (J)). (For this you'll make a function that takes a projectile as parameter a list of name, mass, and velocity and returns the kinetic energy, then use that as the key in a sort().)

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

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

How does stress affect responsiveness to vaccinations?

Answered: 1 week ago

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago