Objective: The ability to comprehend code written by another person is a critical skill for any programmer. Such code may be poorly written or may involve the application of more advanced concepts that you havent encountered before. It is also important to be able to work with UML diagrams, the class diagram in particular, which are often used to document the design of an application and/or to specify the design of an application you are developing. Completing this task you will require you to develop and demonstrate your competency in each of these areas.
Along with this project specification document you will find a ZIP file containing the provided code for this project (approximately 1440 lines of code). You will need to download and use this code for both questions in this project.
For this task, you are required to prepare a UML class diagram with the following features:
- Illustrates the classes representing different users in the system, in particular the User, Administrator, Customer, Manager, and Teller classes; Note: the classes representing different users in the system must be fully illustrated, including attributes, properties, and methods.
- Illustrates the classes representing different account types in the system, in particular the Account, CashAccount, CreditCard, Loan, and Mortgage classes; Note: you do not need to illustrate the attributes, properties, and methods for the classes representing different accounts in the system, i.e., just illustrate these classes with a single box containing the class name.
- Illustrates the relationships between these classes, including any variable names and multiplicity; and
- Illustrates the attributes, properties, and methods for all classes (except for those representing users as indicated above.
Objective: In this task you will be required to demonstrate your mastery / understanding of the unit material by extending the provided code to implement additional functionality. This task focuses on Weeks 7-11 (Unified Modeling Language, Object-Oriented Modeling, Exception Handling, Strings and Regular Expressions, and Files and Generics), however you will also need to apply knowledge from earlier sessions. To complete this task you will need to know how to create objects, establish relationships between them, and work with those objects/relationships to build effective functionality, i.e., to demonstrate you can successfully write code using an object-oriented programming language.
For this task you are required to modify/extend the provided code to save data upon terminating and reload that data when the program starts according to the following requirements:
- Binary serialization must be used;
- The name of the data file must be added to the Program class, as follows: private const string DATA_FILE_NAME = @"User Data.bin";
- All users of all types and all accounts of all types must be stored in the file; Hint: Remember that serialization will store all the data for a selected object and all other objects that are referenced by the selected object, so this step is remarkably simple. Deserialization of an object hierarchy is similarly simple.
- All objects representing open files must have their Dispose() method invoked properly, regardless of any exceptions that may occur, i.e., FileStream fs = File.Open(); fs.Dispose();
- If the data file does not exist (a FileNotFoundException), the user data is to be seeded (pre-loaded) using the information currently found in the Program.InitialiseUsers() method;
- If any other exception occurs when loading the user data, display an error message on the Console: Error reading data file: < exception message >, then seed the user data the same as if the file were not present;
- If any exception occurs when saving the user data, display an error message on the Console: Error writing data file: < exception message >;
- All serialization, deserialization, and seeding operations are to be performed from within the UserManager classes, however this class is not read/write any information directly from/to the Console; and
- Any exceptions that occur during serialization or deserialization must reach the Program class, which will take the corrective actions.
In completing the above tasks you will need to modify a number of classes in the provided code. Any changes however must be restricted to these changes, i.e., you are not permitted to modify the provided code for your own reasons/ preferences.