Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update currencyconvert.java and Create Bank.java #163

Merged
merged 2 commits into from
Oct 2, 2023
Merged

Update currencyconvert.java and Create Bank.java #163

merged 2 commits into from
Oct 2, 2023

Commits on Oct 2, 2023

  1. Update currencyconvert.java

    Code Organization: The code is organized into a more structured manner with proper indentation and comments to improve readability.
    
    Use Constants: Define constants for strings like "million", "billion", and "trillion" to avoid using string literals directly in the code.
    
    Use Descriptive Variable Names: Use more descriptive variable names to improve code readability.
    
    Exception Handling: Added exception handling to catch NumberFormatException if the provided amount is not a valid number.
    
    Close Resources: Closed the input stream (in) properly using a try-with-resources block to ensure resources are released correctly.
    
    Remove Unnecessary Imports: Removed unnecessary imports that were not used in the code.
    THEPHD1331 authored Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0324520 View commit details
    Browse the repository at this point in the history
  2. Create Bank.java

    This code represents a simple banking application that allows customers to perform various banking operations
    
    It defines a class Account that represents a bank account with attributes like balance, previous transaction, customer name, and customer ID. The class includes methods for depositing, withdrawing, and viewing the previous transaction.
    
    The start method in the Account class serves as the main interaction point with the user. It displays a menu of options for checking the balance, depositing, withdrawing, viewing the previous transaction, and exiting. It repeatedly prompts the user for their choice until they choose to exit.
    
    The Bank class is the main class of the program. It creates three instances of the Account class, each representing a different customer's account.
    
    Users are prompted to enter a PIN, and based on the PIN entered, one of the customer accounts is accessed using the start method.
    
    The program provides a simple text-based interface for customers to interact with their accounts.
    
    It demonstrates basic object-oriented programming principles and user interaction with a console-based banking application.
    THEPHD1331 authored Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0e105ed View commit details
    Browse the repository at this point in the history