Skip to content

Fix deposit calculator #1936

Description

@Eugenethe1st

def calculate_net_interest(principal, annual_rate_percent, months):
days = months * 30 # Assuming 30 days per month
year_basis = 365 # Fixed

rate = annual_rate_percent / 100  # Convert to decimal
gross_interest = principal * rate * (days / year_basis)
vat = gross_interest * 0.10
net_interest = gross_interest - vat

return {
    "Gross Interest": round(gross_interest, 2),
    "VAT (10%)": round(vat, 2),
    "Net Interest": round(net_interest, 2)
}

Example usage

principal = float(input("Enter Principal Amount (₦): "))
rate = float(input("Enter Annual Interest Rate (%): "))
months = int(input("Enter Duration in Months: "))

result = calculate_net_interest(principal, rate, months)

print("\n--- Interest Calculation Result ---")
for key, value in result.items():
print(f"{key}: ₦{value}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions