Create an application that calculates the average salary

Assignment Help Programming Languages
Reference no: EM131324324

Assignment

Average Salary of Major League Baseball Players

Create an application that calculates the average and highest salary of Major League Baseball players in 2011 and 2012.

When the user clicks a button, the application reads a csv file (see the attached Salaries.csv) and calculates the average and the highest salary as follows.

Reads each line of the file data using a while loop (start from the second row)

Splits each row by using a delimiter (‘,') into five tokens

Reads year and salary information - they are 1st and 5th tokens and you will need to convert them to integer

Calculates the average and gets the highest.

To calculate the average, you will need to get the sum of the salaries in 2011 and 2012 and then calculate the average after the loop

To get the highest, you will need to declare a variable for the highest salary before the loop and updates the highest salary variable when new salary is greater than the previous highest salary. By doing so, you will be able to get the highest salary at the end of the loop.

After the loop, average and highest salary of each year should be displayed as follows.

Reference no: EM131324324

Questions Cloud

What is the current yield for bond-capital gains yield : Bond P is a premium bond with a coupon rate of 10 percent. Bond D has a coupon rate of 5 percent and is currently selling at a discount. Both bonds make annual payments, have a YTM of 7 percent, and have nine years to maturity. What is the current yi..
Explain the differential shipping rates : Because of the large U.S. trade imbalance with major Asian nations, cargo ships arrive at West Coast seaports fully loaded but return to Asia half to completely empty. Use the concept of opportunity cost to help explain the differential shipping r..
Post the journal entries to general ledger accounts : Using the chart of accounts provided below, and the Excel template provided with this assignment,prepare journal entries, in good form, to record the May transactions. Explanations are optional - Post the journal entries to general ledger accounts.
What is the beta of the resulting portfolio : Stock A has a beta of 0.7, and stock B has a beta of 1.1. You invest 0.2% of your capital in stock A, and the rest in stock B. What is the beta of the resulting portfolio?
Create an application that calculates the average salary : Create an application that calculates the average and highest salary of Major League Baseball players in 2011 and 2012.
What is the enterprise value-ebitda multiple : The market value of the equity of Ginger, Inc., is $740,000. The balance sheet shows $48,000 in cash and $236,500 in debt, while the income statement has EBIT of $105,500 and a total of $171,500 in depreciation and amortization. What is the enterpris..
Who was more responsible for the outbreak of the cold war : Who was more responsible for the outbreak of the cold war between the United States and the Soviet Union:  S. Truman, or Joseph Stalin
What were the perspectives of the workers during strike : What were the perspectives of the workers and management (mainly Carnegie but also Frick) during the Homestead strike? Could Carnegie have compromised on the issues between him and the union? Or was there an irreconcilable conflict which had to be..
Design the interface classes drawable rotatable and sounds : Design the interface classes Drawable, Rotatable, Resizable and Sounds. Compare and contrast abstract classes and interfaces. In what situations would you use an abstract class? in what situations would you use an interface?

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a script in knoppix 4.02

I want the Linux to find the user specified name or Esther asking is this your name or another.

  Write a program that simulates an airplane race

Write a program that simulates an airplane race. The program will display a table showing the speed in km/hour and distance in km traveled by two airplanes every second until one of them has gone 10 kilometers.

  Write program for user to perform arithmetic operations

Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, where a and b are integers and b is not equal to 0.

  Write program which instantiates objects of classes

Private data of Quadrilateral must be the x-y coordinate pairs for four end-points of the Quadrilateral. Write a program which instantiates objects of your classes and outputs each objects area (except Quadrilateral.

  Shows the graphic simulation of the elevator

The elevator could be called from level 2 by the external call button IP0 being pressed. The elevator doors should then close via OP3, once closed IP5 (doors closed sensor) should energise.

  Develop a simple program for inventory system

You have to develop a simple program for an inventory system. You can choose any type of business (ie: Medical supplies, bakery, grocery shop, florist etc.)

  What are application programming interfaces

What are application programming interfaces (APIs)? Identify several APIs that could or do exist in the software developed and maintained by a company for which you currently work or would like to work

  Write a code to locate and rank keywords

You are working on the custom Web application to design document library for client. Write code to locate and rank the keywords. You have been given sample document to use for testing.

  Calculate and display the weight of the object on that body

Calculate and display the weight (N) of the object on that body - Objective Become familiar with the C++ compiler/environment that you plan to use for the programming assignments in this class

  Define procedural or algorithmic programming what is

what is procedural or algorithmic programming? what is object-oriented programming? what is the role of code reuse in

  Sql query to retrieve data

Write SQL query to retrieve data from COURSE table for courses.

  Implicit unsafe type conversions-statements and expressions

Write a report using APA format for references that researches the definition of the language with respect to implicit unsafe type conversions in both assignment statements and expressions.

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