Question: Steps for Do not use any functions or statements that have not been covered in class! TASKS ( 5 pts ) Write a function called

Steps for
Do not use any functions or statements that have not been covered in class!
TASKS
(5 pts) Write a function called ab_val () that returns the absolute value of a number. Do not
use the built-in absolute value function from the math library.
Signature:
def ab val(x):
#your code
return
(4 pts) Write a function called circ_calc () that returns the specified measure of a shape
from two parameters: the radius and the measure sought. Round your answers to the nearest
thousandth. Use =3.14159.
'c'- circumference (2r)
'a'- area using (r2)
,'v'- volume of a sphere (43)(r3)
If the measure parameter is not any of these, return-1.
Signature:
def circ_calc(radius, shape):
#your code
return (5,?'c')31.416a,bc(a,b,c):(1,0,-9)
(7 pts) Write a function called stock_advice () that determines what to do with a particular
stock from its purchase price and its current price. The first parameter is the purchase price and
the second is the current price.
The advice is "BUY" when the stock is up more than 30%.
The advice is "SELL" when the stock is down more than 50%.
For a stock that isn't changing very much (up more than 30 or down less than 50%), the
response should be "HOLD".
Signature:
def stock_advice (start_price, end_price):
#your, code
return
Do not use any functions or statements that have not been covered in class!
TASKS
(5 pts) Write a function called ab_val () that returns the absolute value of a number. Do not
use the built-in absolute value function from the math library.
Signature:
def ab_val (x) :
#your code
return 5abval(-3.55)3.55
(4 pts) Write a function called circ_calc () that returns the specified measure of a shape
from two parameters: the radius and the measure sought. Round your answers to the nearest
thousandth. Use =3.14159.
'c'- circumference (2r)
'a'- area using (r2)
'v'- volume of a sphere (43)(r3)
If the measure parameter is not any of these, return -1.
Signature:
def circ_calc(radius, shape):
#your code
return 31.416a,bc(a,b,c)(1,0,-9)
(7 pts) Write a function called stock_advice () that determines what to do with a particular
stock from its purchase price and its current price. The first parameter is the purchase price and
the second is the current price.
The advice is "BUY" when the stock is up more than 30%.
The advice is "SELL" when the stock is down more than 50%.
For a stock that isn't changing very much (up more than 30 or down less than 50%), the
response should be "HOLD".
Signature:
def stock_advice (start_price, end_price):
#your code
return
A player needs to have more than a hundred times the next level's number in order to
level-up.
Signature:
def level_up(points, level):
#your code
return (435,2)(555,8)(h1,m1,h2,m2):
(10 pts) Write a function called minutes_passed () that determines the number of minutes
between a start time and an end time. The function takes four parameters representing the
hour and minutes for the start time and the hour and minutes of the end time.
Signature:
def minutes_passed(h1,m1,h2,m2):
#your code
#return (10,59,12,11)72(4,38,2,2)150
minutespassed (10,59,12,11)72
minutespassed (4,38,2,2)
Steps for Do not use any functions or statements

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 Programming Questions!