Write a function that will accept a list as a parameter

Assignment Help Macroeconomics
Reference no: EM131293485

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

Reference no: EM131293485

Questions Cloud

Identify the actions the organization is taking : Identify the actions the organization is taking, or identify three action-item issues to be addressed by health care organizations in general.
Emulate expanded memory : Give the DOS driver that is used to emulate expanded memory.
Perform the data mining tutorial in sql server data : Use the following link to perform the Data Mining tutorial in SQL Server Data Tools (SSDT) for SQL Server 2014: https://technet.microsoft.com/en-us/library/ms167167(v=sql.120).aspx. Use AdventureWorks 2014 Data Warehouse Database.
Enterprise-wide knowledge management systems : Identify a web link to an existing technology for each of the following categories and provide a description of each system you found that includes an explanation or example of what it does:
Write a function that will accept a list as a parameter : 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..
Find an article about a firms current use of it : Find an article about a firm's current use of IT to enhance its customer's experience or select a firm you are familiar with in your country.
Describe effective methods of conflict resolution : Describe both verbal and nonverbal management communication. Describe effective methods of conflict resolution. Analyze techniques for leading teams and group meetings.
What the lessons of terror are for the us : What the lessons of terror are for the U.S. and which lessons are the most important in developing effective anti-terrorism policies? Give an example.
Toward reference models for requirements traceability : You need to summarize articles - Toward Reference Models for Requirements Traceability

Reviews

Write a Review

Macroeconomics Questions & Answers

  You are a manager in a perfectly competitive market

You are a manager in a perfectly competitive market. The price in your market is $14. Your total cost function is C(Q)= 10 + 4Q + .5q(squared). What is your max profit in the short run?

  Which are identical in every characteristic

A corporate bond rated AAA with the same time to maturity as bond Y that trades in a more liquid market than bonds W, X, or Y List the bonds in the most likely order of the interest rates (yields to maturity) of the bonds from highest to lowest.

  Explain how does your organization go about estimating

Explain how does your organization go about estimating its sales. How does it estimate the demand for new products so that it can prepare a production run.

  What is the equilibrium price and quantity in this market

Assume that incomes of the consumers in this market increases. What would happen in this market? Explain your answer and reconstruct the graph developed in question one to show this change.

  International drilling company segments its foreign markets

International Drilling Company segments its foreign markets by the income levels of a country's population. This firm segments on what basis?

  Question on opportunity cost

Think about the trade off in work and leisure during a given day, and from day to day. During a given day, does opportunity cost of work rise, decline, or remain constant with each additional hour of work?

  Explain several significant points

Explain several significant points that can be raised about economic goals in terms of definition, complementarity, tradeoffs, and priorities.

  How would youl manipulate fiscal policy to improve economy

Miller, R.L. (2012). Economics Today, 16ed. Addison-Wesley. p. 295. In today's economy what fiscal policies would you implement? Right now our economy is in a recession, as a Keynesain Economist, how would youl manipulate fiscal policy to improve ..

  Career development system

What are the individual and organizational benefits of a formalized career development system?

  Calculate the annual worth of merchant truckingcompany cash

Calculate the annual worth (years 1 through 7) of Merchant TruckingCompany's cash flow. Use an interest rate of 10% peryear. Year 0 1 2 3 4 5 6 7  Cash Flow, $ millions 450 -40 200 200 200 200 200 200

  What is the equilibrium wage rate in an unregulated market

What is the equilibrium wage rate in an unregulated market? Determining the comparative advantage of a country requires that you look at the economic notion of.

  Describe the idea of trade offs cost also benefit analysis

Describe the idea of trade offs cost also benefit analysis when answering the above question.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd