Note:- Please read this java program plan (IMAGE-1) before starting to type code and then read the java program question (IMAGE-2) and please type this java code and include all the stuff given in (IMAGE-1). Also, need an output for this java code and please provide all the things that have been asked to include in the java code. Program Plan (Image):- Question -2(ADTs) Question (Image):- Question-2

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Note:- Please read this java program plan (IMAGE-1) before starting to type code and then read the java program question (IMAGE-2) and please type this java code and include all the stuff given in (IMAGE-1). Also, need an output for this java code and please provide all the things that have been asked to include in the java code.

Program Plan (Image):- Question -2(ADTs)

Question (Image):- Question-2

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
Transcribed Image Text: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 1
田田
CD
F GA
DD Eb
GE At Bb
CDEFGAB
-9 -7 -5 -4 -2 o 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, ..., 6)
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 * 212, where n is
the note number.
Transcribed Image Text: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 1 田田 CD F GA DD Eb GE At Bb CDEFGAB -9 -7 -5 -4 -2 o 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, ..., 6) 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 * 212, where n is the note number.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY