|
CSE 1030 - Assignment #2 - A Class Representing Symphony Musicians
SC/CSE 1030 - Fall 2012 - Assignment #2
A Class Representing Symphony Musicians
The Kapellmeister
of the York University Symphony Orchestra needs
your help! She has an entire
orchestra
of classical musicians
that she has to keep track of, and so she
needs you to build a Java class that can hold
the details of her musicians.
Your goal for this assignment is to develop a Java Class
for storing the following information:
|
|
Data Item |
|
Description |
|
|
|
Name |
|
The name of the musician (e.g., "Niccolo Paganini") |
|
|
Instrument |
|
The name of the musical instrument the musician plays (e.g., "Violin") |
|
|
Office |
|
The location of the musician's office (e.g., "Room B-7") |
|
|
Section |
|
The Section of the Orchestra that the musician belongs to (e.g., Strings) |
|
|
Principle |
|
A flag indicating whether the musician is the Principle musician of their section |
|
|
You can read more about the
Sections of an Orchestra and their Principles on Wikipedia.
The API for the Musician class that you will have to create is documented here:
The Musician Class.
To complete this assignment, you must do three things:
Create the Musician class, matching the details given in
the API.
You are responsible for defining and managing the data
members of the Musician class that you will need to hold the data,
the constructors,
the appropriate accessor and mutator functions, and for implementing the
utility functions inherited from the Object class:
toString() and equals(). Don't forget a static public
main() function for testing your implementation.
Include Javadoc comments in your source code, so that
the javadoc tool produces an HTML API document identical to
the provided API, when run
with the following command:
javadoc Musician.java
Submit your Musician class electronically before the deadline
using the submit command:
submit 1030 a2 Musician.java
Some notes:
You will find the following class useful:
SymphonySection.java
We have also provided the
API for the SymphonySection class.
A Java program that provides a simple command-line interface
for creating and testing Musician objects, is available here:
a2.java.
Compile (javac a2.java Musician.java SymphonySection.java)
run (java a2)
and use this program to test your code.
(Also note that you can compile with less typing by entering
javac *.java)
Your source code should be well organised and documented.
Remember the Course's, Department's, and the University's
policies on academic honesty - do your own assignment yourself.
(Besides, doing it yourself is the only way to learn!)
This assignment is due on Friday September 21, at noon. Late
assignments will not be accepted.
Start Early - Don't leave your assignment to the last minute!
Remember that you can use the submit command more
than once - if you submit your Musician.java file again, it will
replace the previous submission.
So if you
make a mistake, don't panic, just fix it, and resubmit it
(before the deadline).
Additional information regarding the submit command can be
found by typing man submit at the command line.
Do not use the Type package, nor its earlier
incarnation, the york package.
Your programs must compile and run on the Prism computers.
Your grade will be a number from 0 to 10. The breakdown is
7 marks for properly defining the Musician class.
1 mark for javadoc comments that match the provided API.
2 marks for coding style (nicely organised code with comments).
Have FUN!
|
|