1. Add a new method, displayNote(), to the Note class. It should display a formatted version of the note,something like this:From: BarrettBody:Meeting tomorrow at 11Next, change the method...

1 answer below »
add on the four python files from python.zip accords with the instruction


1. Add a new method, displayNote(), to the Note class. It should display a formatted version of the note, something like this: From: Barrett Body: Meeting tomorrow at 11 Next, change the method display( ) in NoteKeeper to call displayNote() for each Note object in its list of Notes (instead of just doing print(object), which uses str () to do the printing). Then run testNoteKeeper to see it work. 2. Create a class called TimedNote that inherits from Note (this is why the data members of Note should be protected, not private — they'll be reused in TimedNote). It should have the protected fields below with getters and setters, a default constructor, and a__ str () method that uses the parent's str ( ) for the inherited data. The new data members are: sendTo — string, who the note is intended for dateTime — string, time of creation (you may use the Python datetime library instead) It should also have a displayNote ( ) method — this should first display the sendTo and dateTime fields, then call the parent's displayNote () to display the rest, so that it looks like this (for the data in #3): Date: 2/27/20 1:00 pm To: Barrett From: The Boss Body: You are fired 3. Write a main program called testTimedNote.py that creates two timedNote objects. The first one's data should be "You are fired’, "The Boss', ‘Barrett’, 2/27/20 1:00 pm"; the second's data should be 'You can"t fire me, I quit’, Barrett! 'The Boss', 2/28/20 8:30am’. Then call displayNote ( ) to print both notes. 4. Write a main program called testNoteKeeper2.py by copying testNoteKeeper.py and changing the second object to a TimedNote object (leave the first one a regular Note object), set its sendTo and dateTime fields, and add both objects to the NoteKeeper object, then display the list. 5. Add a private static variable, count, to Note, initialized to zero. In Note’s constructor, increment it. Add a static method, getCount( ), to Note that returns count. Then add a print statement to testNoteKeeper2.main to display the count with the label “Note count =
Answered Same DayDec 07, 2022

Answer To: 1. Add a new method, displayNote(), to the Note class. It should display a formatted version of the...

Anubhav answered on Dec 08 2022
36 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here