Question about java programming

Assignment Help Data Structure & Algorithms
Reference no: EM1380525

Question: Define a class named Document that have an instance variable of type String named text that stores any textual content for the file. Design 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;
}

 

Reference no: EM1380525

Questions Cloud

Repositioned by your employer to a new city : Zoning Change. You have been repositioned by your employer to a new city for an assignment that will probably last for two years. You don't want to sell your home
Illustrate what are some of primary goals of legislation : Illustrate what are some of primary goals of legislation. Name at least two ways this law revised bankruptcy proceedings. Do you think these changes are for better. Explain why or explain why not.
Emphasis on convenience for majority : If you would like to start a service business of recreation find one location where near Manhattan area do research on why you pick it. Keep in mind that emphasis on convenience for majority
Explain whether morrisons owe a duty of care to andrew : oneses sue Morrisons for their injuries. Explain whether Morrisons owe a duty of care to Andrew also Arvid.
Question about java programming : Define a class named Document that have an instance variable of type String named text that stores any textual content for the file. Design a technique named toString that returns the text field and also include a method to set this value.
A bank promotes home loans at low interest rates : A bank promotes home loans at low interest rates for its account holders for three months. Toward the end of the second month the bank withdraws the offer
Analyze political-social-ethical also legal differences : Analyze political, social, ethical also legal differences facing both organizations also determine impact se differences have on management decision making.
The robots will support the human pharmacists : Rondell Pharmacy is seeing switching to the use of robots to fill prescriptions that contain of oral solids or medications in pill form. The robots will support the human pharmacists and will reduce the number of human pharmacy workers needed
How you plan to revise also proofread your final paper : In case of a resume, a single error can put you out of competition. Question - Briefly illustrate conference explain how you plan to revise also proofread your final paper.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd