Computers and Technology

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 ; }

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 18:00, taiyana74
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, live4dramaoy0yf9
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, NycLife
Why should you evaluate trends when thinking about a career path?
Answers: 1
image
Computers and Technology, 25.06.2019 05:30, jackiemiranda2010
Why are weather forecasts more reliable now compared of hundred years ago
Answers: 1
Do you know the correct answer?
Define a class named document that contains an instance variable of type string named text that stor...

Questions in other subjects: