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...
icon
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:

  1. Create an interface called "NoteADT" with the methods "setStrValue", "setKeyColor", "setFrequency", "setStrLength", "getFrequency", "getValue", "getKeyColor", "getLength", and "toString".
  2. Implement the interface in a class called "NoteDataStructureClass".
  3. Declare private variables letter, length, value, keyColor, and frequency in the "NoteDataStructureClass".
  4. Define a default constructor that sets the default length to "quarter note" and letter to 'C'.
  5. Define a parameterized constructor that sets the values of letter, length, keyColor, value, and frequency.
  6. Define a copy constructor that creates a copy of the NoteDataStructureClass object.
  7. Implement the methods in the interface by setting the values of the private variables.
  8. Override the toString method to return a formatted string of the object's properties.
  9. Create a class called "NoteClientDemoClass" with the main method.
  10. Create four objects of the "NoteDataStructureClass" class, n1, n2, n3, and n4 using the default and parameterized constructors.
  11. Use the setter methods to set the properties of n3 and n4 objects.
  12. Print the objects using the toString method to display the properties of the NoteDataStructureClass objects.
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Unreferenced Objects
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 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