Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Classes, Inheritance, Abstract Classes, Polymorphism, That is, you need to make up some files (you can create them manually or and Exceptions programmatically) that include

image text in transcribed

Classes, Inheritance, Abstract Classes, Polymorphism, That is, you need to make up some files (you can create them manually or and Exceptions programmatically) that include emails or files' information as shown below. The program prompts the user to enter the file name and then the file is read and Assignment 5: Due date/time is Sunday, March 5th, at 11:59 PM. data is stored in a proper object/s. Part 1: (15 Points) Create a java project that has the following units: 1) A class named Document that contains a data member variable of type String named text that stores any textual content for the document. The class has the proper constructors, getters, and setters, and has the toString, equals method overridden. 6: you are expected to use proper exceptions to increase the program's 2) Create a class for Email that is derived from Document, and that includes the robustness. For example, opening a file is considered a risky operation that has a following data members variables: sender, recipient, and title (email designated exception. So, use a try-catch clause/s to handle any subject) of an e-mail message. Implement appropriate constructors, getters, and expected/unexpected errors (e.g., invalid user entry and disk errors). setters, and has the toString, equals methods. The body of the e-mail message should 7: The file that has the data is expected to be a text file (*.txt). That is, the file be stored in the inherited data member variable text. name entered must have the following format: 3) Similarly, Create a class for File that is derived from Document, and that includes a *.txt such that the file has a name with no spaces and valid characters and has an data member variable for the file pathname (or only file name). Implement appropriate explicit extension (.txt). Use the facilities provided by the String class to parse the constructors, getters, and setters, and has the toString, equals methods for the pathname member variable. 4) Finally, create a class named DocumentApp that has a main method to run the project. Part 2: (10 Points) In the DocumentApp, create a static method Containskeyword () that would use Modify class Document to be an Abstract Class then use it to derive the Email and File classes. the inheritance-based Polymorphism to receive an object of a class (Email, File, or The Abstract class has an extra method signature fileLength () (abstract method) that Documents) and returns true if the object contains a specified keyword (string) sent as returns the length of the text (how many characters) saved in objects of the derivate classes. That a parameter to the static method as well. is, derived classes need to provide concrete implementations for the fileLength () method. For example, the following method call (from the main method in class DocumentApp) Part 3 (5 Points) : Junit test, Java coding style, JavaDoc would return true if the text of the emailObj contains the word (substring) money: Implement appropriate Junit tests for all testable classes (wherever the Junit test is applicable). Containskeyword(emailobj, "money") ; Use the Javadoc tool to generate Java code documentation. Additionally, please use java 5) To run and test your program, make sure that the data is read from test files. conventions (Java coding style) for more professional programming

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

4. Show the trainees how to do it again.

Answered: 1 week ago

Question

8. Praise the trainees for their success in learning the task.

Answered: 1 week ago