In [ ]: Exercise 2b Write code to calculate and print the quantities from the data sheet. For the momenta pli, p2i plf and p2f, the code is given. For the other quantities, uncomment the respective code lines and add your code. You must use the given variable names. In the print() statements, use "f-strings" to print your calculated values with proper units. Again, follow the example for pli. pli ml*vli p2i= m2*v2i print (f'Momentum of m1 before print (f'Momentum of m2 before plf m1*vlf p2f = m2*v2f print (f'Momentum of m1 after print (f'Momentum of m2 after #pi = # pf = #p_ratio= #print () # print () #print () # Kli = # K2i = # print () #print () #K1f = # K2f = #print () # print () #Ki = #Kf = #K_ratio= #print () # print () # print () #YOUR CODE HERE raise Not ImplementedError() # Momentum of m before collision # Momentum of M before collision collision: collision: {pli:ep} kg.m/s') (p2i: eP) kg.m/s') # Momentum of m after collision # Momentum of M after collision collision: collision: {plf: eP} kg-m/s') {p2f:eP) kg.m/s') #Total momentum before collision #Total momentum after collision #Ratio of total momentum after/before collision #Print your calculated values # Kinetic energy of m1 before collision #Kinetic energy of m2 before collision # Kinetic energy of m1 after collision #Kinetic energy of m2 after collision #Total kinetic energy before collision #Total kinetic energy after collision #Ratio of total kinetic energy after/before collision
In [ ]: Exercise 2b Write code to calculate and print the quantities from the data sheet. For the momenta pli, p2i plf and p2f, the code is given. For the other quantities, uncomment the respective code lines and add your code. You must use the given variable names. In the print() statements, use "f-strings" to print your calculated values with proper units. Again, follow the example for pli. pli ml*vli p2i= m2*v2i print (f'Momentum of m1 before print (f'Momentum of m2 before plf m1*vlf p2f = m2*v2f print (f'Momentum of m1 after print (f'Momentum of m2 after #pi = # pf = #p_ratio= #print () # print () #print () # Kli = # K2i = # print () #print () #K1f = # K2f = #print () # print () #Ki = #Kf = #K_ratio= #print () # print () # print () #YOUR CODE HERE raise Not ImplementedError() # Momentum of m before collision # Momentum of M before collision collision: collision: {pli:ep} kg.m/s') (p2i: eP) kg.m/s') # Momentum of m after collision # Momentum of M after collision collision: collision: {plf: eP} kg-m/s') {p2f:eP) kg.m/s') #Total momentum before collision #Total momentum after collision #Ratio of total momentum after/before collision #Print your calculated values # Kinetic energy of m1 before collision #Kinetic energy of m2 before collision # Kinetic energy of m1 after collision #Kinetic energy of m2 after collision #Total kinetic energy before collision #Total kinetic energy after collision #Ratio of total kinetic energy after/before collision
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![In [ ]:
Exercise 2b
Write code to calculate and print the quantities from the data sheet. For the momenta pli, p2i plf and p2f, the code is given. For the other
quantities, uncomment the respective code lines and add your code. You must use the given variable names.
In the print() statements, use "f-strings" to print your calculated values with proper units. Again, follow the example for pli.
pli m1*vli
p2i = m2*v2i
print (f'Momentum of m1 before
print (f'Momentum of m2 before
plf = m1*vlf
p2f = m2*v2f
print (f'Momentum of m1 after
print (f'Momentum of m2 after
#pi
#pf
=
=
#p_ratio=
#print()
#print ()
#print ()
# Kli =
#K2i =
#print ()
#print()
# Klf =
#K2f =
#print()
#print()
#Ki =
# Kf =
#K_ratio=
#print()
#print()
#print()
#YOUR CODE HERE
raise Not ImplementedError()
# Momentum of m before collision
# Momentum of M before collision
collision:
collision:
{pli:eP} kg•m/s')
{p2i: eP} kg•m/s')
# Momentum of m after collision
# Momentum of M after collision
collision:
collision:
{plf:eP} kg•m/s')
{p2f: eP} kg•m/s')
# Total momentum before collision
# Total momentum after collision
# Ratio of total momentum after/before collision
#Print your calculated values
# Kinetic energy of m1 before collision
# Kinetic energy of m2 before collision
#Kinetic energy of m1 after collision
# Kinetic energy of m2 after collision
#Total kinetic energy before collision
#Total kinetic energy after collision
# Ratio of total kinetic energy after/before collision](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff0fdd9be-9990-44a9-8005-60989cbb2f12%2Feef449b8-0608-4e3c-8267-fa58238a1972%2Fr6fqjzw_processed.png&w=3840&q=75)
Transcribed Image Text:In [ ]:
Exercise 2b
Write code to calculate and print the quantities from the data sheet. For the momenta pli, p2i plf and p2f, the code is given. For the other
quantities, uncomment the respective code lines and add your code. You must use the given variable names.
In the print() statements, use "f-strings" to print your calculated values with proper units. Again, follow the example for pli.
pli m1*vli
p2i = m2*v2i
print (f'Momentum of m1 before
print (f'Momentum of m2 before
plf = m1*vlf
p2f = m2*v2f
print (f'Momentum of m1 after
print (f'Momentum of m2 after
#pi
#pf
=
=
#p_ratio=
#print()
#print ()
#print ()
# Kli =
#K2i =
#print ()
#print()
# Klf =
#K2f =
#print()
#print()
#Ki =
# Kf =
#K_ratio=
#print()
#print()
#print()
#YOUR CODE HERE
raise Not ImplementedError()
# Momentum of m before collision
# Momentum of M before collision
collision:
collision:
{pli:eP} kg•m/s')
{p2i: eP} kg•m/s')
# Momentum of m after collision
# Momentum of M after collision
collision:
collision:
{plf:eP} kg•m/s')
{p2f: eP} kg•m/s')
# Total momentum before collision
# Total momentum after collision
# Ratio of total momentum after/before collision
#Print your calculated values
# Kinetic energy of m1 before collision
# Kinetic energy of m2 before collision
#Kinetic energy of m1 after collision
# Kinetic energy of m2 after collision
#Total kinetic energy before collision
#Total kinetic energy after collision
# Ratio of total kinetic energy after/before collision
Expert Solution

Step 1: Algorithm of the pogram:
Algorithm:
- Define the masses (m1 and m2), initial velocities (v1i and v2i), and final velocity (vlf) for two objects.
- Calculate the momentum of each object before and after the collision using the formula:
- Calculate the total momentum before and after the collision.
- Calculate the kinetic energy of each object before and after the collision using the formula:
- Calculate the total kinetic energy before and after the collision.
- Print the calculated values for momentum and kinetic energy along with the respective ratios.
Step by step
Solved in 4 steps with 5 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education