subject

Define a class named document that contains an instance variable of type string named text that stores any textual content for the document. create a method named tostring that returns the text field and also include a method to set this value. next, define a class named email that is derived from document and includes instance variables for the sender , recipient , and title of an email message. implement appropriate accessor (get) and mutator (set) methods. for example get and set method for sender variable. the body of the email message should be stored in the inherited variable text . redefine the tostring method to concatenate all text fields. similarly, define a class named file that is derived from document and includes a instance variable for the pathname . the textual contents of the file should be stored in the inherited variable text . redefine the tostring method to concatenate all text fields. finally, create several sample objects of type email and file in your main method. test your objects by passing them to the following subroutine that returns true if the object contains the specified keyword in the text property. public static boolean containskeyword(document docobject, string keyword) { if (docobject.(keyword,0) > = 0) return true ; return false ; }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
Write a program that prompts the user to input a string. the program then uses the function substr to remove all the vowels from the string. for example, if str = "there", then after removing all the vowels, str = "thr". after removing all the vowels, output the string. your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel.
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
You know the right answer?
Define a class named document that contains an instance variable of type string named text that stor...
Questions
question
Mathematics, 09.12.2019 23:31