Skip to content

YuriiJavaDev/JavaBasics_Task_8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Bank Account Transactions (JavaBasics_Task_8)

📌 Description

This project simulates basic banking operations using integer variables. It demonstrates how to perform balance transfers between accounts and apply bonuses using fundamental arithmetic operations in Java.

🚀 Task Requirements

  1. Declare two int variables: account1 with a value of 100 and account2 with a value of 200.
  2. Transfer funds:
    • Update account2 by adding the value of account1 to it.
    • Set account1 to 0.
  3. Apply a bonus:
    • Increase account1 by 50.
  4. Display the final balances of both accounts in the console.

📋 Expected Output

After running the program, the console should display the following:

Balance of Account 1: 50
Balance of Account 2: 300

🛠 Technical Stack

  • Language: Java 23
  • IDE: IntelliJ IDEA
  • Concepts: Variable initialization, Integer arithmetic, Console output.

⌨️ Practical Implementation

The code follows Java naming conventions and clean code principles.

💻 Code Example

The code uses simple assignment and addition to manage the state of the accounts:

public class Task_8_App {
   public static void main(String[] args) {
      // Initializing bank accounts
      int account1 = 100;
      int account2 = 200;

      // Transferring money from account1 to account2
      account2 = account2 + account1;
      account1 = 0;

      // Adding a bonus of 50 to account1
      account1 = account1 + 50;

      // Displaying final account balances
      System.out.println("Balance of Account 1: " + account1);
      System.out.println("Balance of Account 2: " + account2);
   }
}

⚖️ License

This project is licensed under the MIT License.

Copyright (c) 2026 Yurii Pavlenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files...

License: MIT

About

Learning project. JavaBasics_Task_8 Bank Account Transactions with expected result and detailed documentation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages