A Java-based console application developed as part of the CodeAlpha Java Programming Internship – Task 2.
The Stock Trading Platform simulates a basic stock market environment where users can view market data, buy and sell stocks, manage their portfolio, track transactions, and monitor portfolio performance.
- 📊 View available stock market data
- 💰 Buy stocks
- 💸 Sell stocks
- 📁 Manage stock portfolio
- 💳 Track account balance
- 📜 View transaction history
- 📈 Update simulated market prices
- 📊 Analyze portfolio performance
- 💵 Calculate profit and loss
⚠️ Validate user inputs- 💾 Save and load application data using File I/O
- 🖥️ Interactive console-based menu
- Java
- Object-Oriented Programming (OOP)
- ArrayList
- Java Collections
- File I/O
- Console-based Interface
This project demonstrates several core Object-Oriented Programming concepts:
- Classes and Objects
- Encapsulation
- Constructors
- Methods
- Object interaction
- ArrayList and Collections
- Separation of responsibilities between classes
CodeAlpha_StockTradingPlatform/
│
├── Main.java
├── Stock.java
├── Portfolio.java
├── Transaction.java
├── User.java
├── StockMarket.java
├── DataManager.java
├── README.md
└── .gitignore
Contains the main application, user interface, and menu-driven program flow.
Represents individual stocks and stores their market information.
Manages the user's stock holdings and portfolio calculations.
Stores information about buying and selling transactions.
Manages user-related information and account details.
Manages available stocks and simulated market prices.
Handles saving and loading application data using File I/O.
The application provides the following options:
==========================================
MAIN MENU
==========================================
1. View Market Data
2. Buy Stock
3. Sell Stock
4. View Portfolio
5. View Transactions
6. View Account Balance
7. Update Market Prices
8. View Portfolio Performance
9. Save & Exit
==========================================
git clone https://github.com/ywxarchit/CodeAlpha_StockTradingPlatform.gitcd CodeAlpha_StockTradingPlatformjavac *.javajava MainThe application starts with an initial account balance and provides a menu-driven interface.
Users can:
- View available stocks and their current prices.
- Buy stocks by entering the stock symbol and quantity.
- Sell stocks from their existing portfolio.
- View their current portfolio holdings.
- Check previous transactions.
- Check their available account balance.
- Update simulated market prices.
- Analyze portfolio performance and profit/loss.
- Save application data and exit.
The application handles invalid user inputs such as:
- Invalid stock symbols
- Zero or negative quantities
- Insufficient account balance
- Selling more shares than currently owned
The project uses File I/O to save and retrieve application data, allowing important information such as portfolio and transaction data to be maintained between program executions.
Organization: CodeAlpha Program: Java Programming Internship Task: Task 2 – Stock Trading Platform
Archit Singh
B.Tech – Computer Science & Engineering
This project was developed for educational and internship purposes to strengthen practical knowledge of:
- Java Programming
- Object-Oriented Programming
- Collections
- File Handling
- Input Validation
- Console Application Development