Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design, implement and test a class that can be used to hold information about a musical note. Test it with an appropriate driver program A
Design, implement and test a class that can be used to hold information about a musical note. Test it with an appropriate driver program A Note is described by two fields: the value of the note and the length of the note. A programmer should be able to set and retrieve the length of the note and the value of the note The length of a note may be a sixteenth note, eight note, quarter note, half note, or a whole note. The note's value is specified by indicating how far the note lies above or below the A note that orchestras use in tuning (A4). In counting "how far", you should include both the white and black notes on a piano. The default constructor should set a note to the A above middle C (value 0) and a length of a quarter note. Include methods to set a note to a specified length and value. Write methods to retrieve information about a note, including methods to: 1. tell you the letter name of the note (A, B, C); 2. tell you whether the note is natural or sharp (ie. white or black on the piano), and 3.tell you the frequency of the note in hertz. [[ HINT: To calculate the frequency, use the formual 440 x 2A(n/12) where n is the note number. ]] Feel free to include other useful methods! No GUI interface or applet is required but the problem might extend itself to a cute applet in some way... You are encouraged to explore ! TESTING and DOCUMENTATION Be sure to test, and show me the results. Document (with javadoc) and comment the code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started