Write a class (BasketballTeam) encapsulating the concept of a team of basketball players. This
method should have a single instance variable which is an array of basketball player objects. In
addition to that class, you will need to design and a code a Playerclass to encapsulate the concept
of a basketball player, assuming a basketball player has the following attributes: a name, a
position, number of shots taken, and number of shots made.
In your Player class you should write the following methods:
A constructor taking a String for the name, a String for the position, an int for the number of
shots taken, and an int for the number of shots made.
Accessor, mutator, toString, and equals methods.
A method returning the individual shooting percentage. Avg = Shots Made / Shots Taken. Hint:
This method should return a double!!!
In your BasketballTeam class you should write the following methods:
A constructor taking an array of Player objects as its only parameter and assigning that array to
the array data member of the class, its only instance variable.
Accessor, mutator, toString, and equals methods.
A method checking if all positions are different, returning true if they are, false if they are not.
A method returning the shooting percentage of the team. Team Shooting Percentage = Total
Shots Made / Total Shots Taken Hint: This should return a double!!! Also, this is not the average
of the the averages.
A method checking that we have a center (that is, the name of the position) on the team. If we
do not have any return false; otherwise, it returns true;
A method returning void that sorts the array of Player objects in ascending order using the
number of shots taken as the sorting key.
A method returning the array of Player objects sorted in ascending alphabetical order by name.
Hint: Use compareTo method of the String class.
A method returning the name of the player with the most shots made.
A method returning the name of the player with the highest shooting average.
In your BasketballTeamClient class, when you test all your methods, you can hard-code five
basketball Player objects. This client should call all 12 methods including the constructor for full
credit.
When writing the Player class you should write a PlayerClient class that tests all its methods
before integrating into BasketballTeam class.
Solution
public class Player {
//Attributes
private String name;
private String position;
private int shotsTaken;
private int shotsMade;
/**
* Constructor
* @param name
* @param position
* @param shotsTaken
* @param shotsMade
*/
public Player(String name, String position, int shotsTaken, int shotsMade) {
this.name = name;
this.position = position;
this.shotsTaken = shotsTaken;
this.shotsMade = shotsMade;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the position
*/
public String getPosition() {
return position;
}
/**
* @p.
31 Coach class For this class you only need to implement .pdfAASTHASTYLETRADITION
3.1. Coach class
For this class you only need to implement two constructors; the overloaded and copy constructor
in addition to the static factory methods.
3.2. Player class
Two types of the constructors (overloaded and copy) and all the setter and getter methods is what
you need to implement for this task. Also, you should implement the static factory methods.
3.3. Soccer Team class
Three types of the constructors (default, overloaded and copy) and all the setter and getter
methods plus the static factory methods is what you need to implement for this task.
Please note that the instance variables in this class are all private, as the UML shows.
/**
* This class implements a simple soccer team
*@author May Haidar
*/
public class SoccerTeam {
/**
* This is the default constructors.
* At most 11 player can play this team.
* At most there are 4 roles players can have.
*/
private SoccerTeam() {
}
/**
* This is the overloaded constructor for this class
* @param player is an array containing all the players who entered the team.
* @param coach is the area that is available to the players to play.
*/
private SoccerTeam (Player [] player, Coach coach) {
}
/**
* This the copy constructor for this class
* @param team is an object of SoccerTeam, whose component is deeply copied into
* the component of this object.
*/
private SoccerTeam (SoccerTeam team) {
}
/**
* This is a static factory method
* @return IT returns an object of SoccerTeam
*/
public static SoccerTeam getInstance() {
}
/**
* This is a static factory method
* @param player is an array that contains players.
* @param coach is a coach of the team
* @return It returns an object of SoccerTeam made using the input parameters.
*/
public static SoccerTeam getInstance(Player [] player, Coach coach) {
}
/**
* This is a static factory method
* @param team is an object of SoccerTeam
* @return it returns an object of SoccerTeam made using the input parameter.
*/
public static SoccerTeam getInstance(SoccerTeam team) {
}
/**
* This is the getter method for the player list.
* @return returns an array containing all the players of this team.
*/
public Player[] getPlayers() {
}
/**
* This is the getter method for the coach attribute.
* @return Returns an object of coach containing all the components of this team's coach.
*/
public Coach getCoach() {
}
/**
* This is the setter method for the player attribute, which deeply copies
* the input parameter into the player attribute of this object.
* @param player is an array of Player, whose elements are copied in the player attribute of this
object.
*/
public void setPlayers(Player [] player) {
}
/**
* This is the setter method for the coach attribute, which deeply copies
* the input parameter into the coach attribute of this object.
* @param coach is an object of Coach, whose attributes are copied in the coach attribute of this
object.
*/
public void setCoach(Coach coach) {
}
}
/**
*
* This class implements all a player requires to play in this team.
* A player.
Thanks so much for your help. Review the GameService class. Noti.pdfadwitanokiastore
Thanks so much for your help.
Review the GameService class. Notice the static variables holding the next identifier to be
assigned for game id, team id, and player id.
-Be sure you use the singleton pattern to adapt an ordinary class, so only one instance of the
GameService class can exist in memory at any given time. This can be done by creating unique
identifiers for each instance of game, team, and player.
-Game and team names must be unique to allow users to check whether a name is in use when
choosing a team name. Be sure that you use the iterator pattern to complete the addGame() and
getGame() methods.
-Create a base class called Entity. The Entity class must hold the common attributes and
behaviors as shown in the UML Diagram.
-Refactor the Game class to inherit from this new Entity class.
-Complete the code for the Player and Team classes. Each class must derive from the Entity
class, as demonstrated in the UML diagram.
-Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
This is my current code:
// Game Service class:
package com.gamingroom;
import java.util.ArrayList;
import java.util.List;
/**
* A singleton service for the game engine
*
* @author coce@snhu.edu
*/
public class GameService {
/**
* A list of the active games
*/
private static List games = new ArrayList();
/*
* Holds the next game identifier
*/
private static long nextGameId = 1;
// FIXME: Add missing pieces to turn this class a singleton
/**
* Construct a new game instance
*
* @param name the unique name of the game
* @return the game instance (new or existing)
*/
// Creating a private instance of this class making it a singleton
private static GameService instance = new GameService();
// Private constructor to ensure we only have 1 instance
private void GameService() {
}
// Public accessor to allow outside classes to access this class
public static GameService getInstance() {
return instance;
}
public Game addGame(String name) {
// a local game instance
Game game = null;
// FIXME: Use iterator to look for existing game with same name
// if found, simply return the existing instance
for (Game currentGame : games) {
if (currentGame.getName().equals(name)) {
return currentGame;
}
}
// if not found, make a new game instance and add to list of games
if (game == null) {
game = new Game(nextGameId++, name);
games.add(game);
}
// return the new/existing game instance to the caller
return game;
}
/**
* Returns the game instance at the specified index.
*
* Scope is package/local for testing purposes.
*
* @param index index position in the list to return
* @return requested game instance
*/
Game getGame(int index) {
return games.get(index);
}
/**
* Returns the game instance with the specified id.
*
* @param id unique identifier of game to search for
* @return requested game instance
*/
public Game getGame(long id) {
// a local game instance
Game game.
I really need some help if I have this right so far. PLEASE CHANG.pdfaggarwalshoppe14
I really need some help if I have this right so far. ***PLEASE CHANGE COMMENTS TO
EXPLAIN THE JAVA APPLICATION OR IF CHANGE THE CODE SO IT CAN BE
RIGHT***** JAVA
Here are the instructions and then the code in a sec.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.java
Player.java
GameService.j.
I really need some help if I have this right so far. Please Resub.pdfaggarwalshoppe14
I really need some help if I have this right so far. ***Please Resubmit the revsised and updated
Code with Comments added explaining please. RIGHT***** JAVA
Here are the instructions and then the code in a sec.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.java
Player.java
GameService.java
P.
question.(player, entity ,field and base.java codes are given)Stop.pdfshahidqamar17
question.(player, entity ,field and base.java codes are given)
Stopping Player
All players need to stay within the eld boundaries. This rst class you write will lay some of the
foundation for the logic needed in all your players. Create a class called Stopping that extends
the Player class. A Stopping player will initially move in a random direction and stops moving
when it reaches the border of the playing eld (without leaving the playing eld). The direction that
a player moves in is determined by its speed in each direction: speedX and speedY. You will add
this logic to manipulate the speed attributes for stopping in its play() method. Take care to notice
that the images of the players have some size to them. Your player should not “visually” leave
the eld. All parts of the image should be on or inside the eld boundaries.
player class;
public abstract class Player extends Entity{
/** this player\'s team name */
protected String team;
/** this player\'s name */
protected String name;
/** this player\'s number */
protected int number;
/** gets this player\'s team name
*
* @return the team name that this player is on
*/
public final String getTeam(){ return this.team; }
/** gets this player\'s name
*
* @return the name of this player
*/
public final String getName(){ return this.name; }
/** gets this player\'s number
*
* @return the number of this player
*/
public final int getNumber(){ return this.number; }
/** creates a player with specified symbol at specified position
*
* @param f is the field the player will be playing on
* @param side is the side of the field the player will play on
* @param name is this name of the player
* @param number is this player\'s number
* @param team is this player\'s team name
* @param symbol is a character (char) representation of this player
* @param x is the x-coordinate of this player
* @param y is the y-coordinate of this player
*/
public Player(Field f, int side, String name, int number, String team, char symbol, double x,
double y){
super(symbol, x, y);
this.name = name;
this.number = number;
this.team = team;
f.registerPlayer(this, this.id, side); // register the player on the field
}
/** attempt to catch an opponent player
*
* @param opponent a player on the opponent\'s team that you are trying to catch
* @param field is the field the game is being played on
* @return true if this player successfully catches the opponent player, false otherwise
*/
public final boolean catchOpponent(Player opponent, Field field){
return field.catchOpponent(this, opponent);
}
/** Informs this player that they have been caught by another player.
*
* This method should only be called from within the Field class.
*
* @param opponent is the player that caught this player
* @param id should be the id of the this player
*/
public void beenCaught(Player opponent, int id){
/* check if the caller knows this entity\'s id */
if( this.id != id ){
throw new SecurityException(\"Unauthorized attempt to call beenCaught \");
}
}
/** att.
Inheritance - Creating a Multilevel Hierarchy In this lab- you will s.pdfEvanpZjSandersony
Inheritance - Creating a Multilevel Hierarchy
In this lab, you will start to use Inheritance to create a Creating a Multilevel Hierarchy.
Deliverable
A zipped NetBeans project with 7 classes
App
Person
Height
Student
Player
FootballPlayer
SoccerPlayer
Classes
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will .
Inheritance - Creating a Multilevel Hierarchy In this lab- you will s.pdfvishalateen
Inheritance - Creating a Multilevel Hierarchy
In this lab, you will start to use Inheritance to create a Creating a Multilevel Hierarchy.
Deliverable
A zipped NetBeans project with 7 classes
App
Person
Height
Student
Player
FootballPlayer
SoccerPlayer
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
.
Use Netbeans to copy your last lab (Lab 07) to a new project called La.pdfashishgargjaipuri
Use Netbeans to copy your last lab (Lab 07) to a new project called Lab08.
Close Lab07.
Work on the new Lab08 project then.
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
regarding state , the toString method will have a similar functionality as App had in the first lab.
if the state att.
31 Coach class For this class you only need to implement .pdfAASTHASTYLETRADITION
3.1. Coach class
For this class you only need to implement two constructors; the overloaded and copy constructor
in addition to the static factory methods.
3.2. Player class
Two types of the constructors (overloaded and copy) and all the setter and getter methods is what
you need to implement for this task. Also, you should implement the static factory methods.
3.3. Soccer Team class
Three types of the constructors (default, overloaded and copy) and all the setter and getter
methods plus the static factory methods is what you need to implement for this task.
Please note that the instance variables in this class are all private, as the UML shows.
/**
* This class implements a simple soccer team
*@author May Haidar
*/
public class SoccerTeam {
/**
* This is the default constructors.
* At most 11 player can play this team.
* At most there are 4 roles players can have.
*/
private SoccerTeam() {
}
/**
* This is the overloaded constructor for this class
* @param player is an array containing all the players who entered the team.
* @param coach is the area that is available to the players to play.
*/
private SoccerTeam (Player [] player, Coach coach) {
}
/**
* This the copy constructor for this class
* @param team is an object of SoccerTeam, whose component is deeply copied into
* the component of this object.
*/
private SoccerTeam (SoccerTeam team) {
}
/**
* This is a static factory method
* @return IT returns an object of SoccerTeam
*/
public static SoccerTeam getInstance() {
}
/**
* This is a static factory method
* @param player is an array that contains players.
* @param coach is a coach of the team
* @return It returns an object of SoccerTeam made using the input parameters.
*/
public static SoccerTeam getInstance(Player [] player, Coach coach) {
}
/**
* This is a static factory method
* @param team is an object of SoccerTeam
* @return it returns an object of SoccerTeam made using the input parameter.
*/
public static SoccerTeam getInstance(SoccerTeam team) {
}
/**
* This is the getter method for the player list.
* @return returns an array containing all the players of this team.
*/
public Player[] getPlayers() {
}
/**
* This is the getter method for the coach attribute.
* @return Returns an object of coach containing all the components of this team's coach.
*/
public Coach getCoach() {
}
/**
* This is the setter method for the player attribute, which deeply copies
* the input parameter into the player attribute of this object.
* @param player is an array of Player, whose elements are copied in the player attribute of this
object.
*/
public void setPlayers(Player [] player) {
}
/**
* This is the setter method for the coach attribute, which deeply copies
* the input parameter into the coach attribute of this object.
* @param coach is an object of Coach, whose attributes are copied in the coach attribute of this
object.
*/
public void setCoach(Coach coach) {
}
}
/**
*
* This class implements all a player requires to play in this team.
* A player.
Thanks so much for your help. Review the GameService class. Noti.pdfadwitanokiastore
Thanks so much for your help.
Review the GameService class. Notice the static variables holding the next identifier to be
assigned for game id, team id, and player id.
-Be sure you use the singleton pattern to adapt an ordinary class, so only one instance of the
GameService class can exist in memory at any given time. This can be done by creating unique
identifiers for each instance of game, team, and player.
-Game and team names must be unique to allow users to check whether a name is in use when
choosing a team name. Be sure that you use the iterator pattern to complete the addGame() and
getGame() methods.
-Create a base class called Entity. The Entity class must hold the common attributes and
behaviors as shown in the UML Diagram.
-Refactor the Game class to inherit from this new Entity class.
-Complete the code for the Player and Team classes. Each class must derive from the Entity
class, as demonstrated in the UML diagram.
-Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
This is my current code:
// Game Service class:
package com.gamingroom;
import java.util.ArrayList;
import java.util.List;
/**
* A singleton service for the game engine
*
* @author coce@snhu.edu
*/
public class GameService {
/**
* A list of the active games
*/
private static List games = new ArrayList();
/*
* Holds the next game identifier
*/
private static long nextGameId = 1;
// FIXME: Add missing pieces to turn this class a singleton
/**
* Construct a new game instance
*
* @param name the unique name of the game
* @return the game instance (new or existing)
*/
// Creating a private instance of this class making it a singleton
private static GameService instance = new GameService();
// Private constructor to ensure we only have 1 instance
private void GameService() {
}
// Public accessor to allow outside classes to access this class
public static GameService getInstance() {
return instance;
}
public Game addGame(String name) {
// a local game instance
Game game = null;
// FIXME: Use iterator to look for existing game with same name
// if found, simply return the existing instance
for (Game currentGame : games) {
if (currentGame.getName().equals(name)) {
return currentGame;
}
}
// if not found, make a new game instance and add to list of games
if (game == null) {
game = new Game(nextGameId++, name);
games.add(game);
}
// return the new/existing game instance to the caller
return game;
}
/**
* Returns the game instance at the specified index.
*
* Scope is package/local for testing purposes.
*
* @param index index position in the list to return
* @return requested game instance
*/
Game getGame(int index) {
return games.get(index);
}
/**
* Returns the game instance with the specified id.
*
* @param id unique identifier of game to search for
* @return requested game instance
*/
public Game getGame(long id) {
// a local game instance
Game game.
I really need some help if I have this right so far. PLEASE CHANG.pdfaggarwalshoppe14
I really need some help if I have this right so far. ***PLEASE CHANGE COMMENTS TO
EXPLAIN THE JAVA APPLICATION OR IF CHANGE THE CODE SO IT CAN BE
RIGHT***** JAVA
Here are the instructions and then the code in a sec.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.java
Player.java
GameService.j.
I really need some help if I have this right so far. Please Resub.pdfaggarwalshoppe14
I really need some help if I have this right so far. ***Please Resubmit the revsised and updated
Code with Comments added explaining please. RIGHT***** JAVA
Here are the instructions and then the code in a sec.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.java
Player.java
GameService.java
P.
question.(player, entity ,field and base.java codes are given)Stop.pdfshahidqamar17
question.(player, entity ,field and base.java codes are given)
Stopping Player
All players need to stay within the eld boundaries. This rst class you write will lay some of the
foundation for the logic needed in all your players. Create a class called Stopping that extends
the Player class. A Stopping player will initially move in a random direction and stops moving
when it reaches the border of the playing eld (without leaving the playing eld). The direction that
a player moves in is determined by its speed in each direction: speedX and speedY. You will add
this logic to manipulate the speed attributes for stopping in its play() method. Take care to notice
that the images of the players have some size to them. Your player should not “visually” leave
the eld. All parts of the image should be on or inside the eld boundaries.
player class;
public abstract class Player extends Entity{
/** this player\'s team name */
protected String team;
/** this player\'s name */
protected String name;
/** this player\'s number */
protected int number;
/** gets this player\'s team name
*
* @return the team name that this player is on
*/
public final String getTeam(){ return this.team; }
/** gets this player\'s name
*
* @return the name of this player
*/
public final String getName(){ return this.name; }
/** gets this player\'s number
*
* @return the number of this player
*/
public final int getNumber(){ return this.number; }
/** creates a player with specified symbol at specified position
*
* @param f is the field the player will be playing on
* @param side is the side of the field the player will play on
* @param name is this name of the player
* @param number is this player\'s number
* @param team is this player\'s team name
* @param symbol is a character (char) representation of this player
* @param x is the x-coordinate of this player
* @param y is the y-coordinate of this player
*/
public Player(Field f, int side, String name, int number, String team, char symbol, double x,
double y){
super(symbol, x, y);
this.name = name;
this.number = number;
this.team = team;
f.registerPlayer(this, this.id, side); // register the player on the field
}
/** attempt to catch an opponent player
*
* @param opponent a player on the opponent\'s team that you are trying to catch
* @param field is the field the game is being played on
* @return true if this player successfully catches the opponent player, false otherwise
*/
public final boolean catchOpponent(Player opponent, Field field){
return field.catchOpponent(this, opponent);
}
/** Informs this player that they have been caught by another player.
*
* This method should only be called from within the Field class.
*
* @param opponent is the player that caught this player
* @param id should be the id of the this player
*/
public void beenCaught(Player opponent, int id){
/* check if the caller knows this entity\'s id */
if( this.id != id ){
throw new SecurityException(\"Unauthorized attempt to call beenCaught \");
}
}
/** att.
Inheritance - Creating a Multilevel Hierarchy In this lab- you will s.pdfEvanpZjSandersony
Inheritance - Creating a Multilevel Hierarchy
In this lab, you will start to use Inheritance to create a Creating a Multilevel Hierarchy.
Deliverable
A zipped NetBeans project with 7 classes
App
Person
Height
Student
Player
FootballPlayer
SoccerPlayer
Classes
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will .
Inheritance - Creating a Multilevel Hierarchy In this lab- you will s.pdfvishalateen
Inheritance - Creating a Multilevel Hierarchy
In this lab, you will start to use Inheritance to create a Creating a Multilevel Hierarchy.
Deliverable
A zipped NetBeans project with 7 classes
App
Person
Height
Student
Player
FootballPlayer
SoccerPlayer
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
.
Use Netbeans to copy your last lab (Lab 07) to a new project called La.pdfashishgargjaipuri
Use Netbeans to copy your last lab (Lab 07) to a new project called Lab08.
Close Lab07.
Work on the new Lab08 project then.
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
regarding state , the toString method will have a similar functionality as App had in the first lab.
if the state att.
Here are the instructions and then the code in a sec. Please R.pdfaggarwalshoppe14
Here are the instructions and then the code in a sec.
**Please Resubmit the revised and updated Code (GamerService) with Comments added
explaining please. RIGHT***** JAVA. HOWEVER IF YOU NEED TO CHANGE THE
ENTIRE THING IT IS FINE. I AM DESPERATE.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.
Suggestion- Use Netbeans to copy your last lab (Lab 07) to a new proje.pdfssuser58be4b1
Suggestion:
Use Netbeans to copy your last lab (Lab 07) to a new project called Lab08.
Close Lab07.
Work on the new Lab08 project then.
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
regarding state , the toString method will have a similar functionality as App had in the first lab.
if t.
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
ReversePoem.java :-
---------------------------------
public class ReversePoem {
/*This programs has you display a pessimistic poem from a list of phrases*/
// and then reverse the phrases to find another more optimistic poem.
public static void main(String[] args) throws Exception
{
//Queue object
MyQueue queue = new MyQueue<>();
//Stack object
MyStack stack = new MyStack<>();
//String buffer to apppend all Strings
StringBuffer sb = new StringBuffer();
// Create a single String object from the 16 Strings below
String set1 = \"I am part of a lost generation#and I refuse to believe that#\";
sb.append(set1);
String set2 = \"I can change the world#I realize this may be a shock but#\";
sb.append(set2);
String set3 = \"\'Happiness comes from within\'#is a lie, and#\";
sb.append(set3);
String set4 = \"\'Money will make me happy\'#So in 30 years I will tell my children#\";
sb.append(set4);
String set5 = \"they are not the most important thing in my life#\";
sb.append(set5);
String set6 = \"My employer will know that#I have my priorities straight because#\";
sb.append(set6);
String set7 = \"work#is more important than#family#I tell you this#\";
sb.append(set7);
String set8 = \"Once upon a time#Families stayed together#\";
sb.append(set8);
String set9 = \"but this will not be true in my era#\";
sb.append(set9);
String set10 = \"This is a quick fix society#Experts tell me#\";
sb.append(set10);
String set11 = \"30 years from now, I will be celebrating the 10th anniversary of my
divorce#\";
sb.append(set11);
String set12 = \"I do not concede that#I will live in a country of my own making#\";
sb.append(set12);
String set13 = \"In the future#Environmental destruction will be the norm#\";
sb.append(set13);
String set14 = \"No longer can it be said that#My peers and I care about this earth#\";
sb.append(set14);
String set15 = \"It will be evident that#My generation is apathetic and lethargic#\";
sb.append(set15);
String set16 = \"It is foolish to presume that#There is hope#\";
sb.append(set16);
String finalString = sb.toString();
String itmes[] = finalString.split(\"#\");
System.out.println(\"========== Original Phrase ==============\");
for(int i = 0 ; i < itmes.length;i++){
queue.enqueue(itmes[i]);
System.out.println(itmes[i]);
}
for(int i = 0 ; i < itmes.length;i++){
stack.push(queue.dequeue());
}
System.out.println(\"========== Reverse Phrase ==============\");
for(int i = 0 ; i < itmes.length;i++){
System.out.println(stack.pop());
}
/* You are given a list of phrases in Strings; the phrases
are separated by pound signs: \'#\':
1. Create a single String object from this list.
2. Then, split the String of phrases into an array of
phrases using the String split method.
3. Display a poem by walking through the array and
displaying each phrase one per line.
4. And, at the same time, place each phrase on a
MyQueue object using only the enqueue method.
5. After all the phrases have been placed on the queue,
transfer the phrases from the MyQueue object to a
MyS.
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdfmallik3000
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD
OR REMOVE NAME. DO NOT HARD CODE NAME. AGAIN MAKE SURE THE
PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR REMOVE NAME. PLEASE
MAKE SURE THE CODE RUNS WITHOUT ANY ERRORS.
Write a class that maintains the scores for a game application. Implement the addition and
removal function to update the database. The gamescore.txt contains player’ name and score data
record fields separated by comma. For Removal function, uses the name field to select record to
remove the game score record.
Use the List.java, LList.java, Dlink.java, GameEntry.java and gamescore.txt found below
Read gamescore.txt to initialize the Linked list in sorted order by score.
Ask the user to add or remove users to update the sorted linked list.
Display “Name exist” when add an exist name to the list.
Display “Name does not exist” when remove a name not on the list.
List.java File:
/** Source code example for \"A Practical Introduction to Data
Structures and Algorithm Analysis, 3rd Edition (Java)\"
by Clifford A. Shaffer
Copyright 2008-2011 by Clifford A. Shaffer
*/
/** List ADT */
public interface List
{
/**
* Remove all contents from the list, so it is once again empty. Client is
* responsible for reclaiming storage used by the list elements.
*/
public void clear();
/**
* Insert an element at the current location. The client must ensure that
* the list\'s capacity is not exceeded.
*
* @param item
* The element to be inserted.
*/
public void insert(E item);
/**
* Append an element at the end of the list. The client must ensure that
* the list\'s capacity is not exceeded.
*
* @param item
* The element to be appended.
*/
public void append(E item);
/**
* Remove and return the current element.
*
* @return The element that was removed.
*/
public E remove();
/** Set the current position to the start of the list */
public void moveToStart();
/** Set the current position to the end of the list */
public void moveToEnd();
/**
* Move the current position one step left. No change if already at
* beginning.
*/
public void prev();
/**
* Move the current position one step right. No change if already at end.
*/
public void next();
/** @return The number of elements in the list. */
public int length();
/** @return The position of the current element. */
public int currPos();
/**
* Set current position.
*
* @param pos
* The position to make current.
*/
public void moveToPos(int pos);
/** @return The current element. */
public E getValue();
}
LList.java File:
/**
* Source code example for \"A Practical Introduction to Data Structures and
* Algorithm Analysis, 3rd Edition (Java)\" by Clifford A. Shaffer Copyright
* 2008-2011 by Clifford A. Shaffer
*/
// Doubly linked list implementation
class LList implements List
{
private DLink head; // Pointer to list header
private DLink tail; // Pointer to last element in list
protected DLink curr; // Pointer ahead of current element
int cnt; // Size of list
// Constructors
LList(int size)
{
th.
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
I don\'t know what is wrong with this roulette program I can\'t seem to get it to run.
Game Class:
public class Game {
public static void main(String[] args) {
Table table = new Table();
BinBuilder bb = new BinBuilder();
Outcome black = new Outcome(\"Black\", 35);
Bet bet = new Bet(10, black);
table.placeBet(bet);
Bin bin = bb.wheel.get(8);
System.out.println(bin.toString());
System.out.println(table.bets.toString());
System.out.println(black.toString());
ListIterator i = table.bets.listIterator();
Iterator b = bin.outcomes.iterator();
while(i.hasNext()) {
System.out.println(i.next().outcome.name.toString());
while(b.hasNext()){
System.out.println(b.next().name.toString());
if(i.next().outcome.equals(b.next())){
System.out.println(\"Win!\");
}
else{
System.out.println(\"Win :/\");
}
}
}
}
}
Player Class
public class Player {
public Table table;
public Outcome black;
public Bet bet;
public Player(Table table) {
table = new Table();
black = new Outcome(\"Black\", 1);
}
void placeBets() {
Bet bet = new Bet(100, black);
table.placeBet(bet);
}
void win(Bet bet) {
System.out.println(\"You\'ve won: \" + bet.winAmount());
}
void lose(Bet bet) {
System.out.println(\"You lost!\" + bet.loseAmount() + \":/\");
}
}
Outcome class
public class Outcome implements Comparable {
public String name;
public int odds;
public Outcome(String name, int odds){
this.name = name;
this.odds = odds;
}
public int winAmount(int amount){
return amount*this.odds;
}
public boolean equals(Outcome other){
return (this.name.equals(other.name));
}
public String toString() {
Object[] values= { name, new Integer(odds) };
String msgTempl= \"{0} ({1}:1)\";
return MessageFormat.format( msgTempl, values );
}
@Override
public int compareTo(E arg0) {
if(this.equals(arg0)){
return 0;
}
return 1;
}
}
Table Class
public class Table {
public int limit = 1000;
public LinkedList bets;
public Table() {
bets = new LinkedList();
}
public boolean isValid(Bet bet) {
int sum = 0;
for(Bet bett: bets) {
sum += bett.amountBet;
}
return (sum>limit);
}
public void placeBet(Bet bet) {
bets.add(bet);
}
ListIterator iterator() {
return bets.listIterator();
}
}
Wheel Class
public class Wheel extends TreeSet {
Vector bins;
NonRandom rng;
Set all_outcomes;
Wheel(NonRandom rng){
this.rng = rng;
rng = new NonRandom();
all_outcomes = new TreeSet();
bins = new Vector(38);
for (int i=0; i<38; i++){
bins.add(i, new Bin());
}
}
Bin next(){
int rand = rng.next(38);
return bins.elementAt(rand);
}
Bin get(int bin){
return bins.elementAt(bin);
}
public Outcome getOutcome( String name ){
TreeSet result= new TreeSet();
for( Iterator i = all_outcomes.iterator(); i.hasNext(); ) {
Outcome oc= i.next();
if( oc.name.contains(name) ) {result.add( oc );}
}
return result.first();
}
public void addOutcome(int bin, Outcome outcome) {
all_outcomes.add(outcome);
this.bins.elementAt(bin).add(outcome);
}
}
Bet Class
public class Bet {
public int amountBet;
public Outcome outcome;
public Bet(int amount, Outcome outcome) {
this.outcome = o.
Give background information concerning EMT and include what is known.pdfrozakashif85
Give background information concerning EMT and include what is known about EMT in normal
development as well as in neoplasms. What are strategies that could be used to overcome drug
resistance in cancer cells by targeting EMT (minimum four paragraphs).
Solution
Answer:
Cancer stem cell (CSC) hypothesis: This hypothesis elucidating that the CSC are the
subpopulation and able to exert higher resistance associated with explicit capability to self-renew
finally to differentiate into different offspring of cancer cells to generate a tumor. This
hypothesis is based on the cellular mechanisms exclusively developed inside the CSC to exert
resistance such pathways are mainly through Wnt signaling, Notch signaling. There are other
targets to regulate proliferation and differentiation through ABC transporter system and receptor
tyrosine kinases. These targets are the future stem cells anti-cancer therapies in regulating the
proliferation & differentiation of cancer cells as CSCs have a potential relationship with
epithelial-mesenchymal transition (EMT).
Metastasis has many steps. The main cancer cell morphological features that support invasion,
intravasation, and extravasation are epithelial-mesenchymal transition via cell -adhesion
molecules. Invasion is mainly due to presence of cell adhesion molecules such as integrins on the
cancer cells finally promote the movement of cancer cells to another region. This process is
going to connect adjacent cells to tumor cells finally undergo epithelial-mesenchymal transition
(EMT) result in formation of \"continuously dividing neoplasms\" with higher drug resistence to
cure compared to normal cells
Strategies that could be used to overcome drug resistance in cancer cells by targeting EMT:
\"A combination therapy of neutraceuticals & chemotherapeutic agents\" are most promising
strategies to overcome drug resistance in cancer cells by targeting EMTs, cancer stem cells
(CSC) &
Modulation of microRNAs do promote effective strategy to overcome drug resistance in cancer
cells
Oligonucletodie deliver: Another strategy could be used to overcome drug resistance in cancer
cells by targeting EMT. In this method, synthesized microRNAs are going to make in the form of
\"nanoparticle or microsomal\" formulation finally used to target microRNAs in cancer cells
result in \"complete destruction of pre-mRNA\" finally there will no translation mechanism to
synthesize \"cell survival proteins\" to proliferate.
Explain how the current economic recession differs from the depressio.pdfrozakashif85
Explain how the current economic recession differs from the depression in the 1930\'s.
Solution
The Great depression was worldwide. It was due to the collapse of the international financial
system It also resulted from the mutual adoption by many countries ( including USA) of high-
tariff policies, which were intended to keep out foreign goods in order to protect domestic
producers. The policies were called \"beggar thy neighbour\" strategies since they attempted to
\"export\" unemployment by improving one country\'s trade position and hence demand for its
goods at the expense of its trading partners And , of course, if each country keeps out foreign
goods, the volume of world trade declines, providing a contractionary influence on the world
economy
Almost every country suffered a deep recession in the 1930s, but some countries did better than
USA Sweden began an expansionary policy in the early 1930s and reduced its unemployment
relatively quicker Britain\'s economy suffered high unemployment but in 1931 it went off the
gold standard and the ensuing devaluation of the pound sterling set the stage for some
improvement. Germany grew rapidly after Hitler came to power and expanded government
spending. China escaped the recession until after 1931, because it had a floating exchange rate.
In 1938, real GNP in US rose above its 1929 level for the first time in the decade, but it was not
until 1942 , after the US formally entered world war II , that the unemployment rate finally fell
below 5%
The experience of the US in the early 1980s- the worst recession since the Great Depression,
casts doubt on the optimistism of recovery. During the 1980s, the US experienced the largest
sustained budget deficits in its peacetime history. Even so cutting spending or raising taxes was
not politically popular. Gradually, in the 1990s, the deficit began to be brought under control,
and toward the end of the decade the budget swung into surplus.This was due to raising the
prices and government spending.
By,
Nishant Bhatt.
Does yeast uses CopI and CopII formation for vesicle budding to grow.pdfrozakashif85
Does yeast uses CopI and CopII formation for vesicle budding to grow asexually?Is CopII starts
from the er then goes out the cell and CopI works for the molecules comes in the cell and goes to
nucleus?Does copII carries proteins away to make the budding?Please explain in details.
Solution
Yes, yeasts reproduce asexually by an asymmetric division process known as budding. Initially,
yeast forms a small protuberance which then grows to a full size and forms a bud. Then the
nucleus splits and migrates into the daughter cell. After the movement of nucleus, the entire bud
detaches from the parent cell by forming a constriction at the base. This process will repeat until
a chain of bud cells are formed..
DNA molecules consist of chemically linked sequences of the bases ad.pdfrozakashif85
DNA molecules consist of chemically linked sequences of the bases adenine, guanine, cytosine
and thymine, denoted A, G, C and T. A sequence of three bases is called a codon. A base may
appear more than once in a codon.
1) Represent all possible base sequences using a tree diagram.
2) How many different codons are there?
3) The bases A and G are purines, while C and T are pyrimidines. How many codons are there
whose first and third bases are purines and whose second base is a pyrimidine?
4) How many codons consist of three different bases?
Solution.
Data StructuresPLEASE USING THIS C++ PROGRAM BELOW, I NEED HEL.pdfrozakashif85
Data Structures
PLEASE USING THIS C++ PROGRAM BELOW, I NEED HELP ON IMPLEMENTING
BOTH QUEUE AND STACK TO PRINT \"I able\"
REVERSE/BACKWARDS(PALINDROME)
#include
#include
using namespace std;
struct st
{
int year;
st *next;
};
class queue
{
public:
int sz,i = 0;
char chr[100];
queue()
{
//constructor for initializing front and rear to NULL
front = NULL;
rear = NULL;
cout << \"enter size of queue: \";
cin >> sz;
}
// ~queue()
// {
//
// }
// in the enterqueue, create a new node, assign value and add it to queue
// if F = R = NULL the ( ) else ( )
void enterqueue(int yr, char el)
{
//inserting into queue if queue not overflow
if(i >= sz)
{
cout << \"queue over flow\";
return;
}
if (front == NULL )
{
front = new st;
front->next = NULL;
front->year = yr;
rear = front;
chr[i] = el;
i++;
}
else
{
st *temp = new st;
temp->year = yr;
rear->next = temp;
rear = temp;
chr[i] = el;
i++;
}
}
char deletequeue()
{
//delete front data from queue if data in the queue
char tr;
int j = 0;
st *temp;
temp = front;
if( front == NULL)
{
cout << \"queue under flow\";
return \'a\';
}
if(front == rear)
{
front = rear = NULL;
return \'a\';
}
front = front->next;
delete temp;
tr = chr[0];
i--;
for(j = 0; j < i; j++)
{
chr[j] = chr[j+1];
}
chr[j] = \'\\0\';
return tr;
}
bool isempty()
{
//it shows whether queue is empty
if( front == NULL)
{
return true;
}
else
return false;
}
bool isfull()
{
//it shows whether queue is full
if(i == sz)
return true;
else
return false;
}
void display()
{
//it displays queue data with characters of queue if invalid choice is entered
st *tmp;
int j = 0;
cout << \"\ queue is:\ character \\tyear\";
for(tmp = front; tmp != rear; tmp = tmp->next, j++)
{
cout << \"\ \" << chr[j] << \" \" << tmp->year;
}
cout << \"\ \"<year;
}
private:
st *front, *rear;
};
int main()
{
//main method to call queue functions by choice
queue s1;
int ch,yr;
char el;
bool s;
while(1)
{
cout << \"\ 1.ENTERQUEUE\ 2.DELETEQUEUE\ 3.ISEMPTY\ 4.ISFULL\ 5.EXIT\ enter
your choice: \";
cin >> ch;
switch(ch)
{
case 1:
if(!s1.isfull())
{
cout << \"\ enter a year : \";
cin >> yr;
cout << \"\ enter a character : \";
cin >> el;
s1.enterqueue(yr, el);
}
else
cout << \"insertion not possible\";
break;
case 2:
s = s1.isempty();
if(!s)
{
el = s1.deletequeue();
cout << \"\ The character of queue \" << el <<\" is deleted\" << endl;
}
else
cout << \"\ queue is empty.deletion not possible\"<< endl;
break;
case 3:
s = s1.isempty();
if(s)
cout << \"\ queue is empty\" << endl;
else
cout << \"\ queue is not empty\" << endl;
break;
case 4:
s=s1.isfull();
if(s)
cout << \"\ queue is full\" << endl;
else
cout << \"\ queue is not full\" << endl;
break;
case 5:
exit(0);
default : cout << \"invalid choice\" << endl;
if(!s1.isempty())
s1.display();
}
}
return (0);
}
Solution
#include
#include
using namespace std;
struct st
{
int year;
st *next;
};
class queue
{
public:
//int sz,i=0;//modified //code modified here// everything is fine with the code except this...
queue is implemented correctly
//you can .
Count Red Nodes. Write a program that computes the percentage of red.pdfrozakashif85
Count Red Nodes. Write a program that computes the percentage of red nodes in a given red-
black BST. Test your program by running at least 100 trials of the experiment of inserting N
random keys into an initially empty tree, for N = 10^4, 10^5, 10^6, and formulate an hypothesis.
*It is experiment from textbook Algorithms, 3.3.42
Does anyone know the answer?
Solution
/*
* Java Program to Implement Red Black Tree
*/
import java.util.Scanner;
/* Class Node */
class RedBlackNode
{
RedBlackNode left, right;
int element;
int color;
/* Constructor */
public RedBlackNode(int theElement)
{
this( theElement, null, null );
}
/* Constructor */
public RedBlackNode(int theElement, RedBlackNode lt, RedBlackNode rt)
{
left = lt;
right = rt;
element = theElement;
color = 1;
}
}
/* Class RBTree */
class RBTree
{
private RedBlackNode current;
private RedBlackNode parent;
private RedBlackNode grand;
private RedBlackNode great;
private RedBlackNode header;
private static RedBlackNode nullNode;
/* static initializer for nullNode */
static
{
nullNode = new RedBlackNode(0);
nullNode.left = nullNode;
nullNode.right = nullNode;
}
/* Black - 1 RED - 0 */
static final int BLACK = 1;
static final int RED = 0;
/* Constructor */
public RBTree(int negInf)
{
header = new RedBlackNode(negInf);
header.left = nullNode;
header.right = nullNode;
}
/* Function to check if tree is empty */
public boolean isEmpty()
{
return header.right == nullNode;
}
/* Make the tree logically empty */
public void makeEmpty()
{
header.right = nullNode;
}
/* Function to insert item */
public void insert(int item )
{
current = parent = grand = header;
nullNode.element = item;
while (current.element != item)
{
great = grand;
grand = parent;
parent = current;
current = item < current.element ? current.left : current.right;
// Check if two red children and fix if so
if (current.left.color == RED && current.right.color == RED)
handleReorient( item );
}
// Insertion fails if already present
if (current != nullNode)
return;
current = new RedBlackNode(item, nullNode, nullNode);
// Attach to parent
if (item < parent.element)
parent.left = current;
else
parent.right = current;
handleReorient( item );
}
private void handleReorient(int item)
{
// Do the color flip
current.color = RED;
current.left.color = BLACK;
current.right.color = BLACK;
if (parent.color == RED)
{
// Have to rotate
grand.color = RED;
if (item < grand.element != item < parent.element)
parent = rotate( item, grand ); // Start dbl rotate
current = rotate(item, great );
current.color = BLACK;
}
// Make root black
header.right.color = BLACK;
}
private RedBlackNode rotate(int item, RedBlackNode parent)
{
if(item < parent.element)
return parent.left = item < parent.left.element ? rotateWithLeftChild(parent.left) :
rotateWithRightChild(parent.left) ;
else
return parent.right = item < parent.right.element ? rotateWithLeftChild(parent.right) :
rotateWithRightChild(parent.right);
}
/* Rotate binary tree node with left child */
private RedBlackNode rot.
apple 2008 historically what were Apples major competitive advanta.pdfrozakashif85
apple 2008
historically what were Apples major competitive advantages and why did they fail to build on
these advantages to lead the industry?
Solution
Apples major competitive advantages:
Apple II and Macintosh were the machines that made Apple. They both had to following
features.
Brand loyalty among important segments
Reasons for why did Apple fail to build on these advantages to lead the industry:
Apple’s missteps:
Entry of Rivals:.
More Related Content
Similar to Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
Here are the instructions and then the code in a sec. Please R.pdfaggarwalshoppe14
Here are the instructions and then the code in a sec.
**Please Resubmit the revised and updated Code (GamerService) with Comments added
explaining please. RIGHT***** JAVA. HOWEVER IF YOU NEED TO CHANGE THE
ENTIRE THING IT IS FINE. I AM DESPERATE.
Part II. Java Application: Use the code you submitted in Project One Milestone to continue
developing the game application in this project. Be sure to correct errors and incorporate
feedback before submitting Project One.
Please note: The starter code for this project was provided in the Project One Milestone. If you
have not completed the Project One Milestone, you will not be penalized in this assignment, but
you will have additional steps to complete to ensure you meet all the components of Project One.
Review the class files provided and complete the following tasks to create a functional game
application that meets your clients requirements. You will submit the completed game
application code for review.
Begin by reviewing the base Entity class. It contains the attributes id and name, implying that all
entities in the application will have an identifier and name.
Software Design Patterns: Review the GameService class. Notice the static variables holding the
next identifier to be assigned for game id, team id, and player id.
Referring back to Project One Milestone, be sure that you use the singleton pattern to adapt an
ordinary class, so only one instance of the GameService class can exist in memory at any given
time. This can be accomplished by creating unique identifiers for each instance of a game, team,
or player.
Your client has requested that the game and team names be unique to allow users to check
whether a name is in use when choosing a team name. Referring back to the Project One
Milestone, be sure that you use the iterator pattern to complete the addGame() and getGame()
methods.
Create a base class called Entity. The Entity class must hold the common attributes and
behaviors (as shown in the UML diagram provided in the Supporting Materials section below).
Refactor the Game class to inherit from this new Entity class.
Complete the code for the Player and Team classes. Each class must derive from the Entity class,
as demonstrated in the UML diagram.
Every team and player must have a unique name by searching for the supplied name prior to
adding the new instance. Use the iterator pattern in the addTeam() and addPlayer() methods.
Functionality and Best Practices
Once you are finished coding, use the main() method provided in the ProgramDriver class to run
and test the game application to ensure it is functioning properly.
Be sure your code demonstrates industry standard best practices to enhance the readability of
your code, including appropriate naming conventions and in-line comments that describe the
functionality.
Here is my answer that I need a little improvement on its code since I am having trouble making
it right.
Here I am attaching code for these Files:
Entity.java
Game.java
Team.
Suggestion- Use Netbeans to copy your last lab (Lab 07) to a new proje.pdfssuser58be4b1
Suggestion:
Use Netbeans to copy your last lab (Lab 07) to a new project called Lab08.
Close Lab07.
Work on the new Lab08 project then.
The Student class
A Student is a Person with 3 extra attributes, major, academic year and gpa.
Attributes
String major
String academicYear
double GPA
Constructorsone constructor with no input parameterssince it doesn't have input parameters, use
the default data below
major - IST
academicYear - Sr.
GPA - 3.0
remember to call the constructor of the superclass with no parameters
one constructor with all the parameters
all three parameters from Student, one for each attribute
since this is a subclass, remember to include also the parameters for the superclass
Methods
Get and Set methods (a requirement from encapsulation)
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
important : in the subclass toString, remember to make a call to the superclass toString so that
the resulting String includes
data from the subclass Student
data from the superclass Person
The Person Class
Attributes
String firstName
String lastName
String hometown
String state
Height height
Constructorsone constructor with no input parameterssince it doesn't receive any input values,
you need to use the default values below:
firstName - No
lastName - Name
hometown - N/A
state - N/A
height - use the Height class no parameter constructor
one constructor with three parameters
firstName using the input parameter
lastName using the input parameter
height using the input parameter
use the default values for
hometown - N/A
state - N/A
one constructor with all (five) parameters
one input parameter for each attribute
Methods
Get and Set methods (a requirement from encapsulation)
important:
You should start generating the default get and set methods using NetBeans automatic generator
Then you will change getFirstName and setLastName as specified. getFirstName
returns firstName with the first letter in upper case and the remaining of the String in lower case
getLastName
getHometown
getState
getHeight
setFirstName
setLastName
updates lastName to be all caps (all upper case)
remember to use setLastName in all constructors so the data (the updated lastName) is stored
correctly
setHometown
setState
setHeight
public String toString()
returns this object as a String, i.e., make each attribute a String, concatenate all strings and return
as one String.
toString() is a special method, you will learn more about it in the next lessons
it needs to be public
it needs to have @override notation (on the line above the method itself). Netbeans will suggest
you do it.
regarding state , the toString method will have a similar functionality as App had in the first lab.
if t.
ReversePoem.java ---------------------------------- public cl.pdfravikapoorindia
ReversePoem.java :-
---------------------------------
public class ReversePoem {
/*This programs has you display a pessimistic poem from a list of phrases*/
// and then reverse the phrases to find another more optimistic poem.
public static void main(String[] args) throws Exception
{
//Queue object
MyQueue queue = new MyQueue<>();
//Stack object
MyStack stack = new MyStack<>();
//String buffer to apppend all Strings
StringBuffer sb = new StringBuffer();
// Create a single String object from the 16 Strings below
String set1 = \"I am part of a lost generation#and I refuse to believe that#\";
sb.append(set1);
String set2 = \"I can change the world#I realize this may be a shock but#\";
sb.append(set2);
String set3 = \"\'Happiness comes from within\'#is a lie, and#\";
sb.append(set3);
String set4 = \"\'Money will make me happy\'#So in 30 years I will tell my children#\";
sb.append(set4);
String set5 = \"they are not the most important thing in my life#\";
sb.append(set5);
String set6 = \"My employer will know that#I have my priorities straight because#\";
sb.append(set6);
String set7 = \"work#is more important than#family#I tell you this#\";
sb.append(set7);
String set8 = \"Once upon a time#Families stayed together#\";
sb.append(set8);
String set9 = \"but this will not be true in my era#\";
sb.append(set9);
String set10 = \"This is a quick fix society#Experts tell me#\";
sb.append(set10);
String set11 = \"30 years from now, I will be celebrating the 10th anniversary of my
divorce#\";
sb.append(set11);
String set12 = \"I do not concede that#I will live in a country of my own making#\";
sb.append(set12);
String set13 = \"In the future#Environmental destruction will be the norm#\";
sb.append(set13);
String set14 = \"No longer can it be said that#My peers and I care about this earth#\";
sb.append(set14);
String set15 = \"It will be evident that#My generation is apathetic and lethargic#\";
sb.append(set15);
String set16 = \"It is foolish to presume that#There is hope#\";
sb.append(set16);
String finalString = sb.toString();
String itmes[] = finalString.split(\"#\");
System.out.println(\"========== Original Phrase ==============\");
for(int i = 0 ; i < itmes.length;i++){
queue.enqueue(itmes[i]);
System.out.println(itmes[i]);
}
for(int i = 0 ; i < itmes.length;i++){
stack.push(queue.dequeue());
}
System.out.println(\"========== Reverse Phrase ==============\");
for(int i = 0 ; i < itmes.length;i++){
System.out.println(stack.pop());
}
/* You are given a list of phrases in Strings; the phrases
are separated by pound signs: \'#\':
1. Create a single String object from this list.
2. Then, split the String of phrases into an array of
phrases using the String split method.
3. Display a poem by walking through the array and
displaying each phrase one per line.
4. And, at the same time, place each phrase on a
MyQueue object using only the enqueue method.
5. After all the phrases have been placed on the queue,
transfer the phrases from the MyQueue object to a
MyS.
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR.pdfmallik3000
PLEASE MAKE SURE THE PROGRAM IS ASKING FOR INPUT FROM USER TO ADD
OR REMOVE NAME. DO NOT HARD CODE NAME. AGAIN MAKE SURE THE
PROGRAM IS ASKING FOR INPUT FROM USER TO ADD OR REMOVE NAME. PLEASE
MAKE SURE THE CODE RUNS WITHOUT ANY ERRORS.
Write a class that maintains the scores for a game application. Implement the addition and
removal function to update the database. The gamescore.txt contains player’ name and score data
record fields separated by comma. For Removal function, uses the name field to select record to
remove the game score record.
Use the List.java, LList.java, Dlink.java, GameEntry.java and gamescore.txt found below
Read gamescore.txt to initialize the Linked list in sorted order by score.
Ask the user to add or remove users to update the sorted linked list.
Display “Name exist” when add an exist name to the list.
Display “Name does not exist” when remove a name not on the list.
List.java File:
/** Source code example for \"A Practical Introduction to Data
Structures and Algorithm Analysis, 3rd Edition (Java)\"
by Clifford A. Shaffer
Copyright 2008-2011 by Clifford A. Shaffer
*/
/** List ADT */
public interface List
{
/**
* Remove all contents from the list, so it is once again empty. Client is
* responsible for reclaiming storage used by the list elements.
*/
public void clear();
/**
* Insert an element at the current location. The client must ensure that
* the list\'s capacity is not exceeded.
*
* @param item
* The element to be inserted.
*/
public void insert(E item);
/**
* Append an element at the end of the list. The client must ensure that
* the list\'s capacity is not exceeded.
*
* @param item
* The element to be appended.
*/
public void append(E item);
/**
* Remove and return the current element.
*
* @return The element that was removed.
*/
public E remove();
/** Set the current position to the start of the list */
public void moveToStart();
/** Set the current position to the end of the list */
public void moveToEnd();
/**
* Move the current position one step left. No change if already at
* beginning.
*/
public void prev();
/**
* Move the current position one step right. No change if already at end.
*/
public void next();
/** @return The number of elements in the list. */
public int length();
/** @return The position of the current element. */
public int currPos();
/**
* Set current position.
*
* @param pos
* The position to make current.
*/
public void moveToPos(int pos);
/** @return The current element. */
public E getValue();
}
LList.java File:
/**
* Source code example for \"A Practical Introduction to Data Structures and
* Algorithm Analysis, 3rd Edition (Java)\" by Clifford A. Shaffer Copyright
* 2008-2011 by Clifford A. Shaffer
*/
// Doubly linked list implementation
class LList implements List
{
private DLink head; // Pointer to list header
private DLink tail; // Pointer to last element in list
protected DLink curr; // Pointer ahead of current element
int cnt; // Size of list
// Constructors
LList(int size)
{
th.
I dont know what is wrong with this roulette program I cant seem.pdfarchanaemporium
I don\'t know what is wrong with this roulette program I can\'t seem to get it to run.
Game Class:
public class Game {
public static void main(String[] args) {
Table table = new Table();
BinBuilder bb = new BinBuilder();
Outcome black = new Outcome(\"Black\", 35);
Bet bet = new Bet(10, black);
table.placeBet(bet);
Bin bin = bb.wheel.get(8);
System.out.println(bin.toString());
System.out.println(table.bets.toString());
System.out.println(black.toString());
ListIterator i = table.bets.listIterator();
Iterator b = bin.outcomes.iterator();
while(i.hasNext()) {
System.out.println(i.next().outcome.name.toString());
while(b.hasNext()){
System.out.println(b.next().name.toString());
if(i.next().outcome.equals(b.next())){
System.out.println(\"Win!\");
}
else{
System.out.println(\"Win :/\");
}
}
}
}
}
Player Class
public class Player {
public Table table;
public Outcome black;
public Bet bet;
public Player(Table table) {
table = new Table();
black = new Outcome(\"Black\", 1);
}
void placeBets() {
Bet bet = new Bet(100, black);
table.placeBet(bet);
}
void win(Bet bet) {
System.out.println(\"You\'ve won: \" + bet.winAmount());
}
void lose(Bet bet) {
System.out.println(\"You lost!\" + bet.loseAmount() + \":/\");
}
}
Outcome class
public class Outcome implements Comparable {
public String name;
public int odds;
public Outcome(String name, int odds){
this.name = name;
this.odds = odds;
}
public int winAmount(int amount){
return amount*this.odds;
}
public boolean equals(Outcome other){
return (this.name.equals(other.name));
}
public String toString() {
Object[] values= { name, new Integer(odds) };
String msgTempl= \"{0} ({1}:1)\";
return MessageFormat.format( msgTempl, values );
}
@Override
public int compareTo(E arg0) {
if(this.equals(arg0)){
return 0;
}
return 1;
}
}
Table Class
public class Table {
public int limit = 1000;
public LinkedList bets;
public Table() {
bets = new LinkedList();
}
public boolean isValid(Bet bet) {
int sum = 0;
for(Bet bett: bets) {
sum += bett.amountBet;
}
return (sum>limit);
}
public void placeBet(Bet bet) {
bets.add(bet);
}
ListIterator iterator() {
return bets.listIterator();
}
}
Wheel Class
public class Wheel extends TreeSet {
Vector bins;
NonRandom rng;
Set all_outcomes;
Wheel(NonRandom rng){
this.rng = rng;
rng = new NonRandom();
all_outcomes = new TreeSet();
bins = new Vector(38);
for (int i=0; i<38; i++){
bins.add(i, new Bin());
}
}
Bin next(){
int rand = rng.next(38);
return bins.elementAt(rand);
}
Bin get(int bin){
return bins.elementAt(bin);
}
public Outcome getOutcome( String name ){
TreeSet result= new TreeSet();
for( Iterator i = all_outcomes.iterator(); i.hasNext(); ) {
Outcome oc= i.next();
if( oc.name.contains(name) ) {result.add( oc );}
}
return result.first();
}
public void addOutcome(int bin, Outcome outcome) {
all_outcomes.add(outcome);
this.bins.elementAt(bin).add(outcome);
}
}
Bet Class
public class Bet {
public int amountBet;
public Outcome outcome;
public Bet(int amount, Outcome outcome) {
this.outcome = o.
Give background information concerning EMT and include what is known.pdfrozakashif85
Give background information concerning EMT and include what is known about EMT in normal
development as well as in neoplasms. What are strategies that could be used to overcome drug
resistance in cancer cells by targeting EMT (minimum four paragraphs).
Solution
Answer:
Cancer stem cell (CSC) hypothesis: This hypothesis elucidating that the CSC are the
subpopulation and able to exert higher resistance associated with explicit capability to self-renew
finally to differentiate into different offspring of cancer cells to generate a tumor. This
hypothesis is based on the cellular mechanisms exclusively developed inside the CSC to exert
resistance such pathways are mainly through Wnt signaling, Notch signaling. There are other
targets to regulate proliferation and differentiation through ABC transporter system and receptor
tyrosine kinases. These targets are the future stem cells anti-cancer therapies in regulating the
proliferation & differentiation of cancer cells as CSCs have a potential relationship with
epithelial-mesenchymal transition (EMT).
Metastasis has many steps. The main cancer cell morphological features that support invasion,
intravasation, and extravasation are epithelial-mesenchymal transition via cell -adhesion
molecules. Invasion is mainly due to presence of cell adhesion molecules such as integrins on the
cancer cells finally promote the movement of cancer cells to another region. This process is
going to connect adjacent cells to tumor cells finally undergo epithelial-mesenchymal transition
(EMT) result in formation of \"continuously dividing neoplasms\" with higher drug resistence to
cure compared to normal cells
Strategies that could be used to overcome drug resistance in cancer cells by targeting EMT:
\"A combination therapy of neutraceuticals & chemotherapeutic agents\" are most promising
strategies to overcome drug resistance in cancer cells by targeting EMTs, cancer stem cells
(CSC) &
Modulation of microRNAs do promote effective strategy to overcome drug resistance in cancer
cells
Oligonucletodie deliver: Another strategy could be used to overcome drug resistance in cancer
cells by targeting EMT. In this method, synthesized microRNAs are going to make in the form of
\"nanoparticle or microsomal\" formulation finally used to target microRNAs in cancer cells
result in \"complete destruction of pre-mRNA\" finally there will no translation mechanism to
synthesize \"cell survival proteins\" to proliferate.
Explain how the current economic recession differs from the depressio.pdfrozakashif85
Explain how the current economic recession differs from the depression in the 1930\'s.
Solution
The Great depression was worldwide. It was due to the collapse of the international financial
system It also resulted from the mutual adoption by many countries ( including USA) of high-
tariff policies, which were intended to keep out foreign goods in order to protect domestic
producers. The policies were called \"beggar thy neighbour\" strategies since they attempted to
\"export\" unemployment by improving one country\'s trade position and hence demand for its
goods at the expense of its trading partners And , of course, if each country keeps out foreign
goods, the volume of world trade declines, providing a contractionary influence on the world
economy
Almost every country suffered a deep recession in the 1930s, but some countries did better than
USA Sweden began an expansionary policy in the early 1930s and reduced its unemployment
relatively quicker Britain\'s economy suffered high unemployment but in 1931 it went off the
gold standard and the ensuing devaluation of the pound sterling set the stage for some
improvement. Germany grew rapidly after Hitler came to power and expanded government
spending. China escaped the recession until after 1931, because it had a floating exchange rate.
In 1938, real GNP in US rose above its 1929 level for the first time in the decade, but it was not
until 1942 , after the US formally entered world war II , that the unemployment rate finally fell
below 5%
The experience of the US in the early 1980s- the worst recession since the Great Depression,
casts doubt on the optimistism of recovery. During the 1980s, the US experienced the largest
sustained budget deficits in its peacetime history. Even so cutting spending or raising taxes was
not politically popular. Gradually, in the 1990s, the deficit began to be brought under control,
and toward the end of the decade the budget swung into surplus.This was due to raising the
prices and government spending.
By,
Nishant Bhatt.
Does yeast uses CopI and CopII formation for vesicle budding to grow.pdfrozakashif85
Does yeast uses CopI and CopII formation for vesicle budding to grow asexually?Is CopII starts
from the er then goes out the cell and CopI works for the molecules comes in the cell and goes to
nucleus?Does copII carries proteins away to make the budding?Please explain in details.
Solution
Yes, yeasts reproduce asexually by an asymmetric division process known as budding. Initially,
yeast forms a small protuberance which then grows to a full size and forms a bud. Then the
nucleus splits and migrates into the daughter cell. After the movement of nucleus, the entire bud
detaches from the parent cell by forming a constriction at the base. This process will repeat until
a chain of bud cells are formed..
DNA molecules consist of chemically linked sequences of the bases ad.pdfrozakashif85
DNA molecules consist of chemically linked sequences of the bases adenine, guanine, cytosine
and thymine, denoted A, G, C and T. A sequence of three bases is called a codon. A base may
appear more than once in a codon.
1) Represent all possible base sequences using a tree diagram.
2) How many different codons are there?
3) The bases A and G are purines, while C and T are pyrimidines. How many codons are there
whose first and third bases are purines and whose second base is a pyrimidine?
4) How many codons consist of three different bases?
Solution.
Data StructuresPLEASE USING THIS C++ PROGRAM BELOW, I NEED HEL.pdfrozakashif85
Data Structures
PLEASE USING THIS C++ PROGRAM BELOW, I NEED HELP ON IMPLEMENTING
BOTH QUEUE AND STACK TO PRINT \"I able\"
REVERSE/BACKWARDS(PALINDROME)
#include
#include
using namespace std;
struct st
{
int year;
st *next;
};
class queue
{
public:
int sz,i = 0;
char chr[100];
queue()
{
//constructor for initializing front and rear to NULL
front = NULL;
rear = NULL;
cout << \"enter size of queue: \";
cin >> sz;
}
// ~queue()
// {
//
// }
// in the enterqueue, create a new node, assign value and add it to queue
// if F = R = NULL the ( ) else ( )
void enterqueue(int yr, char el)
{
//inserting into queue if queue not overflow
if(i >= sz)
{
cout << \"queue over flow\";
return;
}
if (front == NULL )
{
front = new st;
front->next = NULL;
front->year = yr;
rear = front;
chr[i] = el;
i++;
}
else
{
st *temp = new st;
temp->year = yr;
rear->next = temp;
rear = temp;
chr[i] = el;
i++;
}
}
char deletequeue()
{
//delete front data from queue if data in the queue
char tr;
int j = 0;
st *temp;
temp = front;
if( front == NULL)
{
cout << \"queue under flow\";
return \'a\';
}
if(front == rear)
{
front = rear = NULL;
return \'a\';
}
front = front->next;
delete temp;
tr = chr[0];
i--;
for(j = 0; j < i; j++)
{
chr[j] = chr[j+1];
}
chr[j] = \'\\0\';
return tr;
}
bool isempty()
{
//it shows whether queue is empty
if( front == NULL)
{
return true;
}
else
return false;
}
bool isfull()
{
//it shows whether queue is full
if(i == sz)
return true;
else
return false;
}
void display()
{
//it displays queue data with characters of queue if invalid choice is entered
st *tmp;
int j = 0;
cout << \"\ queue is:\ character \\tyear\";
for(tmp = front; tmp != rear; tmp = tmp->next, j++)
{
cout << \"\ \" << chr[j] << \" \" << tmp->year;
}
cout << \"\ \"<year;
}
private:
st *front, *rear;
};
int main()
{
//main method to call queue functions by choice
queue s1;
int ch,yr;
char el;
bool s;
while(1)
{
cout << \"\ 1.ENTERQUEUE\ 2.DELETEQUEUE\ 3.ISEMPTY\ 4.ISFULL\ 5.EXIT\ enter
your choice: \";
cin >> ch;
switch(ch)
{
case 1:
if(!s1.isfull())
{
cout << \"\ enter a year : \";
cin >> yr;
cout << \"\ enter a character : \";
cin >> el;
s1.enterqueue(yr, el);
}
else
cout << \"insertion not possible\";
break;
case 2:
s = s1.isempty();
if(!s)
{
el = s1.deletequeue();
cout << \"\ The character of queue \" << el <<\" is deleted\" << endl;
}
else
cout << \"\ queue is empty.deletion not possible\"<< endl;
break;
case 3:
s = s1.isempty();
if(s)
cout << \"\ queue is empty\" << endl;
else
cout << \"\ queue is not empty\" << endl;
break;
case 4:
s=s1.isfull();
if(s)
cout << \"\ queue is full\" << endl;
else
cout << \"\ queue is not full\" << endl;
break;
case 5:
exit(0);
default : cout << \"invalid choice\" << endl;
if(!s1.isempty())
s1.display();
}
}
return (0);
}
Solution
#include
#include
using namespace std;
struct st
{
int year;
st *next;
};
class queue
{
public:
//int sz,i=0;//modified //code modified here// everything is fine with the code except this...
queue is implemented correctly
//you can .
Count Red Nodes. Write a program that computes the percentage of red.pdfrozakashif85
Count Red Nodes. Write a program that computes the percentage of red nodes in a given red-
black BST. Test your program by running at least 100 trials of the experiment of inserting N
random keys into an initially empty tree, for N = 10^4, 10^5, 10^6, and formulate an hypothesis.
*It is experiment from textbook Algorithms, 3.3.42
Does anyone know the answer?
Solution
/*
* Java Program to Implement Red Black Tree
*/
import java.util.Scanner;
/* Class Node */
class RedBlackNode
{
RedBlackNode left, right;
int element;
int color;
/* Constructor */
public RedBlackNode(int theElement)
{
this( theElement, null, null );
}
/* Constructor */
public RedBlackNode(int theElement, RedBlackNode lt, RedBlackNode rt)
{
left = lt;
right = rt;
element = theElement;
color = 1;
}
}
/* Class RBTree */
class RBTree
{
private RedBlackNode current;
private RedBlackNode parent;
private RedBlackNode grand;
private RedBlackNode great;
private RedBlackNode header;
private static RedBlackNode nullNode;
/* static initializer for nullNode */
static
{
nullNode = new RedBlackNode(0);
nullNode.left = nullNode;
nullNode.right = nullNode;
}
/* Black - 1 RED - 0 */
static final int BLACK = 1;
static final int RED = 0;
/* Constructor */
public RBTree(int negInf)
{
header = new RedBlackNode(negInf);
header.left = nullNode;
header.right = nullNode;
}
/* Function to check if tree is empty */
public boolean isEmpty()
{
return header.right == nullNode;
}
/* Make the tree logically empty */
public void makeEmpty()
{
header.right = nullNode;
}
/* Function to insert item */
public void insert(int item )
{
current = parent = grand = header;
nullNode.element = item;
while (current.element != item)
{
great = grand;
grand = parent;
parent = current;
current = item < current.element ? current.left : current.right;
// Check if two red children and fix if so
if (current.left.color == RED && current.right.color == RED)
handleReorient( item );
}
// Insertion fails if already present
if (current != nullNode)
return;
current = new RedBlackNode(item, nullNode, nullNode);
// Attach to parent
if (item < parent.element)
parent.left = current;
else
parent.right = current;
handleReorient( item );
}
private void handleReorient(int item)
{
// Do the color flip
current.color = RED;
current.left.color = BLACK;
current.right.color = BLACK;
if (parent.color == RED)
{
// Have to rotate
grand.color = RED;
if (item < grand.element != item < parent.element)
parent = rotate( item, grand ); // Start dbl rotate
current = rotate(item, great );
current.color = BLACK;
}
// Make root black
header.right.color = BLACK;
}
private RedBlackNode rotate(int item, RedBlackNode parent)
{
if(item < parent.element)
return parent.left = item < parent.left.element ? rotateWithLeftChild(parent.left) :
rotateWithRightChild(parent.left) ;
else
return parent.right = item < parent.right.element ? rotateWithLeftChild(parent.right) :
rotateWithRightChild(parent.right);
}
/* Rotate binary tree node with left child */
private RedBlackNode rot.
apple 2008 historically what were Apples major competitive advanta.pdfrozakashif85
apple 2008
historically what were Apples major competitive advantages and why did they fail to build on
these advantages to lead the industry?
Solution
Apples major competitive advantages:
Apple II and Macintosh were the machines that made Apple. They both had to following
features.
Brand loyalty among important segments
Reasons for why did Apple fail to build on these advantages to lead the industry:
Apple’s missteps:
Entry of Rivals:.
A partial results from a PERT analysis for a project with 50 activit.pdfrozakashif85
A partial results from a PERT analysis for a project with 50 activities shows that path A-K-Q
Solution
There are 50 activities shows the path A-K-Q.
With the help of PERT (Program Evaluation and Review Technique), and CPM (Critical Path
Method), the project manager can
1. Plan the project ahead of time and foresee possible sources of troubles and delays in
completion.
2. Schedule the project activities at the appropriate times to conform with proper job sequence so
that the project is completed as soon as possible.
3. Coordinate and control the projects activities so as to stay on schedule in completing the
project.
Thus PERT incorporates uncertainties in activity times in its analysis. It determines the
probabilities of completing various stages of the project by specified deadlines. It also calculates
the expected time to complete the project. An important and extremely useful by product of
PERT analysis is its identification of various “bottlenecks” in a project.
Application of PERT and CPM
A partial list of applications of PERT and CPM techniques is
1. Construction projects (e.g., buildings, highways, houses, and bridges)
2. Preparation of bids and proposals for large projects.
3. Maintenance planning of oil refineries, ship repairs, and other large operations.
4. Development of new weapons systems and new manufactured products.
5. Manufacture and assembly of large items such as airplanes, ships, and computers. 6. Simple
projects.
Six steps :
1. Define the projects and all of its significant activities or tasks.
2. Develop the relationships among the activities. Decide which activities must precede and
which must follow others.
3. Draw the network connecting all of the activities.
4. Assign time and/or cost estimates to each activity.
5. Compute the longest time path through the network; this is called the critical path.
6. Use the network to help plan, schedule, monitor and control the project..
briefly write about the variability of natural systems and the signi.pdfrozakashif85
briefly write about the variability of natural systems and the significance of the rate of change
and predictability to the stability and functioning of ecological systems
Solution
Answer:- The natural ecological systems are usually variable in physical and biological
characteristics that are always in dynamic equilibrium with their biota. The ecological systems
which diverse both in eveness and richness of species are usually stable and less prone to
extinction and resist the disturbances created by any external agency. The keystone species play
an important role in the ecosystem functioning and overall community stability. Thus variability
and stability are essential for functioning of ecological systems..
A graph is symmetric with respect to the vertical line corresponding.pdfrozakashif85
A graph is symmetric with respect to the vertical line corresponding to t= pi/2 and r > 0. What
does this say about the algebraic symmetry of the function?
A. r(t)=r(pi-t)
B. r(t)=r(-t)
C. r(t)=r(pi/2-t)
D. r(t)=-r(t)
Solution
Symmetrical wrt to vertical line: t=pi/2 and r>0
which above the horizontal axisi.e. 0--- pi rad
So, it means r(t) = r(180 -t) = r(pi -t)
Option A.
X-Linked Recessive Write three rules to keep in mind when counseling .pdfrozakashif85
X-Linked Recessive Write three rules to keep in mind when counseling someone about the
likelihood of inheriting an X-linked recessive condition: About parents\' genotype. About
parents\' phenotype. About the probability of the offspring showing the trait. If instead of having
Hemophilia C (autosomal recessive), Lisa Keller\'s brother had Hemophilia A (X-linked
recessive), what would be the probability that she was a carrier? 25% 50% 67% 100% More
information is required to answer this question.
Solution
About genotype of parents- If the mother is a carrier i.e. carrying the recessive allele on one of
her X chromosome and the father do not have the recessive allele in his genotype, then none of
the daughters will suffer from the disease (since they will inherit only one recessive allele from
the mother) but sons will have a 50% probability of suffering from the disease as they will
inherit the recessive allele from the mother and the Y chromosome from the father, although
there is a 50% probability of inheriting the wild type allele from the mother.
Now if the mother is suffering from the disease i.e. has the recessive allele on both the X
chromosome while the father is healthy having no allele for the disease, the daughters will
always be a carrier but never suffer from the disease as they eill inherit the healthy wild type
allele from the father as one X chromosome comes from the father and the other X chromosome
from the mother. The sons will however all suffer from the disease as they inherit the Y
chromosome from the father and the X chromosome having the recessive allele causing the
disease will be inherited from the mother.
Now suppose the mother is a carrier i.e. carries the recessive allele only on one X chromosome
but the father suffers from the disease making his genotype XrY (Xr denoting recessive allele
carrying X chromosome), then, 50%of their son will duffer from the disease while 50% of the
daughters will also have a chance of suffering from the disease.
If both the parents do not have a single recessive X linked disease gene on any of their X
chromosome then none of the children will suffer from the disease.
About phenotype of parents- If the mother is a carrier i.e. have the diseased allele on only one X
Chromosome, then the phenotype of mother will be normal. But the father can never be a carrier
for a X linked recessive disease as males have only one X chromosome. If the diseased allele in
present on that X chromosome in males it will be expressed as there is no dominant healthy wild
type allele to dominate the diseased gene. Thus if the father has the recessive diseased allele on
X chromosome, the father\'s phenotype will be expresding the disease while if the father do not
have the allele he will be healthy. On the other hand for the mother to express the disease the
recessive allele has to be present on bith her X chromosome.
Probability of offsprings showing the trait- If mother is a carrier and father is normal, then 5.
Write a Java Class to Implement a Generic Linked ListYour list mus.pdfrozakashif85
Write a Java Class to Implement a Generic Linked List
Your list must be implemented as a singly-linked list of generic nodes, where each Node object
has two instance variables: an object of the “type variable” class, and a pointer to the next node
on the list.
Your class will contain separate methods to handle each of the operations read from a data file
(see II., below)
Your class will also override toString() to return the objects on the list in the order in which they
occur.
Write a Test Class for Your LinkedList Class
Your main method will read list operation instructions from a data file, until end-of-file and call
the appropriate LinkedList method to execute each one.
After each operation is executed, print out the operation and the updated list.
The data file to be used is on the class web site and the operations are:
APPEND X - Append object X to the end of the list
ADD N X - Insert object X as the new Nth element in the list, increasing the size of the list by 1
E.g. Suppose the list is:
head -> 1 -> 2 -> 3 -> 4->null
After ADD 3 7 it would be:
head -> 1 -> 2 -> 7 -> 3 -> 4->null
DELETE N – Remove the Nth object from the list
SWAP M N - Interchange the positions of the Mth and Nth
objects on the list
For credit, the two nodes must actually \"trade places\" in the list, and not merely swap their data
values
REVERSE - Reverse the order of the objects on the list
This must be done by reversing the order of the nodes themselves, rather than by swapping the
data stored
To get credit for your reverse() method, it must use either one of these 2 algorithms:
For each node on the list except the current “head”
node, delete the node and insert it as the new head
Use your swap() method
6. CLEAR – Clear the list (make it empty)
No credit will be given for programs that use any additional data structures – either from the Java
API or programmer defined -, other than your own LinkedList class
txt file:
Solution
//Java Program to Implement Singly Linked List
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
/* Class Node */
class Nodes
{
protected Object data;
protected Nodes next;
/* Constructor */
public Nodes()
{
next = null;
data = null;
}
/* Constructor */
public Nodes(Object d,Nodes n)
{
data = d;
next = n;
}
/* Function to set link to next Node */
public void setLink(Nodes n)
{
next = n;
}
/* Function to set data to current Node */
public void setData(Object d)
{
data = d;
}
/* Function to get link to next node */
public Nodes getLink()
{
return next;
}
/* Function to get data from current Node */
public Object getData()
{
return data;
}
}
/* Class linkedList */
class linkList
{
protected Nodes start;
protected Nodes end ;
public int size ;
/* Constructor */
public linkList()
{
start = null;
end = null;
size = 0;
}
/* Function to check if list is empty */
public boolean isEmpty()
{
return start == null;
}
/* Function to get size of list */
public int getSize()
{
return .
Which of the following would you expect to happen in a plant that doe.pdfrozakashif85
Which of the following would you expect to happen in a plant that does not have enough water
(multiple answers are correct) Without water, the plant cannot make the sugar it needs to grow
the stem begins to dry out growth would be stunted because it is difficult to move nutrients
around Without water, the plant would become limp.
Solution
Answer: All the choices given are correct! If Plant that does not have enough water;
(a) Without water, plants cannot make the sugar it needs to grow.
Plants make their own food by the process of photosynthesis.The amount of water, sunlight and
carbon dioxide directly influences the process of food production for plant growth. Thus the
process of photosynthesis slows down and even stops when water is absent, which causes
internal food supplies to diminish.
(b) the stem begins to dry out
Scarcity of water leads to loss of turgor pressure. Stomata on the stem surface close as a result of
less water (for water conservation) and as a result stem dries out.
(c) the growth would be stunted because it is difficult to move nutrients around.
As water moves above the plant system it carries vital minerals and nutrients to different areas of
the plant. The stomas on the leaf and stem surface release waste products (oxygen) into the
environment and takes CO2 in. This process of transpiration maintains the turgor pressure and
also cools the plant in sunlight. In scarcity of water, transpiration process slows and, the plant
show stunded growth due to lack of nutrients supply.
(d) Without water the plant would become limp
Turgor pressure holds the plant cells and keeps them erect. This pressure is lost without water
and plants begin to collapse (wilting!) or give a limp appearance..
What is the value of including personal information about yourself a.pdfrozakashif85
What is the value of including personal information about yourself and your lifestyle when
researchers are looking at your DNA? How does study different than many other similar sets of
data gathered from GWAS and SNP Haplotypes?What do you think about the scope and purpose
of this type of genetics data study.
Solution
Answer to including personal information and lifestyle lies in phenotype differences. Phenotype
is influenced by genotype and environment. Hence although scientists and researchers look for
DNA or genetic material of an individual but also take a look on the environmental conditions or
life style which influences the phenotype of an organism.
GWAS (Genome wide association study) is study of genetic variants which are associated with a
trait like any major disease. By using SNPs (Short nuclear polymorphisms) short interspersed
regions can be identified to locate the traits of interest. The environmental factors like sunlight
can differ the response of an individual to it. One individual can be sensitiove to it but the other
could be diseased on exposure to sunlight, thus having a knowledge about individual\'s lifestyle
helps in tracking previous information.
The scope of GWAS has wider implications. Disease dignosis using genetics data helps in
developing drugs relating to it. It can be used to identify genes from different organisms.
Ancestral hierarchy can be established..
What is a voluntary response sampleSolutionVoluntary response.pdfrozakashif85
What is a voluntary response sample?
Solution
Voluntary response sampling is heavily biased because it focuses on volunteered survey answers
rather than a random sampling. What makes this biased is because the only people who volunteer
are those who have a particular interest in the topic of the survey. They only include people who
choose volunteer, whereas a random sample would need to include people whether or not they
choose to volunteer. Often, voluntary response samples oversample people who have strong
opinions and undersample people who don\'t care much about the topic of the survey. Thus
inferences from a voluntary response sample are not as trustworthy as conclusions based on a
random sample of the entire population under consideration..
What adaptive benefit do these abilities give wolbachia In oth.pdfrozakashif85
What adaptive benefit do these abilities give wolbachia? In other words, why does manipulating
the host reproduction help its survival survival as parasite?
What adaptive benefit do these abilities give wolbachia? In other words, why does manipulating
the host reproduction help its survival survival as parasite?
What adaptive benefit do these abilities give wolbachia? In other words, why does manipulating
the host reproduction help its survival survival as parasite?
Solution
Manipulating the host reproduction help its survival as parasite.The improvement of complex
lifestyles cycles can growth parasite health. Some parasites have, via host manipulation, further
improved their reproductive success. Host manipulation in a few parasites, where they
effectively can change the behavior or morphology of their intermediate host in a way that
increases the parasite\'s trophic transmission
It is a method of parasite transmission wherein the parasite manipulates the behavior of its host
to growth transmission success to better trophic levels.
Think about autumn (Fall season) in places like New England (Pennsyl.pdfrozakashif85
Think about autumn (Fall season) in places like New England (Pennsylvania, New York,
Vermont, New Hampshire), where the leaves change color with the seasons. During the fall,
which pigments are the first to be broken down in the leaves? How does that explain the fall
colors we see? Why does the green color disappears during autumn (Fall season)? Please fully
and clearly explain why the green color disappeares in trees located in New England during the
autumn.
Solution
A number of factors play crucial role in changing the color of leaves in winter. Some are listed
below:
Similar is the reason with the New England trees..
The orange is which type of fruit Simple - Legume Simple - Drupe .pdfrozakashif85
The orange is which type of fruit? Simple - Legume Simple - Drupe Simple - Berry Multiple
Aggregate The peas is which type of fruit? Simple - Legume Simple - Drupe Simple - Berry
Multiple Aggregate The pistachio is which type of fruit? Simple - Legume Simple - Drupe
Simple - Berry Multiple Aggregate
Solution
Please find the answers below and reasons in parentheses:
Answer 22: Chocie 3 (Botanically, orange fruit is considered as a multiple aggregate of berry and
the juicy part or pulp is considered as succulent testa of the ovary. The peel of orange is
considered as ovarian wall.)
Answer 23: Choice 1 (A pea pod is considered as a simple legume by botanical nature. It can
open across both walls which eliminates the seeds inside the pod)
Answer 24: Choice2 (Pistachios belong to family of cashew or family Anacardiaceae
botanically. The fruits of this family are simple drupes in nature. These fruits contain the ovarian
wall as the hard covering of the fruit and the ovary itself modifies into edible seed).
The _________ is the protective chamber that houses the ovule and Lat.pdfrozakashif85
The _________ is the protective chamber that houses the ovule and Later matures to become the
fruit. A. Petal B. Ovary C. Carpel D. Stigma E. Sepals. What adaptation enhances bird\'s
flying ability? A. hollow bones B. sternum. C. air sacs D. homeothermy E. all of the above.
What plant characteristics are adaptations to land? A. internal fertilizations B. vascular tissues.
C. seeds with waterproof coats. D. waxy leaves. E. all of the above. Which of which is
characteristic of alternation of generation in land plants? A. haploid sporophytes make haploid
spores. B. gametophytes produce spores that develop into gametes C. sporophytes and
gametophytes are typically similar in appearance. D. meiosis in sporophytes produces haploid
spores. E. either the gametophyte or the sporophyte is unicellular. The haploid stage in a plant
life in a plant life cycle is called A. embryo B. zygote C. gametophyte D. sporophyte E.
conspicuous Animals in which the blastopo
Solution
31. ovary is the protective chamber that houses the ovule and later matures the fruit
32. tha hollow bones, air sacs , the sternum and homeothermy helps the birds to fly. the hollow
bones helps in reducing the body weight which helps in flying. the air sacs are responsible for
extracting more oxygen which hepls them to frly high. the sternum bones are present in the
wings which are strong and flexible for the movement of the wings
33. all of the above are the plants characteristics for the plant to adapt land
34.
35. the haploid stage of plant life in plant life cycle is known as gametophyte.
36.in protostomes the blastopore becomes the mouth.
Suppose X follows a normal distribution with mean=1 and variance=4. .pdfrozakashif85
Suppose X follows a normal distribution with mean=1 and variance=4. Let\'s randomly select 4
numbers from X. What is the distribution of the mean of these four numbers? What is the
probability that the mean is between -1 and 1?
Solution
The distribution of mean is also normal distribution with mean 1 and variance 1
Probability that the mean is between -1 and 1 is 0.47725.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Write a class (BasketballTeam) encapsulating the concept of a tea.pdf
1. Write a class (BasketballTeam) encapsulating the concept of a team of basketball players. This
method should have a single instance variable which is an array of basketball player objects. In
addition to that class, you will need to design and a code a Playerclass to encapsulate the concept
of a basketball player, assuming a basketball player has the following attributes: a name, a
position, number of shots taken, and number of shots made.
In your Player class you should write the following methods:
A constructor taking a String for the name, a String for the position, an int for the number of
shots taken, and an int for the number of shots made.
Accessor, mutator, toString, and equals methods.
A method returning the individual shooting percentage. Avg = Shots Made / Shots Taken. Hint:
This method should return a double!!!
In your BasketballTeam class you should write the following methods:
A constructor taking an array of Player objects as its only parameter and assigning that array to
the array data member of the class, its only instance variable.
Accessor, mutator, toString, and equals methods.
A method checking if all positions are different, returning true if they are, false if they are not.
A method returning the shooting percentage of the team. Team Shooting Percentage = Total
Shots Made / Total Shots Taken Hint: This should return a double!!! Also, this is not the average
of the the averages.
A method checking that we have a center (that is, the name of the position) on the team. If we
do not have any return false; otherwise, it returns true;
A method returning void that sorts the array of Player objects in ascending order using the
number of shots taken as the sorting key.
A method returning the array of Player objects sorted in ascending alphabetical order by name.
Hint: Use compareTo method of the String class.
A method returning the name of the player with the most shots made.
A method returning the name of the player with the highest shooting average.
In your BasketballTeamClient class, when you test all your methods, you can hard-code five
basketball Player objects. This client should call all 12 methods including the constructor for full
credit.
When writing the Player class you should write a PlayerClient class that tests all its methods
before integrating into BasketballTeam class.
Solution
2. public class Player {
//Attributes
private String name;
private String position;
private int shotsTaken;
private int shotsMade;
/**
* Constructor
* @param name
* @param position
* @param shotsTaken
* @param shotsMade
*/
public Player(String name, String position, int shotsTaken, int shotsMade) {
this.name = name;
this.position = position;
this.shotsTaken = shotsTaken;
this.shotsMade = shotsMade;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the position
*/
3. public String getPosition() {
return position;
}
/**
* @param position the position to set
*/
public void setPosition(String position) {
this.position = position;
}
/**
* @return the shotsTaken
*/
public int getShotsTaken() {
return shotsTaken;
}
/**
* @param shotsTaken the shotsTaken to set
*/
public void setShotsTaken(int shotsTaken) {
this.shotsTaken = shotsTaken;
}
/**
* @return the shotsMade
*/
public int getShotsMade() {
return shotsMade;
}
/**
* @param shotsMade the shotsMade to set
*/
public void setShotsMade(int shotsMade) {
this.shotsMade = shotsMade;
}
@Override
public String toString() {
return "Player name: " + getName() + "tPosition: " + getPosition() +
4. " Shots Taken: " + getShotsTaken() + "ttShots Made: " + getShotsMade();
}
@Override
public boolean equals(Object obj) {
if(obj != null) {
if(obj instanceof Player) {
Player another = (Player)obj;
if((this.getName().equalsIgnoreCase(another.getName())) &&
(this.getPosition().equalsIgnoreCase(another.getPosition())) &&
(this.getShotsMade() == another.getShotsMade()) &&
(this.getShotsTaken() == another.getShotsTaken()))
return true;
}
}
return false;
}
/**
* Returns the individual shooting percentage
* @return
*/
public double shootingPercentage() {
return ((double)getShotsMade() / getShotsTaken());
}
}
/**
* This class tests the methods of the Player class
*
* @author
*
*/
public class PlayerClient {
public static void main(String[] args) {
// Create a Player object
Player player1 = new Player("John", "Center", 10, 4);
5. // Create another Player object
Player player2 = new Player("Bill", "Small forward", 10, 3);
// Test toString and shootingPercentage method
System.out.println("Player 1: " + player1);
System.out.println("Shooting percentage: " + player1.shootingPercentage());
System.out.println("Player 2: " + player2);
System.out.println("Shooting percentage: " + player2.shootingPercentage());
// Test equals method
if(player1.equals(player2))
System.out.println("Both the players are same");
else
System.out.println("Both the players are different");
}
}
SAMPLE OUTPUT:
Player 1: Player name: John Position: Center
Shots Taken: 10 Shots Made: 4
Shooting percentage: 0.4
Player 2: Player name: Bill Position: Small forward
Shots Taken: 10 Shots Made: 3
Shooting percentage: 0.3
Both the players are different
public class BasketballTeam {
// Attributes
private Player[] players;
/**
* Constructors
*
* @param players
*/
public BasketballTeam(Player[] players) {
this.players = players;
}
/**
* @return the players
6. */
public Player[] getPlayers() {
return players;
}
/**
* @param players
* the players to set
*/
public void setPlayers(Player[] players) {
this.players = players;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (Player player : players) {
sb.append(player + " ");
}
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (obj != null) {
if (obj instanceof BasketballTeam) {
BasketballTeam another = (BasketballTeam) obj;
if (this.getPlayers().length == another.getPlayers().length) {
for (int i = 0; i < this.getPlayers().length; i++) {
if (!this.players[i].equals(another.players[i]))
break;
}
return true;
}
}
}
return false;
}
/**
7. * Checks if all positions are different, returns true if they are, false if
* they are not.
*
* @return
*/
public boolean isDifferentPosition() {
for (int i = 0; i < this.getPlayers().length - 1; i++) {
for (int j = i + 1; j < this.getPlayers().length; j++) {
if (this.players[i].getPosition().equals(this.players[j].getPosition()))
return false;
}
}
return true;
}
/**
* Returns the team's shooting percentage
*
* @return
*/
public double shootingPercentage() {
int teamShotsMade = 0;
int teamShotsTaken = 0;
for (Player player : players) {
teamShotsMade += player.getShotsMade();
teamShotsTaken += player.getShotsTaken();
}
return ((double) teamShotsMade / teamShotsTaken);
}
/**
* Checks whether the team has a center (that is, the name of the position)
* on the team. If yes returns true; otherwise, it returns false
*
* @return
*/
public boolean isCenterPresent() {
for (Player player : players) {
8. if (player.getPosition().equalsIgnoreCase("Center"))
return true;
}
return false;
}
/**
* Swaps 2 players
* @param p1
* @param p2
*/
private void swap(Player p1, Player p2) {
Player temp = new Player(p1.getName(), p1.getPosition(), p1.getShotsTaken(),
p1.getShotsMade());
p1.setName(p2.getName());
p1.setPosition(p2.getPosition());
p1.setShotsMade(p2.getShotsMade());
p1.setShotsTaken(p2.getShotsTaken());
p2.setName(temp.getName());
p2.setPosition(temp.getPosition());
p2.setShotsMade(temp.getShotsMade());
p2.setShotsTaken(temp.getShotsTaken());
}
/**
* Sorts the array of Player objects in ascending order using the number of
* shots taken as the sorting key.
*/
public void sortByShotsTaken() {
for (int i = 0; i < this.players.length - 1; i++) {
for (int j = i + 1; j < this.players.length; j++) {
if (this.players[i].getShotsTaken() > this.players[j].getShotsTaken()) {
swap(this.players[i], this.players[j]);
}
}
9. }
}
/**
* Returns the array of Player objects sorted in ascending alphabetical order by name.
* @return
*/
public Player[] sortByName() {
// Create copy os this array
Player[] sortedArr = new Player[this.players.length];
for (int i = 0; i < sortedArr.length; i++) {
sortedArr[i] = new Player(this.players[i].getName(), this.players[i].getPosition(),
this.players[i].getShotsTaken(), this.players[i].getShotsMade());
}
for (int i = 0; i < sortedArr.length - 1; i++) {
for (int j = i + 1; j < sortedArr.length; j++) {
if (sortedArr[i].getName().compareTo(sortedArr[j].getName()) > 0) {
swap(sortedArr[i], sortedArr[j]);
}
}
}
return sortedArr;
}
/**
* Returns the name of the player with the most shots made.
*/
public String playerWithMostShotsMade() {
int index = 0;
int max = this.players[0].getShotsMade();
for (int i = 1; i < this.players.length - 1; i++) {
if(max < this.players[i].getShotsMade()) {
max = this.players[i].getShotsMade();
index = i;
10. }
}
return this.players[index].getName();
}
/**
* Returns the name of the player with the highest shooting average
*/
public String playerWithHighestShootingAvg() {
int index = 0;
double max = this.players[0].shootingPercentage();
for (int i = 1; i < this.players.length; i++) {
double avg = this.players[i].shootingPercentage();
if(max < avg) {
max = avg;
index = i;
}
}
return this.players[index].getName();
}
}
/**
* This class tests the methods of BasketballTeam class
*
* @author
*
*/
public class BasketballTeamClient {
public static void main(String[] args) {
// Create Player array with 5 objects
Player[] players = new Player[5];
players[0] = new Player("Bill", "Center", 10, 2);
players[1] = new Player("Joe", "Point guard", 10, 7);
players[2] = new Player("Andrew", "Shooting guard", 20, 2);
players[3] = new Player("James", "Power forward", 20, 12);
players[4] = new Player("Ben", "Small forward", 10, 4);
11. // Test the constructor
BasketballTeam team = new BasketballTeam(players);
// Display team
System.out.println("Team: " + team);
System.out.println();
// Check if all positions are different
System.out.println("Are all positions different? " + (team.isDifferentPosition() ? "Yes" :
"No"));
System.out.println();
// Team Shooting Percentage
System.out.println("Team Shooting Percentage: " + team.shootingPercentage());
System.out.println();
// Check if center position is present
System.out.println("Is center player available: " + (team.isCenterPresent() ? "Yes" :
"No"));
System.out.println();
// Sort array using the number of shots taken
team.sortByShotsTaken();
System.out.println("Sorted team using the number of shots taken as the sorting key: " +
team);
System.out.println();
// Sort team in ascending alphabetical order by name.
Player[] sortedArr = team.sortByName();
System.out.println("Sorted team in ascending alphabetical order by name: " );
for (Player player : sortedArr) {
System.out.println(player);
}
System.out.println();
// Player with the most shots made.
System.out.println("Player with the most shots made: " +
team.playerWithMostShotsMade());
System.out.println();
// Player with the highest shooting average.
System.out.println("Player with the highest shooting average: " +
team.playerWithHighestShootingAvg());
}
12. }
SAMPLE OUTPUT:
Team:
Player name: Bill Position: Center
Shots Taken: 10 Shots Made: 2
Player name: Joe Position: Point guard
Shots Taken: 10 Shots Made: 7
Player name: Andrew Position: Shooting guard
Shots Taken: 20 Shots Made: 2
Player name: James Position: Power forward
Shots Taken: 20 Shots Made: 12
Player name: Ben Position: Small forward
Shots Taken: 10 Shots Made: 4
Are all positions different? Yes
Team Shooting Percentage: 0.38571428571428573
Is center player available: Yes
Sorted team using the number of shots taken as the sorting key:
Player name: Bill Position: Center
Shots Taken: 10 Shots Made: 2
Player name: Joe Position: Point guard
Shots Taken: 10 Shots Made: 7
Player name: Ben Position: Small forward
Shots Taken: 10 Shots Made: 4
Player name: James Position: Power forward
Shots Taken: 20 Shots Made: 12
Player name: Andrew Position: Shooting guard
Shots Taken: 20 Shots Made: 2
Sorted team in ascending alphabetical order by name:
Player name: Andrew Position: Shooting guard
Shots Taken: 20 Shots Made: 2
Player name: Ben Position: Small forward
Shots Taken: 10 Shots Made: 4
Player name: Bill Position: Center
Shots Taken: 10 Shots Made: 2
13. Player name: James Position: Power forward
Shots Taken: 20 Shots Made: 12
Player name: Joe Position: Point guard
Shots Taken: 10 Shots Made: 7
Player with the most shots made: James
Player with the highest shooting average: Joe