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
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
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...
Related questions
Question
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
Expert Solution
Step 1
Algorithm:
- Create an interface called "NoteADT" with the methods "setStrValue", "setKeyColor", "setFrequency", "setStrLength", "getFrequency", "getValue", "getKeyColor", "getLength", and "toString".
- Implement the interface in a class called "NoteDataStructureClass".
- Declare private variables letter, length, value, keyColor, and frequency in the "NoteDataStructureClass".
- Define a default constructor that sets the default length to "quarter note" and letter to 'C'.
- Define a parameterized constructor that sets the values of letter, length, keyColor, value, and frequency.
- Define a copy constructor that creates a copy of the NoteDataStructureClass object.
- Implement the methods in the interface by setting the values of the private variables.
- Override the toString method to return a formatted string of the object's properties.
- Create a class called "NoteClientDemoClass" with the main method.
- Create four objects of the "NoteDataStructureClass" class, n1, n2, n3, and n4 using the default and parameterized constructors.
- Use the setter methods to set the properties of n3 and n4 objects.
- Print the objects using the toString method to display the properties of the NoteDataStructureClass objects.
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Recommended textbooks for you
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
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 Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
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
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY