Question

In: Computer Science

Chapter 6, Starting out with Programming and Logic, 4th Edition, Page 265 #6 Kinetic Energy In...

Chapter 6, Starting out with Programming and Logic, 4th Edition, Page 265 #6 Kinetic Energy

In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:

KE=12mv2

The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity, in meters per second. Design a function named kineticEnergy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Design a program that asks the user to enter values for mass and velocity, and then calls the kineticEnergy function to get the object’s kinetic energy. PLEASE CREATE A FLOWCHART USING FLOWGORITHM. PLEASE PROVIDE SCREENSHOTS OF FLOWCHART AND TEST RUN.

Solutions

Expert Solution

Answer:

Here is the python code as per your requirment

Raw code:

def kineticEnergy(m,v):

'''

KE is the kinetic energy,

m is the object’s mass in kilograms,

v is the object’s velocity, in meters per second.

'''

KE=1/2*(m*v*v)

#returning the kinetic enerty

return KE

#main

def main():

#asking the mass and velocity to user

mass=float(input("Enter the mass(kgs): "))

velocity=float(input("Enter the velocity(mts): "))

#printing the output

print(kineticEnergy(mass,velocity))

#calling main function

main()


Raw code:

ouptut:

Hope this helps you! If you still have any doubts or queries please feel free to comment in the comment section.

"Please refer to the screenshot of the code to understand the indentation of the code".

Thank you! Do upvote.


Related Solutions

'an inside look' article page 118-119 chapter 4, essentials of economics 4th edition, Thinking critically question...
'an inside look' article page 118-119 chapter 4, essentials of economics 4th edition, Thinking critically question 1.The article implies that the demand for alcopops is price elastic due to the availability of substitutes, such as alcoholic cider. Can we infer that the demand for all alcoholic drinks is also price elastic? Explain. 2.Given your response to question 1, do you think that taxing the sales of alcoholic drinks is an effective policy to reduce alcohol abuse? Explain why or why...
Python Programming 4th edition: Write a program that asks the user for the number of hours...
Python Programming 4th edition: Write a program that asks the user for the number of hours (float) and the pay rate (float) for employee pay role sheet. The program should display the gross pay with overtime if any and without overtime. Hints: Given base_hr as 40 and ovt_multiplier as1.5, calculate the gross pay with and Without overtime. The output should look like as follows: Enter the number of hours worked: Enter the hourly pay rate: The gross pay is $XXX.XX
Starting Out with Java (6th Edition) chapter 8, 3PC Requirement: Each of the RoomCarpet and RoomDimension...
Starting Out with Java (6th Edition) chapter 8, 3PC Requirement: Each of the RoomCarpet and RoomDimension classes should have a toString method, an equals method, a copy method, and a copy constructor. The RoomCarpet class should have mutators and accessors for both of its fields.
Java Programming 5th edition Chapter 10 Inheritance Programs Part 1 Number 3 on page 719 which...
Java Programming 5th edition Chapter 10 Inheritance Programs Part 1 Number 3 on page 719 which creates a Point class with 2 instance variables; the xCoordinate and yCoordinate. It should have a default constructor and a values constructor. Also include a set method that sets both attributes, a get method for each attribute, and a method that redefines toString() to print the attributes as follows. point: (x, y) Part 2 Do number 4 on page 719 which creates a Circle...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management...
Using the Chapter 7 - User Guide to the PMBOK 4th edition - Project Cost Management course material as a guide and the Earned Value (EV) formulas described in the example problem, answer the questions below by showing your calculations and solutions for each project parameter. Our 6-month project example is described as follows: Total Hours of Work:  1,100 Hours Cost per Hour:  $185 per hour Project cost at end of month three: $110,000 Estimated work complete at end of month three:...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that...
guide to unix using linux / 4th edition / chapter 2 / p10 2.10 Assume that you work for a company that is developing a telephone database and you are creating directories for the Mail and Receiving Departments, which are referenced in the company’s budget and accounting systems as departments 4540 and 4550. After you create the directories, you begin creating files of department phone numbers to store in those directories. You must use the mkdir (make directory) command to...
Please refer to the question from textbook Stats: Data and Models 4th Edition, Chapter 4, Exercises,...
Please refer to the question from textbook Stats: Data and Models 4th Edition, Chapter 4, Exercises, Section 4.5 Chapter exercises #22 Camp Sites, part (b): How many parks would you classify as outliers ? Explain
Cognitive Psychology: Applying The Science of the Mind (4th Edition) Chapter 10 Discussion Question: What do...
Cognitive Psychology: Applying The Science of the Mind (4th Edition) Chapter 10 Discussion Question: What do you think is the most important factor in communicating through your writing? Think of the comments you get from professors, or the problems you seem to have in writing. Do they map onto any of the factors you've read about? Here's an example of one of my classmate response.... I feel that with writing being such a common way of communicating it is important...
Python Programming 4th Edition: Write Boolean expression: 1)A currently have a different value than B 2)...
Python Programming 4th Edition: Write Boolean expression: 1)A currently have a different value than B 2) B less than the sum of the current values of A and C 3)C is no more than 15. 4) 75 is between the values of integers A and B 5) Number N is divisible by 2 or it is divisible by 3. 6) X is positive and Y is positive
Elementary Principles of Chemical Engineering, 4th edition, Chapter 4, question 20 a 100 km/hr stream that...
Elementary Principles of Chemical Engineering, 4th edition, Chapter 4, question 20 a 100 km/hr stream that is 97 % mole carbon tetrachloride CCl4 and 3 % carbon disulfide CS2 is to be recovered from the bottom of a distillation column. the feed to the column is 16 mole% CS2 and 84% CCl4, and 2% of the CCl4 entering the column is contained in the overhead stream leaving the top of the column. A) draw and label a flowchart of the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT