Skip to content
pradeep-kotariPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation



Week 1: Object-Oriented Programming Basics (Java)

Learning Objectives

By the end of this week, learners will be able to:

  • Grasp the principles of Object-Oriented Programming (OOP)

  • Apply real-world financial logic using Java classes and objects

  • Construct reusable financial components using constructors and the this keyword

  • Structure applications using object methods and encapsulation


Day-by-Day Plan

Day 1: OOP in Financial Systems

Topics:

  • Core OOP principles: Abstraction, Encapsulation, Inheritance, Polymorphism

  • Classes vs Objects

  • Real-world financial analogies (Class = BankAccount blueprint, Object = your actual savings account)

Code Example:

class BankAccount {
    private String accountHolder;
    private double balance;
public void setDetails(String name, double bal) {
    this.accountHolder = name;
    this.balance = bal;
}

public void showBalance() {
    System.out.println("Account Holder: " + accountHolder);
    System.out.println("Balance: ₹" + balance);
}

}

public class Main { public static void main(String[] args) { BankAccount acc = new BankAccount(); acc.setDetails("Ravi", 12000); acc.showBalance(); } }

Classroom Activity:

  • Create a DigitalWallet class with private fields ownerName, amount, and a method checkBalance().

Day 2: Constructors, Encapsulation & this Keyword

Topics:

  • Constructors (default & parameterized)

  • this keyword

  • Benefits of encapsulation in financial applications

Code Example:

class LoanAccount {
    private String loanType;
    private double amount;
LoanAccount(String loanType, double amount) {
    this.loanType = loanType;
    this.amount = amount;
}

public void displayDetails() {
    System.out.println("Loan Type: " + loanType);
    System.out.println("Amount: ₹" + amount);
}

}

Task:

  • Create a FixedDeposit class with name, principalAmount, and durationInYears. Include a parameterized constructor and a display() method.

Day 3: Methods and Return Values

Topics:

  • Writing financial calculation methods

  • Understanding method parameters & return types

  • Basic math in Java

Code Example:

class EMICalculator {
    public double calculateEMI(double principal, double rate, int time) {
        return (principal * rate * time) / 100;
    }
}

public class Main { public static void main(String[] args) { EMICalculator emi = new EMICalculator(); double result = emi.calculateEMI(100000, 10, 2); System.out.println("Calculated EMI: ₹" + result); } }

Mini Challenge:

  • Create a CurrencyConverter class with methods:

    • toINR(double usd)

    • toUSD(double inr)

    • Assume USD to INR = 83


Day 4: Hands-On Coding Challenge

Task: Create a fully functional BankAccount class with:

  • Fields: accountNumber, accountHolder, balance

  • Methods: deposit(double amount), withdraw(double amount), printDetails()

  • Prevent overdraft (balance should not go negative)

Expected Output:

Account Holder: Aditi
Account Number: 123456
Balance: ₹5000.0

Day 5: Quiz + Review + Assignment

MCQs:

  1. What is the benefit of using constructors?

  2. What does the this keyword refer to?

  3. What is method overloading and is it supported in Java?

  4. What access modifier is best used for encapsulation?

Assignment: Build a Transaction class:

  • Fields: amount, type (“credit” or “debit”), timestamp

  • Use java.time.LocalDateTime for timestamp

  • Constructor & displayTransaction() method

  • main() method to create and display 3 transactions


Bonus: Assessment & Evaluation

Marks Distribution:

  • 10 points - BankAccount class (encapsulation, logic)

  • 10 points - Transaction class (constructor, timestamp handling)

  • 10 points - Quiz (MCQs + 1 coding snippet)

Submission Method:

  • Upload .java files or GitHub repo link

  • Optional: Submit a 2-3 minute video explaining your code and logic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages