SlideShare a Scribd company logo
1 of 11
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, .pdfezzi97
 
Python find ajacent symbols recursively
Python find ajacent symbols recursivelyPython find ajacent symbols recursively
Python find ajacent symbols recursivelyChristopher 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).pdftrishulinoverseas1
 
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.pdftrishulinoverseas1
 
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.pdfrozakashif85
 
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.pdfudit652068
 
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.pdfatulkapoor33
 
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.pdfaaicommunication34
 
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).pdfadmin463580
 
Create Stored Procedure & Package
Create Stored Procedure & PackageCreate Stored Procedure & Package
Create Stored Procedure & PackageLakshendraSingh
 

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 .docxwhitneyleman54422
 
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 .docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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 .docxwhitneyleman54422
 
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.docxwhitneyleman54422
 
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 .docxwhitneyleman54422
 
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.docxwhitneyleman54422
 

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

Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 

Recently uploaded (20)

Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

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