Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function name (1): weight_on_mars Parameters: N/A Return value: N/A Description: Write a Python program which accepts you weight on Earth and prints out your weight

image text in transcribed
Function name (1): weight_on_mars Parameters: N/A Return value: N/A Description: Write a Python program which accepts you weight on Earth and prints out your weight on Mars. Assume that the weight inputted is not negative. The weight can be 1. Ask the user to input their weight on Earth in pounds. 2. Your weight on Mars is 0.38 of your weight on Earth. For example. If you weight 100 pounds on Earth, you would weigh 38 pounds on Mars. 3. Print out the answer in the format: "At a weight of 100 pounds on Earth, you would weigh 38 pounds on Mars". Test Cases (not an exhaustive list): 1. > > > What is your weight on Earth (in pounds)? 150 At a weight of 150 pounds on Earth, you would weigh 57 pounds on Mars. 2. > > > What is your weight on Earth (in pounds)? 100.8 At a weight of 180.8 pounds on Earth, you would weigh 38.304 pounds on Mars. Function name (2): volume_of_cone Parameters: N/A Return value: volume of the cone Description: Write a function that that takes the radius and height from the user and calculates the volume of a cone. 1. Get the length of the radius of the cone from the user. 2. Got the height of no cone from the user. 3. Calculate the volume of a cone with the radius length and height entered by the user using the following formula: Volume = pi middot radius^2 middot height/3 4. Return the volume of the cone rounded to three decimal places. Test Cases (not an exhaustive list): 1. > > > a = volume_of_cone () > > > What is the length of the radius of the cone? 3 > > > What is the height of the cone? 4 > > > print (a) 37.699 2. > > > b = volume_of_cone () > > > What is the length of the radius of the cone? HOMEWORK 01: FUNCTIONS & STATEMENTS 4 2. > > > b = volume_of_cone() > > > What is the length of the radius of the cone

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

What are some of the hiring standards to avoid?

Answered: 1 week ago