Question: Intro to computer programming: Python Programming Question: Projectiles. Write a program that has the user enter information on some projectiles: the name, mass mm in

Intro to computer programming: Python Programming Question:

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!