
Examples of hyperinflation can be seen in the countries of Ukraine in the early 1990s and Brazil from 1980 until 1994, where they endured long periods of hyperinflation and their currencies became essentially valueless. It usually occurs when there is a significant increase in money supply with little to no change in gross domestic product. Hyperinflation is excessive inflation that rapidly erodes the real value of a currency. Most developed nations try to sustain an inflation rate of around 2-3% through fiscal and monetary policy. The inflation rate itself is generally conveyed as a percentage increase in prices over 12 months. Theoretically, if additional money is added into an economy, each unit of money in circulation will have less value. Inflation can be artificial in that the authority, such as a central bank, king, or government, can control the supply of the money in circulation. Inflation is defined as a general increase in the prices of goods and services, and a fall in the purchasing power of money. The following is the listing of the historical inflation rate for the United States (U.S.

In the United States, the Bureau of Labor Statistics publishes the Consumer Price Index (CPI) every month, which can be translated into the inflation rate. and many other developed countries, making it a safe assumption. Historically, inflation rates hover around 3% in the U.S. There is also a Forward Flat Rate Inflation Calculator and Backward Flat Rate Inflation Calculator that can be used for theoretical scenarios to determine the inflation-adjusted amounts given an amount that is adjusted based on the number of years and inflation rate. Simply enter an amount and the year it pertains to, followed by the year the inflation-adjusted amount pertains to. to convert the purchasing power of the U.S. The Inflation Calculator utilizes historical Consumer Price Index (CPI) data from the U.S. Related Interest Calculator | Loan Calculator | Investment Calculator from 1914 to 2021.Ĭalculates an inflation based on a certain average inflation rate after some years.Ĭalculates the equivalent purchasing power of an amount some years ago based on a certain average inflation rate. Calculations are based on the average annual CPI data in the U.S. This yield this implementation (notice that only hours break-down calculation changed): def weeklypaycheck(hours, rate):Īnd I would test the boundary conditions like this: for hours in :Īnd the results are: This is your pay: 39.Calculates the equivalent value of the U.S. There is a different way of thinking about this problem, namely, what the min or max hours for each hours break-down.
Over time calc code#
I refactored the code as suggested above to eliminate the duplicate code, used else instead of elif when it made sense, fixed defect for hours = 50, and introduced a dict h to logical group the hours break-down: def weeklypaycheck(hours, rate): If anyone is willing to help me, thank you! My math might be off but I'm very confused. My output is supposed to be This is your pay: 1140 and not This is your pay: 1140. My output is supposed to be This is your pay: 650.0 and not This is your pay: 625.0. '55' is the total hours worked, '10' is how much I get paid per hourĪnd this is my output: This is your pay: 625.0

So when I'm in the shell window and run it. Print("This is your pay: ", nm+ otpay + otpay) The rest of your hours (greater than 50) is paid to you The next 10 hours are overtime and paid to you at 1.5 times your The first 40 hours you work, you get paid your regular hourly wage. This was the instructions given to my teacher.

I also have to account for overtime hours. Make a weekly pay check program that calculates how much you'll get paid. I have an issue with the code I am writing.
