![Sariyahhall1](/avatars/42695.jpg)
Sariyahhall1
18.08.2020 •
Computers and Technology
Define stubs for the functions get_user_num() and compute_avg(). Each stub should print "FIXME: Finish function_name()" followed by a newline, and should return -1. Each stub must also contain the function's parameters.
Solved
Show answers
More tips
- A Animals and plants Уход за джунгариками: полезные советы и рекомендации...
- L Legal consultation What Documents Are Required for a Russian Passport?...
- S Sport How to Choose Tennis Rackets?...
- H Health and Medicine AKDS Vaccination: Ensure Your Child s Safety...
- H Health and Medicine Naskol ko Opasen Ukus Kleshcha i Kak Ego Raspoznat...
- C Computers and Internet How to Delete Your Account on Odnoklassniki...
- H Health and Medicine What to Do When Your Jaw Locks Up?...
- G Goods and services What Are the Most Popular Services?...
- P Philosophy How did the concept of module arise in computer science?...
Answers on questions: Computers and Technology
- C Computers and Technology Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?...
- C Computers and Technology // creates a homeworkassignment class// instantiates two objects// and prompts the user for infromation about two coursesusing static system,console; class debugnine1{static...
- C Computers and Technology To ensure that the original value of an argument passed to a method remains unchanged after returning from the method, you should use a reference parameter or an...
- C Computers and Technology What kind of music you guys play...
- B Biology what specific type of asexual reproduction do bacteria perform?...
- C Computers and Technology Create a structure that contains the following data: divisionname first-quartersales second quarter sales third quarter sales fourth quarter sales total sales average...
- E Engineering You are considering the purchase of a heat pump system with aresistive heating element in the air-handler for back-up during the extra cold winter months when the...
- C Chemistry When an ion‑selective electrode for x + was immersed in 0.0518 m xcl , the measured potential was 0.0490 v . what is the concentration of x + when the potential is...
- B Business John works for heinlein hillclimbers in wyoming, where he earns $26,500 annually. he contributes $150 per month to his 401(k), of which his employer matches half...
- B Business The six member countries that have embraced a common market are disappointed with the outcome of their economic integration. they want something that entails a closer...
Ответ:
Following are the code to this question:
def get_user_num():#defining a method
return -1#return value -1
def compute_avg(n1, n2):#defining method compute_avg that accepts two parameters
return -1#return value -1
user_num1 = user_num2= get_user_num()#defining user_num1 and user_num2 variable that calls method get_user_num
avg_result = compute_avg(user_num1, user_num2)#defining avg_result that calls compute_avg method and store its value
print('The average value is:', avg_result)#use print method to call avg_result
Output:
The average value is: -1
Explanation:
In the given python code, two methods "get_user_num and compute_avg" is defined, in which the second method "compute_avg" accepts two parameters that are "n1 and n2", and both methods will return its value, that is "-1".
In the next step, "user_num1 and user_num2" is defined, that calls method "get_user_num" and stores its value, and the variable avg_result is defined, which calls the "compute_avg" method and stores its value and use the print method is defined, that calls its value.
Ответ:
M= 150 (0.85) ^ x where x is the number of months
For sunflowers:
S= 125- 8x
Part B:
after 3 months there are 150 (0.85) ^3 =92 marigolds
after 3 months there are 123- 8*3 =99 sunflowers
PART C:
there are the same number of plants when the 2 functions are equal
So we have 150 (0.85) ^x =125-8x
They come close to being equal after 2 months and after 14 months