subject
Computers and Technology, 28.11.2019 07:31 amoauya

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 methods gettext and settext to get and set this value, respectively. include the constructor that set all of the instance variables. redefine equals method to test whether two documents are equal.

next, define a class for email that is derived from document and includes instance variables for the sender, recipient, hasattachement and subject of an email message. implement appropriate accessor and mutator methods. the body of the email message should be stored in the inherited variable text. redefine the tostring method to concatenate all text fields. include the constructor that set all of the instance variables. redefine equals method to test whether two emails are equal.

similarly, define a class for file that is derived from document and includes an instance variable for the pathname, size (e. g., 10kb, 100kb, etc) and filetype (e. g., pdf, doc, … the textual contents of the file should be stored in the inherited variable text. redefine the tostring method to concatenate all the text fields. include the constructor that set all of the instance variables. redefine equals method to test whether two files are equal.

finally, make the email and the file classes implement the comparable interface. define the compareto method to order email objects based on the sender name. also, define compareto method to order file objects based on the file size.

note: hasattachment is a boolean variable. true when an email has an attachment, otherwise false.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:10
For each of the following claims, determine whether they are true or false. justify your determination (show your work). if the claim is false, state the correct asymptotic relationship as o, θ, or ω. unless otherwise specified, lg is log2.(a) (b) (c) (d) (e) (f) (g) (h) (i) (j)n+1 =22n =2n =1 =ln2 n =n2 +2n−4 =33n = 2n+1 =√n = 10100 =o(n4) o(2n)θ(2n+7 ) o(1/n)θ(lg2 n) ω(n2 )θ(9n ) θ(2n lg n )o(lg n) θ(1)
Answers: 1
question
Computers and Technology, 21.06.2019 22:00
Draw the hierarchy chart and design the logic for a program that calculates service charges for hazel's housecleaning service. the program contains housekeeping, detail loop, and end-of-job modules. the main program declares any needed global variables and constants and calls the other modules. the housekeeping module displays a prompt for and accepts a customer's last name. while the user does not enter for the name, the detail loop accepts the number of bathrooms and the number of other rooms to be cleaned. the service charge is computed as $40 plus $15 for each bathroom and $10 for each of the other rooms. the detail loop also displays the service charge and then prompts the user for the next customer's name. the end-of-job module, which executes after the user enters the sentinel value for the name, displays a message that indicates the program is complete.
Answers: 2
question
Computers and Technology, 22.06.2019 09:00
Designing a mobile web page is a little different from designing a regular web page. name at least three features that should be considered when designing a website that is mobile phone-friendly, and briefly explain why they are important.
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
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, 22.03.2021 18:10
question
Mathematics, 22.03.2021 18:10
question
History, 22.03.2021 18:10
question
Mathematics, 22.03.2021 18:10
question
Mathematics, 22.03.2021 18:10