Question: Create a class CompanyDoe, representing an official document used by a company. Give it a String title and an int length. Throughout the class, use

 Create a class CompanyDoe, representing an official document used by a
company. Give it a String title and an int length. Throughout the

Create a class CompanyDoe, representing an official document used by a company. Give it a String title and an int length. Throughout the class, use the this. notation rather than bare instance variables and method calls. Add a default constructor. Add a parameterized constructor that takes a value for title. Use this( appropriately to call one constructor from another Add a toString0, which returms a string with the title, and the length in parentheses. So it might look like Erployment Turnover Report (16342) Add a method longer with return type boolean, which takes a CompanyDoc as parameter. del Jonger(doc2) returns true if doci's length is greater than doe2's length, false otherwise. Part B Create a class Employee with an instance variable for name and instance variable currentDoc of type CompanyDoc To CompanyDoc, also add an instance variable author of type Employee In Employee, in the mutator for currentDoc, make sure that whem a CompanyDoc becomes an employee's currentDoc, the employee becomes the author of the document as well. In Employee, add a method swapDecs( which takes another Eimployee and has them swap their currentDocs Part C Create a class DocRepository with one instance variable of type Employee, cument Employee dd a method menu that presents a menu-driven interface as follows (you can add as many other methods as you like ) Main menuuser can either create an employee or end the program if they create an employe, ask for the name, create an employee with that name Chenceforth, the current employee) and go to Employee Menu. (Do this even if a current employee was created previously; just replace the old one) Employee menuuser can create a document,edit document, view document, or returs to the main men Ir they ask to create a document, what we want to do is ask for the title, crease that document, and make it the current employee's current documen. Firsr, however,chock whether the current employee has a current document. If not, just go abead. If they have one, first ask if they want to replace it, and oaly do so if they say yes. Afier this, return to the Employee Menu If they edit the document, first check if the current employee has a document. If net,complain and veturn to the Employee menu. It so, go to the Docursent menu

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!