The Banks In Financial Distress program simulates a scenario where five banks are evaluated for financial safety based on predefined parameters. This README provides an overview of the program structure and functionality.
The program consists of two main classes:
- Initializes an instance of the EvaluateSafety class.
- Sets the number of banks (numberOfBanks) and the limit for keeping a bank safe (limitForKeepingBankSafe).
- Implements the main method to start the program by printing a welcome message and calling the startTheProgram method.
- Manages the evaluation of banks for financial safety.
- Contains methods for initializing arrays, evaluating bank safety, handling unsafe loans, and printing results.
- The EvaluateSafetyBanks method is the core logic for evaluating bank safety. It initializes arrays, gathers information about borrowers and loans, calculates total assets, checks for unsafe banks, and prints results.
- Other methods like initializeArray, getBorrowers, calculateBankAssets, checkUnsafeBanks, handleUnsafeBank, and print methods are used for specific tasks within the evaluation process.
- Compile the program using a Java compiler.
- Run the BanksInFinancialDistress class, which will start the evaluation process.
- Follow the program prompts and review the output to understand the safety status of banks based on predefined criteria.
Bank 0's loan information!!
Bank's balance: 25.0 Bank 0 lent money to 2 banks. Borrower's ID: 1 Amount borrowed: 100.5 Borrower's ID: 4 Amount borrowed: 320.5
Bank 1's loan information!!
Bank's balance: 125.0 Bank 1 lent money to 2 banks. Borrower's ID: 2 Amount borrowed: 40.0 Borrower's ID: 3 Amount borrowed: 85.0
Bank 2's loan information!!
Bank's balance: 175.0 Bank 2 lent money to 2 banks. Borrower's ID: 0 Amount borrowed: 125.0 Borrower's ID: 3 Amount borrowed: 75.0
Bank 3's loan information!!
Bank's balance: 75.0 Bank 3 lent money to 1 bank. Borrower's ID: 0 Amount borrowed: 125.0
Bank 4's loan information!!
Bank's balance: 181.0 Bank 4 lent money to 1 bank. Borrower's ID: 2 Amount borrowed: 125.0