Tutor profile: Mohammed H.
Subject: Python Programming
Given the expected and actual payment dates for a credit card, write a function that calculates the fine (if any) for the following fee structure and an APR of 11.9%: 1. If the payment is made before the expected payment date, no fine is charge (i.e. fine = 0) 2. If the payment is made after the expected payment day but within the same calendar month and year as the expected payment date, then fine = $5 * (number of days late) 3. If the payment is made after the expected payment date but within the same calendar year, then including the accumulated interest, fine = 1.119 * (50 * (number of months late)) 4. If the payment is after the calendar year in which it was expected, fine = 1.119 * 500
def calculate_fine(e_day, e_month, e_year , a_day, a_month, a_year): fine = 0 apr = 1.119 if a_year > e_year: return apr * 500 # hard 10000 cash elif a_year == e_year and a_month > e_month: fine = apr * (50 * (a_month - e_month)) elif a_month == e_month and a_day > e_day: fine = 5 * (a_day - e_day) else: return 0 return fine
What is the nature of existence itself?
Many philosophers have sought to answer this question, from varying different perspectives. The ancients, divided into the Pre-Socratics and Socratics generally sought to answer this question by dividing the world into material and immaterial components, which informs the mind-body distinction of modern metaphysics today. After thousands of years of technological advancement, in modern times, this metaphysical question is more easily considered from the German idealist, that is Continental and Analytic traditions of modern Philosophy. Here, the question becomes a "matter" of whether we wish to "know" about a mind-independent reality or believe all that is necessary, or perhaps all that exists is within the mind - the classic distinction between the modern "realist" and "idealist" metaphysicists. Although there are no easy answers in philosophy, I will provide a short description of what I consider to be the most interesting conclusion. With the insights of phenomenology, I believe that although there may be nothing other than our own innate experience that we have access to and to some extent this constitutes our own reality, the question of whether there is "another" reality is moot, because our own consciousness is not singular. If the nature of existence is the mind, then we might be able to explain our own ignorance about the universe and the limits of empiricism and science that we cannot even begin to understand in a deterministic formulation of mind-independent reality. And an acknowledgement of mind or consciousness as inherently rooted in existence does not necessarily indicate that all things possess a mind, but rather the subject-objects of reality itself (our mind) are always influenced dialectically by the environments in which we are immersed.
Ethan wants to buy apples from John, who is selling them for $0.50 per apple. But Mikayla says she has a better deal and that Ethan should instead by from her at the price of $0.75 per apple, with the special offer of every two apples he buys, Ethan gets a third one free. John, not wanting Mikayla to poach his customer, counters with a last offer, and says he'll offer a $3 discount if Ethan buys at least 15 apples from him. How many apples does Ethan need to buy before John's deal is better than Mikayla's?
Initially this problem is a simple system of equations where we have to create an equation that represents how much it costs to buy apples from either John or Mikayla and then set them both equal to each other. We can represent John's equation as 0.5x = y. Similarly, we can begin to make Mikayla's equation by first writing 0.75x = y, but the special offer is more difficult at first. If we rephrase it, however, as just buying three apples for the price of two apples, which is the same, we can multiply this cost into the equation like so. (2/3)(0.75x) = y, or when simplified 0.5x = y. Hmmm, maybe Mikayla and John are now offering the same price? Finally, we have to account for John's last offer, that the price be discounted by $3 if Ethan buys at least 15 from him. From the equations, we know 0.5x = 0.5x, or that for the first 15 apples, Mikayla and John have the same price for apples. So regardless of what the discount is, John's deal is better if Ethan buys at least 16 apples, otherwise the prices are the same.