Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python creating modules:work and power This is a previous code using functions: NOTE: Make sure and include comments in your program. At a minimum

Using python creating modules:work and power
image text in transcribed
This is a previous code using functions:
image text in transcribed
NOTE: Make sure and include comments in your program. At a minimum it should include the author's name and a short program description. You will lose points if you have no comments. Rewrite your previous code that uses Functions to calculate the work in Joules) and power in Watts and in Horse Power) of an individual running up stairs, and create a module for these functions. The user should entered in their mass (in kg), height of stairs (in m), time (in seconds) took to go upstairs. This program should ensure that the user enters numbers above zero. You may use the Error Handling code from CSC 1613 to change into a program that references a module.You do not have to use Error Handling but you can. Formulas: power (in Watts) = wor work (in Joules (J)) = Force x distance Force going up (in Newtons (N) ie Acceleration = 9.8 1 Horse Power = 746 Watts 2.205 lbs = 1 kg This program uses functions to calculate teh work and power of an individual running up stairs. mass=float(input("Mass (in KG):)) #input from the user mass in KG height=float(input("Height of stairs(in m):)) #input the user height in m t=float(input("Time (in Second):)) #input from the user time in sec def calc_power (mass, height,t): #function for calculating power g=9.8 #acceleration 9.8 force=masseg #force=mass * acceleration work=force height #work=force distance power=work/t #power=work/time taken return power if mass

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

6. Have you used solid reasoning in your argument?

Answered: 1 week ago