Reference no: EM13947915
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 for Email that is derived from Document and includes member variables for the sender, recipient, and title 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.
Similarly, define a class for File that is derived from Document and includes a member 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.toString().indexOf(keyword,0) >= 0)
return true;
return false;
}
What would you recommend doing
: You're reluctant to stop hiring temps all together because you save about 8 percent in total labor costs. What would you recommend doing?
|
Which is describes how a master budget is used
: Which is best describes a nonfinancial performance measure contained in most Balanced Scorecards? Which is describes how a master budget is used?
|
What is bestcares net working capital for 2011
: How does this balance sheet differ from the ones presented - What is Green Valley's net working capital for 2011 and What is BestCares net working capital for 2011
|
What is the purpose of a balanced scorecard
: What is the purpose of a Balanced Scorecard? According to the Balanced Scorecard, what is a strategy? Explain the difference between lag measures and lead measures.
|
Define a class named document that contains an variable
: 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.
|
Copy one file to another.
: Source and destination files both exist. Script shall prompt for permission to overwrite the destination file. If permission is denied, program will display message and terminate.
|
Estimate the optimum moisture content
: A silty clay soil has a plasticity index (PI) of 14. Estimate the optimum moisture content and the maximum dry unit weight of the soil when compacted using the procedure of:
|
Calculate the ultimate holding capacity of anchor
: In Figure 14.40a, for the anchor slab in sand, H 5 1.52 m, h 5 0.91 m, B 5 1.22 m,S9 5 2.13 m, f9 5 308, and g 5 17.3 kN/m3. The anchor plates are made of con- crete and have a thickness of 76 mm. Using Ovesen and Stromann's method, calculate the u..
|
What is your definition of normal and definition of abnormal
: What is your definition of Normal and your definition of Abnormal? How do we determine what is considered to be Abnormal Behavior
|