The following is for a Java Program
Create UML Class Diagram for these 4 java classes. The diagram should include:
1) All instance variables, including type and access specifier (+, -);
2) All methods, including parameter list, return type and access specifier (+, -);
3) Include Generalization and Aggregation where appropriate.
Java Classes description:
1. User Class
1.1 Subclass of Account class.
1.2 Instance variables
__ 1.2.1 username – String
__ 1.2.2 fullName – String
__ 1.2.3 deptCode – int representing the department code
__ 1.2.4 No other instance variables are needed.
1.3 Methods
__ 1.3.1 Default constructor sets all instance variables to a default value
____1.3.1.a Call the super class constructor passing appropriate parameters to it.
____ 1.3.1.b Set the rest of the variables
__ 1.3.2 Parameterized constructors
____ 1.3.2.a Takes in username, clearPassword and the key
____ 1.3.2.b Additional parameters include fullname, and dept code..
____ 1.3.2.c Call the super class constructor passing appropriate parameters to it.
__ 1.3.3 Accessor and mutator methods for all variables in this class. Mutator method should be used to set all instance fields.
__ 1.3.4 toString
____ 1.3.4.a Calls super class methods as needed.
____ 1.3.4.b Returns a nicely formatted String representing the user to include fullName, username, deptCode, accountID number, clearPassword, encryptPassword and key
2. Bot Class
2.1 Subclass of Account class.
2.2 A class that stores information about an application that performs an automated task.
2.3 Instance Variables
__ 2.3.1 botFileName – String representing the file name of the bot
__ 2.3.2 category – String providing the Bot category which will be either IDS, SysAdm, or HelpDesk.
__ 2.3.3 dateUpdated – GregorianCalendar object (from the Java API) that shows the date the Bot was last updated.
__ 2.3.4 createdBy – String representing the creator name or handle.
2.4 Methods
__ 2.4.1 Default constructor sets all instance variables to a default value
____ 2.4.1.a Call the super class constructor passing appropriate parameters to it.
____ 2.4.1.b Set the rest of the variables
__ 2.4.2 Parameterized Constructor
____ 2.4.2.a Takes in all parameters required to set the instance variables.
____ 2.4.2.b Date is a String in the format mm/dd/yyyy.
____ 2.4.2.c Convert the date to a format compatible with creating GregorianCalendar object.
____ 2.4.2.d Create the GregorianCalendar object
____ 2.4.2.e Call the super class constructor passing appropriate parameters to it
__ 2.4.3 Accessor and mutator methods for all variables in this class.
__ 2.4.4 toString
____ 2.4.4.a Calls super class methods as needed
____ 2.4.4.b Returns a nicely formatted String representing the Bot to include Bot file name, purpose, date updated, creator name, accountID number, clearPassword, encryptPassword and key
3. Account class
3.1 Superclass Abstract Class
3.2 Instance variables
__ 3.2.1 clearPassword String
__ 3.2.2 encryptedPassword : String
__ 3.2.3 key : String
__ 3.2.4 accountId - A unique integer that identifies each account
__ 3.2.5 nextIDNum – a static int that starts at 1000 and is used to generate the accountID
__ 3.2.6 no other instance variables needed.
3.3 Default constructor – set all instance variables to a default value.
3.4 Parameterized constructor
__ 3.4.1 Takes in clearPassword, key.
__ 3.4.2 Calls encrypt method to create encryptedPassword
__ 3.4.3 Call mutator methods to set other instance variables.
3.5 Accessor/mutator methods (Standard except as follows)
__ 3.5.1 setClearPassWord - mutator needs to call encrypt method
__ 3.5.2 no encryptedPassword mutator method
__ 3.5.3 setKey mutator needs to call encrypt method.
__ 3.5.4 accountId mutator - uses the static variable nextIDNum to retrieve the next available userID number
3.6 encrypt method
Private method – only accessible to other methods of the User
class
Uses the Vigenere Cypher to encrypts the clearPassword instance
variable using the key
Stores the encrypted password in encryptPassword instance
variable.
3.7 toString - returns a nicely formatted String representing the instance variables of the Account class
4. CompanyAccounts Class
4.1 The array will be of type Account
4.2 Method names, return types and parameters would change from User to the new super class Account for example
__ 4.2.1 getUser would change to getAccount and return an Account Object
__ 4.2.2 addUser would change addAccount and its parameter would be of type Account.
Get Answers For Free
Most questions answered within 1 hours.