Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Macroeconomics Expert

Part 1: Write a function take a file name as a parameter. This function will open the given file for reading and then read each line of the input file and put each line into a list. If the user passes the name of a file that doesn't exist you should catch the exception that is thrown by the open() function and return an empty list. If a valid file name is passed this function will return the list that is created.

Part 2: Write a function that will take a list as a parameter. This list will be the list from the previous function. This function will take each element of that list and calculate the Quarterback rating for each QB in the list. You will want to use the float() function instead of the int() function to convert strings to numbers. For each line you will create a tuple where the first element of the tuple is the Quarterback's name and the second element is the quarterback's Passer rating. You will then place that tuple into a list. This function will return that list. The formula for Passer Rating is as follows:

Part 3: Write a function that will accept a list as a parameter. This list will be the list from the previous function. This function will use the selection sort algorithm that we used earlier in the semester to sort the list according to each quarterback's QB rating. This list will be sorted so that the highest QB rating is at the top instead of the lowest QB rating. Remember, you are sorting the tuples, not JUST the qb ratings. You should end up with a list of tuples that is sorted by QB rating and each tuple will have the name and rating for a quarterback. Remember, since lists are pass by reference you will not need to return the list from this function. Do NOT use built in sorting functions

Macroeconomics, Economics

  • Category:- Macroeconomics
  • Reference No.:- M92048149
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Macroeconomics

Question - someone calculated the future worth of his

Question - Someone calculated the future worth of his investment in term of today's dollars. The obtained result was 945, 895. The life of the investment is expected to be 20 years. The average annual inflation rate alon ...

Question assume an economy is described by the following

Question: Assume an economy is described by the following economic parameters: C = 0.8YD YD = Y + TR - tY TR = 100 t = 0.3 I = 1000 - 65i G = 600 L = 0.25Y - 75i M/P = 600 What is the equation that describes the IS curve ...

Question joe is a thrill seeker and receives utility from

Question: Joe is a thrill seeker and receives utility from working in a risky environment. Assume there are only two types of jobs, riskless and risky. a. Show Joe's reservation price on a graph using indifference curves ...

Question - suppose an economy is described by the following

Question - Suppose an economy is described by the following aggregate demand and short-run aggregate supply curves. The potential level of output is $10 trillion. Aggregate Quantity of Goods and Services Price Level Dema ...

Questions 1 in country faraway cigarettes are forbidden so

Questions: 1. In Country Faraway, cigarettes are forbidden, so people trade cigarettes in a blackmarket. The cigarette demand is QD = 12 - P, and the cigarette supply is Qs = 2P. a. Find the equilibrium price and quantit ...

Question when using ols we assume that the errors are

Question: When using OLS, we assume that the errors are independent (i.e., not serially correlated) and normally distributed with constant variance (i.e., homoscedastic). These assumptions allow us to use the F and t dis ...

Question - recall that the long-run world oil demand

Question - Recall that the long-run world oil demand equation is Upper Q equals 41.6 minus 0.12 Upper PQ=41.6-0.12P and the long-run total oil supply equation is Upper Q equals 26.3 plus 0.071 Upper PQ=26.3+0.071P. The l ...

Question - what do you predict will happen to the foreign

Question - What do you predict will happen to the foreign exchange rate if interest rates in the United States increase dramatically over the next year? Explain, using a graph of the foreign exchange market. How would su ...

Question according to your textbook in the aggregate supply

Question: According to your textbook in the Aggregate Supply (AS) theory an increase in output leads to an increase in the price level. What is the assumed causality? Explain why this should be considered flawed? The res ...

Question - a relatively new aspect to the marketplaces of a

Question - A relatively new aspect to the marketplaces of a number of cities worldwide is something called the sharing economy, in which people rent assets such as cars and rooms directly from each other. Also called a p ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As