Question: Objectives Object-Orientated Design Static Variables and Static Methods Class Relationships, Dependency and Aggregation Method overloading Passing objects as parameters The instructions are somewhat vague, because



Objectives Object-Orientated Design Static Variables and Static Methods Class Relationships, Dependency and Aggregation Method overloading Passing objects as parameters The instructions are somewhat vague, because part of this assignment is for you to show me that you understand what classes are. I have also asked you create your own data members that make sense for the class, and a method that makes sense for the class. TEAM CLASS 1) Create a Team class a) Data members include i) String Team Name ii) A miscellaneous data member you make up for Team, with a data type of your choice. This must make sense for a Team class iii) Another miscellaneous data member you make up for Team, with a data type of your choice. This must make sense for a Team class b) Methods i) Write get methods for all data members ii) Write a constructor with parameters for team name, and both of the miscellaneous data members you created in the Team class (1) update team name and misc. data members using parameters ii) Write a toString() method to display all three data member names as shown in class. STUDENT CLASS 2) Create a Student class that aggregates the Team class. a) Data members for Student class i) first name ii) last name iii) a Team object (this demonstrates aggregation) iv) a static int variable to keep track of how many students have been created, initialized to zero v) A miscellaneous data member you make up for Student, with a data type of your choice. This must make sense for a Student class vi) Another miscellaneous data member you make up for Student, with a data type of your choice. This must make sense for a Student class b) Methods for Student class 1 CSI 2300 Winter 21 - HWK 4 i) Write get methods for all data members in student class except for the Team object data member ii) Write set methods for the data members in the student class except for the Team object data member and the static int variable representing student count (1) Write a constructor with parameters for the first name, last name, both of the miscellaneous data members you created in the Student class, team name, and both of the miscellaneous data members you made for Team class. (2) Update the data members in the Student class and call the constructor for the Team object with the appropriate arguments. (3) Increment the student counter. iii) A method that would accept an object of the Student class as a parameter (1) Make up a method in your student class that accepts a Student object as a parameter that makes sense for your project. This will demonstrate dependency. iv) A toString method that includes the information from the Team class as demonstrated in output below. IN CLIENT CLASS/MAIN METHOD 3) Create 3 objects of the Student class 4) Output the toString() for all 3 objects 5) Do something with your Student method that you wrote by passing one of the other Student objects. (If it returns a value, possibly output the value along with the two student names.) Example Output. Your output will make a lot more sense than mine because I didn't want to pick the miscellaneous data types to prevent you from using them. You'll make unique ones for your homework, along with a meaningful but unique method that accepts an object of the same type as the class. Name: Bill Smith 1st Misc Field you picked for Student : 55 2nd Misc Field you picked for Student : 3.4 Team Name : Dolphins 1st Misc Field you picked for team: stuff 2nd Misc Field you picked for team: more stuff Total Number of students is 3 Name: Vinetta Kannon 1st Misc Field you picked for Student : 55 2nd Misc Field you picked for Student : 3.9 Team Name: Otters 1st Misc Field you picked for team: junk 2nd Misc Field you picked for team: more junk Total Number of students is 3 Name: Sandy Miller 1st Misc Field you picked for Student : 34 2nd Misc Field you picked for Student : 3.9 Team Name: Otters 1st Misc Field you picked for team: things 2nd Misc Field you picked for team: more things Total Number of students is 3 Bill has the same thing as Vinetta Bill does not have the same thing as Sandy 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
