Make a use class diagram and a class diagram and write a python code for the question given below.
Expense Tracker
Introduction
Your task is to create an application for the CFO of a high-tech company that monitors and reports the
spending of each employee. The company has different departments such as Engineering, Marketing, Sales,
Production and Accounting. The CFO needs your application to prevent overspending by some employees or
departments and to plan the budget accordingly.
Data Details:
1. The following fields are needed for every employee: employee id, first name, last name, department
name and rank (Management, Supervisor, Senior Staff, Staff or Non-exempt).
2. The following fields are required for every expense: date of expense, expense amount, expense
category and employee id.
3. The following fields are needed for every department: department name, a list of employees and a list
of expense categories with their budgets.
Storage
1. You need to create a file for each employee’s expense with all the required data. You can choose the
format of the file as you like. See Data Details for details.
2. You also need a file that contains the monthly budget for each expense category in dollars. Each
department has its own expense categories. For instance, the sales department might have
Transportation, Entertainment, Travel Insurance and so on. The Engineering department might have
Equipment, Training, Professional Membership Fees, Magazine Subscriptions, Lab Expense and
Software License. This file should include the expense categories for all departments. You can decide
the format of the file yourself.
a. Engineering: Equipment: $10000, Membership fees $1000, Magazine $500, Lab expense
$20000, and software license $2000.
3. You may also need some files for keeping the employees and department information. Please check
the Data Details for more details.
Core Functionalities:
1. Enable the user to create, modify, find and remove the employee record.
2. Enable the user to create, modify, find and remove the department record.
3. Enable the user to input any employee’s expenses.
4. Enable the user to generate a monthly expense report for a specified department and a given month.
The report should display each employee’s expense for that department and month.
5. Enable the user to generate a monthly summary report for each expense category in each department
for a given month.
6. Enable the user to input a category to search monthly expenses for the specified category. It should
display all the departments that have the given category and month.
7. Find the employee who has the highest expense for a given month.
8. Find the departments that have expenses over their budget limits for a given month.
9. Find the department that has the highest expense for a given month.
10. Give alerts to the department that is close to exceeding its budget limit for the current month.
11. Display a histogram for total counts of each expense category for a specified department and month.
12. Display a histogram for each department’s total monthly expense for a given month.
13. Display a histogram for each employee’s total monthly expense for a given month.
14. Enable the user to modify the budget for a given category. If transportation needs to be reduced by
10%, then all the departments that have the transportation expense category will have that category
decreased by 10% for the current month and onward. And you need to find a way to store the previous
expense budget in case the user needs to generate the expense report for previous months.
15. Enable the user to apply the same percentage change for all the expense categories. For example, if
the user wants to reduce all categories by 10%, then all of the categories should be decreased by 10%
for the current month and onward. And you need to find a way to store the previous expense budget in
case the user needs to generate the expense report for previous months.
16. Before the program exits, all the data should be stored in the files that are defined in Data Storage. And
when the program restarts, all the data will be fetched from the files.
17. Enhance your application with two more functionalities that can increase its utility and convenience for
the user.
User Interface:
1. Provide a console-based user interface that allows the user to manage their expenses using the
features of your application. The user interface should give clear guidance, sufficient data validation,
reduce keyboard input, and handle errors appropriately.
OOD Process
1. Understand the requirements
a. Draw Use Case Diagram(s)
2. Design the business objects
a. Identify the data attributes
b. Identify the classes by storing the data attributes into categories.
c. Identify the methods by drawing a UML diagram for the class.
d. Refine the classes, attributes, and methods.
3. Follow the Object-oriented design and principals
a. Use encapsulation and delegation to achieve loose coupling and improve software flexibility and
maintainability. Apply suitable software design patterns when they are relevant.
4. Implement the business object and test them
5. Implement the presentation layer
a. Define a class if needed to encapsulate the complexity.
6. Implement the data layer and test it
a. Define file formats for necessary files.
b. Define a class for storing and retrieving the data from the file.