Question

In: Computer Science

Each time Kevin re-reads his Python book (which happens every month), he learns 10% of whatever...

Each time Kevin re-reads his Python book (which happens every month), he learns 10% of whatever material he didn’t know before. He needs to score at least 95% on his final to get an A in the class. When Kevin started, he knew nothing about Python. Write a function getLearningTime(rate, target) that simulates Kevin’s learning progress and returns the number of months it will take him to get ready.

Solutions

Expert Solution

Python code:

#defining getLearningTime function
def getLearningTime(rate,target):
    #initializing notLearned as 100
    notLearned=100
    #initializing number of months as 0
    months=0
    #looping till he have learned atleast upto target
    while((100-notLearned)<=target):
        #incrementing months
        months+=1
        #updating notLearned
        notLearned=notLearned-notLearned*0.1
    #returning months
    return months
#calling getLearningTime time for rate 10 and target 95 and printing result
print(getLearningTime(10,95))


Screenshot:


Output:


Related Solutions

Suppose that Kevin is a 10 years old boy. He is at the mall with his...
Suppose that Kevin is a 10 years old boy. He is at the mall with his mom, and she gives him some money to get food from the food court. At the food court there is a hamburger place, and an ice cream shop. In the following table, I will show you Kevin's Total Utility for each quantity of Hamburgers and ice cream. Hamburgers ($2) Ice Cream ($1) Quantity Total Utility Marginal Utility MU/P Quantity Total Utility Marginal Utility MU/P...
Kevin deposits $1220.33 each quarter into an annuity account for his child's college fund. He wishes...
Kevin deposits $1220.33 each quarter into an annuity account for his child's college fund. He wishes to accumulate a future value of $95,000 in 15 years. Assuming an APR of 3.4%, how much of the $95,000 will Kevin ultimately deposit in the account, and how much is interest earned? Round your answers to the nearest cent, if necessary. Deposit:_______ Interest Earned:_______
Ebenezer Scrooge, in his spare time, happens to be an intelligent and data-driven economist. He tells...
Ebenezer Scrooge, in his spare time, happens to be an intelligent and data-driven economist. He tells you he doesn’t believe in the value of behavioral economic concepts because he’s seen neither data to support them nor real-life, high-stakes examples of their consequences. For each of the following concepts, explain to Ebenezer what sort of experimental or field data could support the need for a behavioral model. (These data can be the result of a hypothetical experiment, the existence of a...
create a python function (only) that generates 10 random numbers within a specific range. Every time...
create a python function (only) that generates 10 random numbers within a specific range. Every time a number is generated, it is appended to a list (you need to initialize a list). Then the function counts how many times a number is repeated in the created list (you can choose any number to count). The function returns the list, the number you have chosen and its count. --define the function here ---
A telephonist claims that he gets 10 calls every five minutes. To demonstrate this to his boss he makes a tape lasting five minutes. What are the probabilities that he gets:
Question 7A telephonist claims that he gets 10 calls every five minutes. To demonstrate this to his boss he makes a tape lasting five minutes. What are the probabilities that he gets:(a) no calls in the five minutes; (2)(b) less than three calls; and (5)(c) exactly 10 calls? (2) [9] Question 8Assume that matric marks are standardised to have a mean of 52% and a standard deviation of 16% (and assume that they have a normal distribution). In a class...
Jeff has a monthly income of $400, which he spends each month on dinners (which cost...
Jeff has a monthly income of $400, which he spends each month on dinners (which cost $20 each) and movies. He finds that he maximizes his utility by spending half his income on dinners and ha lf on movies. His marginal rate of substitution at this bundle of goods is 0.4 (measured with dinners on the horizontal axis). a. Given this information, what is the price of movies? b. Draw Jeff's budget constraint and indifference curve at this optimal bundle....
10-13. Dave Hirsh publishes his own manuscripts and is unsure which of two new printers he...
10-13. Dave Hirsh publishes his own manuscripts and is unsure which of two new printers he should purchase. He is a novelist living in Parkman, Illinois. Having slept through most of his Finance 300 course in college, he is unfamiliar with cash flow analysis. He enlists the help of the finance professor at the local university, Dr. Gwen French, to assist him. Together they estimate the following expected initial investment (a negative cash flow) and net positive cash flows for...
a. A random sample of 10 houses in a particular area, each of which is he ated with natural gas, is selected and the amount of gas (therms) used during the month of January is determined for each house. The resulting observations are
a. A random sample of 10 houses in a particular area, each of which is heated with natural gas, is selected and the amount of gas (therms) used during the month of January is determined for each house. The resulting observations are                        103 156 118 89 125 147 122 109 138 99Let 𝜇 denote the average gas usage during January by all houses in this area. Compute a point estimate of 𝜇b. Suppose there are 10,000 houses in this area...
How much must he save during each of the next 10 years (end-of-year deposits) to meet his retirement goal?
Your father is 50 years old and will retire in 10 years. He expects to live for 25 years after he retires, until he is 85. He wants a fixed retirement income that has the same purchasing power at the time he retires as $60,000 has today. (The real value of his retirement income will decline annually after he retires.) Hisretirement income will begin the day he retires, 10 years from today, at which time he will receive 24 additional...
Farmer Brian has 3 acres of land which he farms efficiently. Each acre can support 10...
Farmer Brian has 3 acres of land which he farms efficiently. Each acre can support 10 apple trees. However the 3 acres differ in their ability to support orange trees. He can grow 60 orange trees on the best land, 40 orange trees on the ok land, and 20 orange trees on the bad land. If he initially is using 2 acres to grow apples, what would be the opportunity cost of growing another orange tree? At first I assumed...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT