SlideShare a Scribd company logo
sports-team/package.bluej
#BlueJ package file
objectbench.height=76
objectbench.width=667
package.editor.height=427
package.editor.width=559
package.editor.x=39
package.editor.y=155
package.numDependencies=0
package.numTargets=1
package.showExtends=true
package.showUses=true
project.charset=UTF-8
target1.editor.height=700
target1.editor.width=1075
target1.editor.x=175
target1.editor.y=86
target1.height=50
target1.name=SportsTeam
target1.naviview.expanded=true
target1.showInterface=false
target1.type=ClassTarget
target1.typeParameters=
target1.width=90
target1.x=70
target1.y=10
__MACOSX/sports-team/._package.bluej
sports-team/README.TXT
------------------------------------------------------------------------
This is the project README file. Here, you should describe
your project.
Tell the reader (someone who does not know anything about this
project)
all he/she needs to know. The comments should usually include
at least:
------------------------------------------------------------------------
PROJECT TITLE:
PURPOSE OF PROJECT:
VERSION or DATE:
HOW TO START THIS PROJECT:
AUTHORS:
USER INSTRUCTIONS:
__MACOSX/sports-team/._README.TXT
sports-team/SportsTeam.classpublicsynchronizedclass
SportsTeam {
private java.util.Vector opponent;
private java.util.Vector home;
private java.util.Vector teamPoints;
private java.util.Vector oppPoints;
private String teamName;
private String sportName;
public void SportsTeam();
public void changeSport(String);
public void changeName(String);
public void addGame(String, boolean, int, int);
public void updateGame(int, String, boolean, int, int);
public double getWinLoss(boolean);
public void displayRecord();
public void addRandomGames(int, int);
}
__MACOSX/sports-team/._SportsTeam.class
sports-team/SportsTeam.ctxt
#BlueJ class context
comment0.params=
comment0.target=SportsTeam()
comment0.text=rn Constructor for objects of class
SportsTeamrn
comment1.params=newSport
comment1.target=void changeSport(java.lang.String)
comment1.text=rn Method to change sport. rn
comment2.params=newName
comment2.target=void changeName(java.lang.String)
comment2.text=rn Method to change team name. rn
comment3.params=otherTeam homeGame ourPoints
theirPoints
comment3.target=void addGame(java.lang.String, boolean,
int, int)
comment3.text=rn Method to add a new game. Attempts
to add a game with either score negativern should be
rejected with an error message in the terminal
wondow.rn
comment4.params=position otherTeam homeGame ourPoints
theirPoints
comment4.target=void updateGame(int, java.lang.String,
boolean, int, int)
comment4.text=rn Method to update data for a game
that wwas entered in error. The game data at the
positionrn provided will be replaced with the data
provided. Aagin, negative scores should be rjected rn
with an error message, as should any invalid position.rn
comment5.params=printRequested
comment5.target=double getWinLoss(boolean)
comment5.text=rn When this method is called, the
win/loss poercentage for the team will always be
computed rn and returned.rn rn In addition, if the
printRequested parameter is true, team's overall win-loss
record rn should be displayed in the terminal window
in the following format: rn       Win-Loss Record:
games_won-games_lost (% won)rn       rn 
Example:rn       Win-Loss Record: 38-26
(59.375%)rn
comment6.params=
comment6.target=void displayRecord()
comment6.text=rn Dpisplay the team's current record,
one line per game. Each line should begin with fourrn
spaces, then display the following: the game number
followed by a colon, the opposing rn team name (with
"@" proceeding the name for away games), "W" or "L"
indicating win or rn loss, and the score of each team,
separated by a hyphen. NOTE: The home team score is
rn always dosplayed last. After all games are displayed,
the win-loss record should be rn displayed. (Call the
method above to include this.)rn rn Here is an
example:rn rn Record for the Greens baseball
team:rn     0: @Flyers L 5-7rn     1: Raiders W
2-7rn     2: Vikings W 5-6rn     3: @Cardinals
W 5-3rn     Win-loss Record: 3-1 (75.0%)rn rn
comment7.params=numGames maxScore
comment7.target=void addRandomGames(int, int)
comment7.text=rn Create ramdom simulated game data
for the team. Parameters are used to specify the
nuimberrn of games to generate and the maximum score
expected in each game (as this would vary byrn
sport.rn
numComments=8
__MACOSX/sports-team/._SportsTeam.ctxt
sports-team/SportsTeam.javasports-
team/SportsTeam.javaimport java.util.*;
/**
* A SportsTeam object will track the record of a sports team, u
sing several "paralell
* vectors". For each of these vectors, position i will contain the
information for
* the ith game played by the team. Those vectors are:
*
* opponent - Contains the name of the opposing team.
* home -
Is true if the game is a home game, false if the game is an away
game.
* teamPoints - The number of points acored by the team.
* oppPoints -
The number of points scored by the opposing team.
*
* @author (your name)
* @version (a version number or a date)
*/
publicclassSportsTeam
{
// These vectors will be used to track games. For each, position
i will contain
// the information for game i;
privateVector<String> opponent;
privateVector<Boolean> home;
privateVector<Integer> teamPoints;
privateVector<Integer> oppPoints;
// Fields to hold name of team and sport.
privateString teamName;
privateString sportName;
/**
* Constructor for objects of class SportsTeam
*/
publicSportsTeam()
{
// Create all the vectors.
opponent =newVector<String>();
home =newVector<Boolean>();
teamPoints =newVector<Integer>();
oppPoints =newVector<Integer>();
// Default team name and sport.
teamName ="Greens";
sportName ="baseball";
}
/**
* Method to change sport.
*/
publicvoid changeSport(String newSport)
{
// Your code goes here.
}
/**
* Method to change team name.
*/
publicvoid changeName(String newName)
{
// Your code goes here.
}
/**
* Method to add a new game. Attempts to add a game with ei
ther score negative
* should be rejected with an error message in the terminal w
ondow.
*/
publicvoid addGame(String otherTeam,boolean homeGame,int o
urPoints,int theirPoints)
{
// Your code goes here.
}
/**
* Method to update data for a game that wwas entered in err
or. The game data at the position
* provided will be replaced with the data provided. Aagin, n
egative scores should be rjected
* with an error message, as should any invalid position.
*/
publicvoid updateGame(int position,String otherTeam,boolean h
omeGame,int ourPoints,int theirPoints)
{
// Your code goes here.
}
/**
* When this method is called, the win/loss poercentage for t
he team will always be computed
* and returned.
*
* In addition, if the printRequested parameter is true, team's
overall win-loss record
* should be displayed in the terminal window in the followin
g format:
* Win-Loss Record: games_won-games_lost (% won)
*
* Example:
* Win-Loss Record: 38-26 (59.375%)
*/
publicdouble getWinLoss(boolean printRequested)
{
// Your code goes here. (The line below will be replaced.)
return0.0;
}
/*
* Dpisplay the team's current record, one line per game. Eac
h line should begin with four
* spaces, then display the following: the game number follo
wed by a colon, the opposing
* team name (with "@" proceeding the name for away games
), "W" or "L" indicating win or
* loss, and the score of each team, separated by a hyphen. N
OTE: The home team score is
* always dosplayed last. After all games are displayed, the w
in-loss record should be
* displayed. (Call the method above to include this.)
*
* Here is an example:
*
* Record for the Greens baseball team:
* 0: @Flyers L 5-7
* 1: Raiders W 2-7
* 2: Vikings W 5-6
* 3: @Cardinals W 5-3
* Win-loss Record: 3-1 (75.0%)
*
*/
publicvoid displayRecord()
{
// Display heading.
System.out.println("Record for the "+teamName+" "+sportName
+" team:");
// Your code goes here.
}
/**
* Create ramdom simulated game data for the team. Paramet
ers are used to specify the nuimber
* of games to generate and the maximum score expected in e
ach game (as this would vary by
* sport.
*/
publicvoid addRandomGames(int numGames,int maxScore)
{
String[] teams ={"Flyers","Raiders","Vikings","Cardinals"};
boolean[] trueFalse ={true,false};
int i, pos1, pos2, score1, score2;
System.out.println("Adding the following games:");
for(i=0; i<numGames; i++)
{
pos1 =(int)(Math.random()*4);
pos2 =(int)(Math.random()*2);
score1 =(int)(Math.random()*(maxScore+1));
score2 = score1;
while(score2 == score1)
score2 =(int)(Math.random()*(maxScore+1));
System.out.println(" "+teams[pos1]+" "+trueFalse[pos2]+" "+
score1+" "+score2);
addGame(teams[pos1], trueFalse[pos2], score1, score2);
}
}
}
__MACOSX/sports-team/._SportsTeam.java
__MACOSX/._sports-team
sports-teampackage.bluej#BlueJ package fileobjectbench.heig.docx

More Related Content

Similar to sports-teampackage.bluej#BlueJ package fileobjectbench.heig.docx

C++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdfC++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdf
ezzi97
 
Python find ajacent symbols recursively
Python find ajacent symbols recursivelyPython find ajacent symbols recursively
Python find ajacent symbols recursively
Christopher A Thomas
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
trishulinoverseas1
 
Here is the game description- Here is the sample game- Here is the req.pdf
Here is the game description- Here is the sample game- Here is the req.pdfHere is the game description- Here is the sample game- Here is the req.pdf
Here is the game description- Here is the sample game- Here is the req.pdf
trishulinoverseas1
 
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdfWrite a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
rozakashif85
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
udit652068
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
atulkapoor33
 
Goal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdfGoal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdf
aaicommunication34
 
Please use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdfPlease use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdf
admin463580
 
Create Stored Procedure & Package
Create Stored Procedure & PackageCreate Stored Procedure & Package
Create Stored Procedure & Package
LakshendraSingh
 

Similar to sports-teampackage.bluej#BlueJ package fileobjectbench.heig.docx (10)

C++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdfC++You will design a program to play a simplified version of war, .pdf
C++You will design a program to play a simplified version of war, .pdf
 
Python find ajacent symbols recursively
Python find ajacent symbols recursivelyPython find ajacent symbols recursively
Python find ajacent symbols recursively
 
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdfHere is the game description- Here is the sample game- Goal- Your goal (1).pdf
Here is the game description- Here is the sample game- Goal- Your goal (1).pdf
 
Here is the game description- Here is the sample game- Here is the req.pdf
Here is the game description- Here is the sample game- Here is the req.pdfHere is the game description- Here is the sample game- Here is the req.pdf
Here is the game description- Here is the sample game- Here is the req.pdf
 
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdfWrite a class (BasketballTeam) encapsulating the concept of a tea.pdf
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
 
Goal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdfGoal- Your goal in this assignment is to write a Java program that sim.pdf
Goal- Your goal in this assignment is to write a Java program that sim.pdf
 
Please use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdfPlease use java to write the program that simulates the card game!!! T (1).pdf
Please use java to write the program that simulates the card game!!! T (1).pdf
 
Create Stored Procedure & Package
Create Stored Procedure & PackageCreate Stored Procedure & Package
Create Stored Procedure & Package
 

More from whitneyleman54422

In this unit, you will experience the powerful impact communication .docx
In this unit, you will experience the powerful impact communication .docxIn this unit, you will experience the powerful impact communication .docx
In this unit, you will experience the powerful impact communication .docx
whitneyleman54422
 
In this task, you will write an analysis (suggested length of 3–5 .docx
In this task, you will write an analysis (suggested length of 3–5 .docxIn this task, you will write an analysis (suggested length of 3–5 .docx
In this task, you will write an analysis (suggested length of 3–5 .docx
whitneyleman54422
 
In this SLP you will identify where the major transportation modes a.docx
In this SLP you will identify where the major transportation modes a.docxIn this SLP you will identify where the major transportation modes a.docx
In this SLP you will identify where the major transportation modes a.docx
whitneyleman54422
 
In this module the student will present writing which focuses attent.docx
In this module the student will present writing which focuses attent.docxIn this module the student will present writing which focuses attent.docx
In this module the student will present writing which focuses attent.docx
whitneyleman54422
 
In this module, we looked at a variety of styles in the Renaissa.docx
In this module, we looked at a variety of styles in the Renaissa.docxIn this module, we looked at a variety of styles in the Renaissa.docx
In this module, we looked at a variety of styles in the Renaissa.docx
whitneyleman54422
 
In this experiential learning experience, you will evaluate a health.docx
In this experiential learning experience, you will evaluate a health.docxIn this experiential learning experience, you will evaluate a health.docx
In this experiential learning experience, you will evaluate a health.docx
whitneyleman54422
 
In this essay you should combine your practice responding and analyz.docx
In this essay you should combine your practice responding and analyz.docxIn this essay you should combine your practice responding and analyz.docx
In this essay you should combine your practice responding and analyz.docx
whitneyleman54422
 
In this Discussion, pick one film to write about and answer ques.docx
In this Discussion, pick one film to write about and answer ques.docxIn this Discussion, pick one film to write about and answer ques.docx
In this Discussion, pick one film to write about and answer ques.docx
whitneyleman54422
 
In this assignment, you will identify and interview a family who.docx
In this assignment, you will identify and interview a family who.docxIn this assignment, you will identify and interview a family who.docx
In this assignment, you will identify and interview a family who.docx
whitneyleman54422
 
In this assignment, you will assess the impact of health legisla.docx
In this assignment, you will assess the impact of health legisla.docxIn this assignment, you will assess the impact of health legisla.docx
In this assignment, you will assess the impact of health legisla.docx
whitneyleman54422
 
In this assignment, you will create a presentation. Select a topic o.docx
In this assignment, you will create a presentation. Select a topic o.docxIn this assignment, you will create a presentation. Select a topic o.docx
In this assignment, you will create a presentation. Select a topic o.docx
whitneyleman54422
 
In this assignment, the student will understand the growth and devel.docx
In this assignment, the student will understand the growth and devel.docxIn this assignment, the student will understand the growth and devel.docx
In this assignment, the student will understand the growth and devel.docx
whitneyleman54422
 
In this assignment, I want you to locate two pieces of news detailin.docx
In this assignment, I want you to locate two pieces of news detailin.docxIn this assignment, I want you to locate two pieces of news detailin.docx
In this assignment, I want you to locate two pieces of news detailin.docx
whitneyleman54422
 
In this assignment worth 150 points, you will consider the present-d.docx
In this assignment worth 150 points, you will consider the present-d.docxIn this assignment worth 150 points, you will consider the present-d.docx
In this assignment worth 150 points, you will consider the present-d.docx
whitneyleman54422
 
In the readings thus far, the text identified many early American in.docx
In the readings thus far, the text identified many early American in.docxIn the readings thus far, the text identified many early American in.docx
In the readings thus far, the text identified many early American in.docx
whitneyleman54422
 
In the Roman Colony, leaders, or members of the court, were to be.docx
In the Roman Colony, leaders, or members of the court, were to be.docxIn the Roman Colony, leaders, or members of the court, were to be.docx
In the Roman Colony, leaders, or members of the court, were to be.docx
whitneyleman54422
 
In the provided scenario there are a few different crimes being .docx
In the provided scenario there are a few different crimes being .docxIn the provided scenario there are a few different crimes being .docx
In the provided scenario there are a few different crimes being .docx
whitneyleman54422
 
STOP THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
STOP  THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docxSTOP  THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
STOP THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
whitneyleman54422
 
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docxStoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
whitneyleman54422
 
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docxStock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
whitneyleman54422
 

More from whitneyleman54422 (20)

In this unit, you will experience the powerful impact communication .docx
In this unit, you will experience the powerful impact communication .docxIn this unit, you will experience the powerful impact communication .docx
In this unit, you will experience the powerful impact communication .docx
 
In this task, you will write an analysis (suggested length of 3–5 .docx
In this task, you will write an analysis (suggested length of 3–5 .docxIn this task, you will write an analysis (suggested length of 3–5 .docx
In this task, you will write an analysis (suggested length of 3–5 .docx
 
In this SLP you will identify where the major transportation modes a.docx
In this SLP you will identify where the major transportation modes a.docxIn this SLP you will identify where the major transportation modes a.docx
In this SLP you will identify where the major transportation modes a.docx
 
In this module the student will present writing which focuses attent.docx
In this module the student will present writing which focuses attent.docxIn this module the student will present writing which focuses attent.docx
In this module the student will present writing which focuses attent.docx
 
In this module, we looked at a variety of styles in the Renaissa.docx
In this module, we looked at a variety of styles in the Renaissa.docxIn this module, we looked at a variety of styles in the Renaissa.docx
In this module, we looked at a variety of styles in the Renaissa.docx
 
In this experiential learning experience, you will evaluate a health.docx
In this experiential learning experience, you will evaluate a health.docxIn this experiential learning experience, you will evaluate a health.docx
In this experiential learning experience, you will evaluate a health.docx
 
In this essay you should combine your practice responding and analyz.docx
In this essay you should combine your practice responding and analyz.docxIn this essay you should combine your practice responding and analyz.docx
In this essay you should combine your practice responding and analyz.docx
 
In this Discussion, pick one film to write about and answer ques.docx
In this Discussion, pick one film to write about and answer ques.docxIn this Discussion, pick one film to write about and answer ques.docx
In this Discussion, pick one film to write about and answer ques.docx
 
In this assignment, you will identify and interview a family who.docx
In this assignment, you will identify and interview a family who.docxIn this assignment, you will identify and interview a family who.docx
In this assignment, you will identify and interview a family who.docx
 
In this assignment, you will assess the impact of health legisla.docx
In this assignment, you will assess the impact of health legisla.docxIn this assignment, you will assess the impact of health legisla.docx
In this assignment, you will assess the impact of health legisla.docx
 
In this assignment, you will create a presentation. Select a topic o.docx
In this assignment, you will create a presentation. Select a topic o.docxIn this assignment, you will create a presentation. Select a topic o.docx
In this assignment, you will create a presentation. Select a topic o.docx
 
In this assignment, the student will understand the growth and devel.docx
In this assignment, the student will understand the growth and devel.docxIn this assignment, the student will understand the growth and devel.docx
In this assignment, the student will understand the growth and devel.docx
 
In this assignment, I want you to locate two pieces of news detailin.docx
In this assignment, I want you to locate two pieces of news detailin.docxIn this assignment, I want you to locate two pieces of news detailin.docx
In this assignment, I want you to locate two pieces of news detailin.docx
 
In this assignment worth 150 points, you will consider the present-d.docx
In this assignment worth 150 points, you will consider the present-d.docxIn this assignment worth 150 points, you will consider the present-d.docx
In this assignment worth 150 points, you will consider the present-d.docx
 
In the readings thus far, the text identified many early American in.docx
In the readings thus far, the text identified many early American in.docxIn the readings thus far, the text identified many early American in.docx
In the readings thus far, the text identified many early American in.docx
 
In the Roman Colony, leaders, or members of the court, were to be.docx
In the Roman Colony, leaders, or members of the court, were to be.docxIn the Roman Colony, leaders, or members of the court, were to be.docx
In the Roman Colony, leaders, or members of the court, were to be.docx
 
In the provided scenario there are a few different crimes being .docx
In the provided scenario there are a few different crimes being .docxIn the provided scenario there are a few different crimes being .docx
In the provided scenario there are a few different crimes being .docx
 
STOP THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
STOP  THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docxSTOP  THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
STOP THE MEETING MADNESS HOW TO FREE UP TIME FOR ME.docx
 
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docxStoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
Stoichiometry Lab – The Chemistry Behind Carbonates reacting with .docx
 
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docxStock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
Stock-Trak Portfolio Report Write-Up GuidelinesYou may want to.docx
 

Recently uploaded

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 

Recently uploaded (20)

Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 

sports-teampackage.bluej#BlueJ package fileobjectbench.heig.docx

  • 2. This is the project README file. Here, you should describe your project. Tell the reader (someone who does not know anything about this project) all he/she needs to know. The comments should usually include at least: ------------------------------------------------------------------------ PROJECT TITLE: PURPOSE OF PROJECT: VERSION or DATE: HOW TO START THIS PROJECT: AUTHORS: USER INSTRUCTIONS: __MACOSX/sports-team/._README.TXT sports-team/SportsTeam.classpublicsynchronizedclass SportsTeam { private java.util.Vector opponent; private java.util.Vector home; private java.util.Vector teamPoints; private java.util.Vector oppPoints; private String teamName;
  • 3. private String sportName; public void SportsTeam(); public void changeSport(String); public void changeName(String); public void addGame(String, boolean, int, int); public void updateGame(int, String, boolean, int, int); public double getWinLoss(boolean); public void displayRecord(); public void addRandomGames(int, int); } __MACOSX/sports-team/._SportsTeam.class sports-team/SportsTeam.ctxt #BlueJ class context comment0.params= comment0.target=SportsTeam() comment0.text=rn Constructor for objects of class SportsTeamrn comment1.params=newSport comment1.target=void changeSport(java.lang.String) comment1.text=rn Method to change sport. rn comment2.params=newName comment2.target=void changeName(java.lang.String) comment2.text=rn Method to change team name. rn
  • 4. comment3.params=otherTeam homeGame ourPoints theirPoints comment3.target=void addGame(java.lang.String, boolean, int, int) comment3.text=rn Method to add a new game. Attempts to add a game with either score negativern should be rejected with an error message in the terminal wondow.rn comment4.params=position otherTeam homeGame ourPoints theirPoints comment4.target=void updateGame(int, java.lang.String, boolean, int, int) comment4.text=rn Method to update data for a game that wwas entered in error. The game data at the positionrn provided will be replaced with the data provided. Aagin, negative scores should be rjected rn with an error message, as should any invalid position.rn comment5.params=printRequested comment5.target=double getWinLoss(boolean) comment5.text=rn When this method is called, the win/loss poercentage for the team will always be computed rn and returned.rn rn In addition, if the printRequested parameter is true, team's overall win-loss record rn should be displayed in the terminal window in the following format: rn Win-Loss Record: games_won-games_lost (% won)rn rn Example:rn Win-Loss Record: 38-26 (59.375%)rn
  • 5. comment6.params= comment6.target=void displayRecord() comment6.text=rn Dpisplay the team's current record, one line per game. Each line should begin with fourrn spaces, then display the following: the game number followed by a colon, the opposing rn team name (with "@" proceeding the name for away games), "W" or "L" indicating win or rn loss, and the score of each team, separated by a hyphen. NOTE: The home team score is rn always dosplayed last. After all games are displayed, the win-loss record should be rn displayed. (Call the method above to include this.)rn rn Here is an example:rn rn Record for the Greens baseball team:rn 0: @Flyers L 5-7rn 1: Raiders W 2-7rn 2: Vikings W 5-6rn 3: @Cardinals W 5-3rn Win-loss Record: 3-1 (75.0%)rn rn comment7.params=numGames maxScore comment7.target=void addRandomGames(int, int) comment7.text=rn Create ramdom simulated game data for the team. Parameters are used to specify the nuimberrn of games to generate and the maximum score expected in each game (as this would vary byrn sport.rn numComments=8 __MACOSX/sports-team/._SportsTeam.ctxt
  • 6. sports-team/SportsTeam.javasports- team/SportsTeam.javaimport java.util.*; /** * A SportsTeam object will track the record of a sports team, u sing several "paralell * vectors". For each of these vectors, position i will contain the information for * the ith game played by the team. Those vectors are: * * opponent - Contains the name of the opposing team. * home - Is true if the game is a home game, false if the game is an away game. * teamPoints - The number of points acored by the team. * oppPoints - The number of points scored by the opposing team. * * @author (your name) * @version (a version number or a date) */ publicclassSportsTeam { // These vectors will be used to track games. For each, position i will contain // the information for game i; privateVector<String> opponent; privateVector<Boolean> home; privateVector<Integer> teamPoints; privateVector<Integer> oppPoints; // Fields to hold name of team and sport. privateString teamName; privateString sportName; /** * Constructor for objects of class SportsTeam
  • 7. */ publicSportsTeam() { // Create all the vectors. opponent =newVector<String>(); home =newVector<Boolean>(); teamPoints =newVector<Integer>(); oppPoints =newVector<Integer>(); // Default team name and sport. teamName ="Greens"; sportName ="baseball"; } /** * Method to change sport. */ publicvoid changeSport(String newSport) { // Your code goes here. } /** * Method to change team name. */ publicvoid changeName(String newName) { // Your code goes here. } /** * Method to add a new game. Attempts to add a game with ei ther score negative * should be rejected with an error message in the terminal w ondow. */
  • 8. publicvoid addGame(String otherTeam,boolean homeGame,int o urPoints,int theirPoints) { // Your code goes here. } /** * Method to update data for a game that wwas entered in err or. The game data at the position * provided will be replaced with the data provided. Aagin, n egative scores should be rjected * with an error message, as should any invalid position. */ publicvoid updateGame(int position,String otherTeam,boolean h omeGame,int ourPoints,int theirPoints) { // Your code goes here. } /** * When this method is called, the win/loss poercentage for t he team will always be computed * and returned. * * In addition, if the printRequested parameter is true, team's overall win-loss record * should be displayed in the terminal window in the followin g format: * Win-Loss Record: games_won-games_lost (% won) * * Example: * Win-Loss Record: 38-26 (59.375%) */ publicdouble getWinLoss(boolean printRequested) { // Your code goes here. (The line below will be replaced.)
  • 9. return0.0; } /* * Dpisplay the team's current record, one line per game. Eac h line should begin with four * spaces, then display the following: the game number follo wed by a colon, the opposing * team name (with "@" proceeding the name for away games ), "W" or "L" indicating win or * loss, and the score of each team, separated by a hyphen. N OTE: The home team score is * always dosplayed last. After all games are displayed, the w in-loss record should be * displayed. (Call the method above to include this.) * * Here is an example: * * Record for the Greens baseball team: * 0: @Flyers L 5-7 * 1: Raiders W 2-7 * 2: Vikings W 5-6 * 3: @Cardinals W 5-3 * Win-loss Record: 3-1 (75.0%) * */ publicvoid displayRecord() { // Display heading. System.out.println("Record for the "+teamName+" "+sportName +" team:"); // Your code goes here. } /** * Create ramdom simulated game data for the team. Paramet
  • 10. ers are used to specify the nuimber * of games to generate and the maximum score expected in e ach game (as this would vary by * sport. */ publicvoid addRandomGames(int numGames,int maxScore) { String[] teams ={"Flyers","Raiders","Vikings","Cardinals"}; boolean[] trueFalse ={true,false}; int i, pos1, pos2, score1, score2; System.out.println("Adding the following games:"); for(i=0; i<numGames; i++) { pos1 =(int)(Math.random()*4); pos2 =(int)(Math.random()*2); score1 =(int)(Math.random()*(maxScore+1)); score2 = score1; while(score2 == score1) score2 =(int)(Math.random()*(maxScore+1)); System.out.println(" "+teams[pos1]+" "+trueFalse[pos2]+" "+ score1+" "+score2); addGame(teams[pos1], trueFalse[pos2], score1, score2); } } } __MACOSX/sports-team/._SportsTeam.java __MACOSX/._sports-team