Question: Specify, design, and implement a class that can be used to hold information about a musical note. A programmer should be able to set and
Specify, design, and implement a 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 numbers for the octave beginning at middle C are shown

The 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 the letter of the note (A, B, C, etc.), whether the note is natural or sharp (i.e., white or black on the piano), and the frequency of the note in hertz. To calculate the frequency, use the formula 440 × 2n/12, where n is the note number. Feel free to include other useful methods.
-8 -6 -3 -1 1 C# D# F* G* A* I3D Note mbers for the octave of cToTE FTa CD FG|AB middle C -9 -7 -5 -4 -2 0 2
Step by Step Solution
3.36 Rating (174 Votes )
There are 3 Steps involved in it
SourceCode import javautil import javamath public class NoteTester public static void mainString args Declare variables to hold user input double noteValue String noteLength int tempLength Create scan... View full answer
Get step-by-step solutions from verified subject matter experts
