PlayerStats - public int getScore() { return score; }

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // PlayerStats.java Author: Lewis and Loftus // // Solution to Programming Project 7.4 //******************************************************************** public abstract class PlayerStats { protected String player, team; protected int score; //----------------------------------------------------------------- // Sets up this stat object with the specified info. //----------------------------------------------------------------- public PlayerStats (String playerName, String teamName) { player = playerName; team = teamName; score = 0; } //----------------------------------------------------------------- // Returns the score. //-----------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public int getScore() { return score; } //-----------------------------------------------------------------// Updates the score as appropriate depending on the sport. //-----------------------------------------------------------------public abstract void score(); //-----------------------------------------------------------------// Returns a description of this stats object as a string. //-----------------------------------------------------------------public String toString() { String result = "Player: " + player; result += "\nTeam: " + team; result += "\nScore: " + score; return result; } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online