Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

o ldus defined bowel Oherwisit the team roser side by side. The right colums must be Phase 4: Class Location T Games hacen location ocation.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
o ldus defined bowel Oherwisit the team roser side by side. The right colums must be Phase 4: Class Location T Games hacen location ocation. Cet a location des that represents location where Lace Tages and members of members separated Add the following method: your location s - which member to the enter wh member of played, and Couder th have a some of to t the then print the players that belong to this case were Membership liat for Larrapla, kaverley are location Lay Yas played with cond coord i h taman melompare Where mail.google.com Intro to Chemistry, Basic Concepts. Perio... Sapling Assignments Alexander College - CHEM 101 - Winter 20-M Phase 4: Class Location Games happen at Laser Tag locations. Create a Location class, that represents a location where Laser Tag games happen. Locations have games, and members in your location class tracks a list of members use a partially filled array). Add the following methods: - Constructor with two parameters: String name, String address, which are stored for use in the toString method. - public void addMember Player newbiel which adds a member to the membership list that is tracked by this object. Players can only hold one membershipper Location, that is, the same player should not show up multiple times in the toString method public String toString() which prints the name and address of the location, then prints out all the names, number of games played, and average score of all the players that belong to this Laser Tag location. Consider any methods you have already written to help you do this. Sample output: Membership list for LaserTopia, Waverley Ave location Player: Player Jerry Holkins has played 1 game with an average of 20 Player Travis Willingham has played no games Also, add a second constructor to class Player, which accepts 2 parameters: String name, Location place. When given a Location, the constructor the Player becomes a member of the given Location Finally, add statie data and methods to location - A partially filled array, that tracks all of the locations public static String allocation Names() which returns a String of all the location names public static String whichLocations Player who which returns a string of all the Locations that the Player who is a member of Sample output: Orion Acana is a member at: ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2020 practice reading code, understand a program, and practice seeing if output is correct or not based on inputs ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2020 Phase 1: Class Player This class represents a Laser Tag player in our system. The class tracks the user's name, how many comes they have played, and can calculate their average score. You will need to make instance variables to keep this information in your objects Class player requires the following methods: A constructor public Playerstring an Intalne other instance variables as required Method public void addam Result int newscore. This method is called after a game is played the value passed is added to the user's average that is being tracked by this object public boolean equals Player Other, which checks equality of two Player objects. Two Player Objects are equal the names of the two Players are the same Atostring method that print out information of the object. If the player has not played any games print that the player has not played any games. If they player has played some games, print out the player's game average score. Use integer division to calculate the average. See the sample output and match it as closely as possible Accessor method getName(), which returns the player's name. Sample output Should pest player Ji B has played games Players in Des has played nogames Should print "Player Sohn Walker has played nogames Should print "Player Jim Beam has played with an average of Player Dean has played with an average of 30 has Played h ane average of 25 Player Johnny walker has played so games with an averaon of 25 mail.google.com (175) Intro to Sapling Assign.. Alexander Coll... assignment - a... DAZN SIGNMENT 1: Introduction to Object-Oriented Programming MP 1020 Winter 2020 Phase 1: Class Player This class represents a Laser Tag player in our system. The class tracks the user's name, how many games they have played, and can calculate their average score. You will need to make instance variables to keep this information in your objects. Class player requires the following methods: A constructor public Player (String name). Initialize other instance variables as required. Method public void addGameResult(int newscore). This method is called after a game is played, the value passed is added to the user's average that is being tracked by this object. public boolean equals (Player other), which checks equality of two Player objects. Two Player Objects are equal if the names of the two Players are the same. Atostring method that prints out information of the object. If the player has not played any games, print that the player has not played any games. If they player has played some games, print out the player's game average score. Use integer division to calculate the average. See the sample output, and match it as closely as possible. Accessor method getName(), which returns the player's name. Sample output should print "Player: Jim Beam has played no gants Playert Jim Bear has played nogames Should printPlayert Johnny Walker has played no games Playeri Johnny Walker has played no games Should print "Player Jim Beam has played 1 game with an average of Playert Jim Beam has played 1 game with an average of 50 should print "Player Jim Beam has played 2 games with an average of Players in Bean has played a games with an average of 51 should print "Player Johnny Walker has played 50 games with an average of 25 Phase 2: Class Team Create class Team, which is a collection of players who play Laser Tor games Teams have maximum sizes and players th e part y to keep track of the played the team o ldus defined bowel Oherwisit the team roser side by side. The right colums must be Phase 4: Class Location T Games hacen location ocation. Cet a location des that represents location where Lace Tages and members of members separated Add the following method: your location s - which member to the enter wh member of played, and Couder th have a some of to t the then print the players that belong to this case were Membership liat for Larrapla, kaverley are location Lay Yas played with cond coord i h taman melompare Where mail.google.com Intro to Chemistry, Basic Concepts. Perio... Sapling Assignments Alexander College - CHEM 101 - Winter 20-M Phase 4: Class Location Games happen at Laser Tag locations. Create a Location class, that represents a location where Laser Tag games happen. Locations have games, and members in your location class tracks a list of members use a partially filled array). Add the following methods: - Constructor with two parameters: String name, String address, which are stored for use in the toString method. - public void addMember Player newbiel which adds a member to the membership list that is tracked by this object. Players can only hold one membershipper Location, that is, the same player should not show up multiple times in the toString method public String toString() which prints the name and address of the location, then prints out all the names, number of games played, and average score of all the players that belong to this Laser Tag location. Consider any methods you have already written to help you do this. Sample output: Membership list for LaserTopia, Waverley Ave location Player: Player Jerry Holkins has played 1 game with an average of 20 Player Travis Willingham has played no games Also, add a second constructor to class Player, which accepts 2 parameters: String name, Location place. When given a Location, the constructor the Player becomes a member of the given Location Finally, add statie data and methods to location - A partially filled array, that tracks all of the locations public static String allocation Names() which returns a String of all the location names public static String whichLocations Player who which returns a string of all the Locations that the Player who is a member of Sample output: Orion Acana is a member at: ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2020 practice reading code, understand a program, and practice seeing if output is correct or not based on inputs ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2020 Phase 1: Class Player This class represents a Laser Tag player in our system. The class tracks the user's name, how many comes they have played, and can calculate their average score. You will need to make instance variables to keep this information in your objects Class player requires the following methods: A constructor public Playerstring an Intalne other instance variables as required Method public void addam Result int newscore. This method is called after a game is played the value passed is added to the user's average that is being tracked by this object public boolean equals Player Other, which checks equality of two Player objects. Two Player Objects are equal the names of the two Players are the same Atostring method that print out information of the object. If the player has not played any games print that the player has not played any games. If they player has played some games, print out the player's game average score. Use integer division to calculate the average. See the sample output and match it as closely as possible Accessor method getName(), which returns the player's name. Sample output Should pest player Ji B has played games Players in Des has played nogames Should print "Player Sohn Walker has played nogames Should print "Player Jim Beam has played with an average of Player Dean has played with an average of 30 has Played h ane average of 25 Player Johnny walker has played so games with an averaon of 25 mail.google.com (175) Intro to Sapling Assign.. Alexander Coll... assignment - a... DAZN SIGNMENT 1: Introduction to Object-Oriented Programming MP 1020 Winter 2020 Phase 1: Class Player This class represents a Laser Tag player in our system. The class tracks the user's name, how many games they have played, and can calculate their average score. You will need to make instance variables to keep this information in your objects. Class player requires the following methods: A constructor public Player (String name). Initialize other instance variables as required. Method public void addGameResult(int newscore). This method is called after a game is played, the value passed is added to the user's average that is being tracked by this object. public boolean equals (Player other), which checks equality of two Player objects. Two Player Objects are equal if the names of the two Players are the same. Atostring method that prints out information of the object. If the player has not played any games, print that the player has not played any games. If they player has played some games, print out the player's game average score. Use integer division to calculate the average. See the sample output, and match it as closely as possible. Accessor method getName(), which returns the player's name. Sample output should print "Player: Jim Beam has played no gants Playert Jim Bear has played nogames Should printPlayert Johnny Walker has played no games Playeri Johnny Walker has played no games Should print "Player Jim Beam has played 1 game with an average of Playert Jim Beam has played 1 game with an average of 50 should print "Player Jim Beam has played 2 games with an average of Players in Bean has played a games with an average of 51 should print "Player Johnny Walker has played 50 games with an average of 25 Phase 2: Class Team Create class Team, which is a collection of players who play Laser Tor games Teams have maximum sizes and players th e part y to keep track of the played the team

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

2. What efforts are countries making to reverse the brain drain?

Answered: 1 week ago