Assignment 4 - Static, overloading, constructors

Assignment 4 - Static, overloading, constructors - Dr....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Dr. Karina V. Assiter cc117abff8b88f76ba2aa1812d07aa5bbacbc9fc.doc 5/7/2009 Wentworth Institute of Technology Object Oriented Programming Due: October 6, 2003 Objective: Complete the BaseballPlayer class so that it can be easily used by future classes (ie, Teams, etc,…). Topics: 1. Static Methods and variables 2. Overloading 3. Constructors 4. Arrays of classes Instructions 1. Read Chapter 5 and sections 6.1 and 6.2. 2. For your BaseballPlayer class: a. Add a static variable count . b. Write static accessor and mutator methods for count : i. GetCount () ii. SetCount (int c) c. Add a default constructor that: i. Takes no arguments ii. Increments count iii. Initializes all other instance variables by calling their individual mutator methods with default values (i.e., name might be initialized to an empty string). d. Add a second constructor that i. Takes in arguments for all instance variables in the class ii. Increments count iii. Calls overloaded set method (Assignment 3), passing inputted
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Assignment 4 - Static, overloading, constructors - Dr....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online