Demonstrate what is known as method overloading

Assignment Help Programming Languages
Reference no: EM131299248

Program- Sports Team Stats

This assignment expand on the program shell I have provided in the file sports-team.zip. As discussed in class, the program will use four parallel vectors to hold information regarding games played by a given sports team.

Part I

What you need to complete for this part is spelled out in the comments you will find in the SportsTeam class. There are a total of six methods you need to complete, but two of them are trivial (one line of code).

Note that you will need to use type double variables to compute the average.

Part II

First, add two new methods:

public double getHomeWinLoss(boolean printRequest)

This is much like the getWinLoss (...). The only difference is that it will only consider home games and report accordingly.

public double getAwayWinLoss(boolean printRequest)

This is much like the getWinLoss (...). The only difference is that it will only consider away games and report accordingly.

After you complete the two above methods, add lines to the displayRecord() method to include home and away records in the output.

Next, add one more method:

public double getWinLoss(String oneTeam, boolean printRequest)

This is another getWinLoss (...) method, demonstrating what is known as method overloading. The compiler knows the difference between the two different getWinLoss(...) methods because the parameters are different. This method, given a team name will only consider games played against that team and report accordingly. Include the oneTeam name in a descriptive output line.

First, add a method named displaySummary() that will display 1) The home win/loss record, 2) the away win/loss record, and 3) a list of the win/loss records for every team that has been played. No team should appear in this list twice.

Here's the rub: Your code should not assume that the four team names randomly generated by addRandomGames() are the teams that have been played. For one, perhaps not all of those teams were played, and in addition, addGame(...) could have been used with a new team name.

Attachment:- Sports-Team.zip

Reference no: EM131299248

Questions Cloud

Derive conditional demand for labour and capital : Derive conditional demand for labour and capital. Derive minimized total cost. Derive the equation of firm's expansion path. Draw the expansion path.
How is tylenol''s claim misleading even if true : The makers of Bayer Aspirin, in a reply headlined "Makers of Tylenol, Shame on You!" accused Tylenol of misleading by giving the truth but not the whole truth. You be the detective. How is Tylenol's claim misleading even if true?
Determine the efficiency of the stage : If transistor M2 in Figure has an average current of I0 and an average drainsource voltage of V0, determine the efficiency of the stage. Neglect the on-resistance of M1.
Macroeconomic consequences of a budget deficit : What are the macroeconomic consequences of a budget deficit when the economy is operating at full employment? Be sure to discuss the effects in the short run and long run.
Demonstrate what is known as method overloading : This is another getWinLoss (...) method, demonstrating what is known as method overloading. The compiler knows the difference between the two different getWinLoss(...) methods because the parameters are different.
Does the doherty amplifier of figure operate properly : Does the Doherty amplifier of Figure operate properly if the input is driven by an ideal voltage source? Explain your reasoning.
How many cups of coffee must each person drink every day : Are these numbers plausible? Do some arithmetic to back up your conclusion. Suppose, for example, that the crew is as large as the passenger list. How many cups of coffee must each person drink every day?
Why is situation of wasting resources not really wasteful : it has come to our attention that this is not always the case and thus there is a need to forsake this principle and thus waste resources. Why is this situation of wasting resources not really wasteful?
In the doherty amplifier of figure plot the waveforms : In the Doherty amplifier of Figure, the value of α is chosen equal to 0.5. Plot the waveforms at x = 0 and x = λ/4, assuming Z0 = RL.

Reviews

Write a Review

Programming Languages Questions & Answers

  Identify and discuss the four different dom nodes

Identify and discuss the four different DOM nodes. The properties to be stored should include Make, Model, Year, and Color. Write code that will display these properties using a single alert statement.

  Design a program that will allow a user to input a list

Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who lives in Texas.

  Write program which reads three integer from input dialogs

Write down the program which reads three integer. Integers are entered from input dialogs and stored in variable num1, num2, and num3, respectively.

  Write a program using two-d array to store a user name

Write a program using a 2-D array to store a user name and password (both strings) that will ask the user for his/her user name and then test to see if they are a valid user.

  Implement a menu-driven program for a hardware store

Perform a sales transaction - allow several hardware items to be purchased Remove a sales transaction based on invoice number and Edit a sales transaction by changing the hardware item's barcode and/or quantity purchased

  Implement a program to solve the puzzle problem

In this project you will implement a program to solve the 8-puzzle problem using the A*, IDA* or RBFS algorithm. Your program should be a command line based program reading input from stdin and print results to stdout

  Write a code to swap the letter passed through an array

Write a code to swap the letter passed through an array called letters. With int number of letters. Use must use pointers and pointer arithmetic.

  Write pattern matching statement using a regular expression

Write a pattern matching statement using a regular expression that returns the GI number from the header of a sequence in a FASTA file - Write a Perl program that produces the following output when searching for the word RNA in the paragraph

  Write an application that asks the user to enter hourly wage

Write an application that asks the user to enter the base hourly wage for an employee and then asks the user to enter the number of hours worked for each week in the 4-week pay period.

  Calculator to do the suitable matrix exponentiation

Every company makes particular restrictions for passwords, but employees of ABC have particularly strange restrictions. Their passwords may only consist of the lowercase letters

  Display the contents of the astack in reverse order

Write a pseudocode/function that will delete from an unsorted linked list of integers the node that contains the smaller integer. Can you do this with a single traversal of the list?

  Fortran-77 to sort an array of numbers entered

Write a program in Fortran-77 to sort an array of numbers entered from the keyboard and then using binary search, search for a number in the array.

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