Question
Please make sure You have same output as I have attached. Demonstrate all behaviors (actions, methods) of the lock. 2. NoteADT - Show the interface
Please make sure You have same output as I have attached.
Demonstrate all behaviors (actions, methods) of the lock.
2. NoteADT - Show the interface and all abstract methods
NoteDataStructureClass - Show the following methods: default constructor, overloaded constructor, copy constructor, setValue (calls other methods: setStrValue, setKeyColor, setFrequency), setLength (calls setStrLength), setFrequency (should be double value- cast)setKeyColor, getValue, getLength, getKeyColor, getFrequency, toString.
NoteClientDemoClass Instantiate two Note objects using the overloaded constructor and two Note objects using the default constructor.
A sample output for 1 Note object might appear like:
F#
Length: Eighth note
Value: -3
Black key (sharp)
369.995672 Hz
2. Specify, design, and implement a "Note" class that can be used to hold information about a musical 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, eighth note, quarter note, half note, or whole note. A value is specified by indicating how far the note lies above or below the "A" note that orchestras use in tuning. In counting "how far," you should include both the white and black notes on a piano. For example, the note (value) numbers for the octave beginning at middle C are shown as integers here: -8 -6 -3 -1 CD F GA Db Eb GL AL BD CDEFGAB -9 -7 -5 -4 -2 0 2 Write a complete Java program. The default constructor should set a note to a middle C 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 tell you: a) The letter of the note (A, B, C, ....) b) Whether the note is a natural (white key) or a sharp (black key) on the piano c) The frequency of a note in hertz. In order to calculate the frequency, use the formula: 440 * 21/12, where nis the note number
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