Java Program to calculate Simple Interest | Step by Step Tutorial

Опубликовано: 27 Февраль 2026
на канале: CodeVista - Sanjay
332
0

Welcome to our Java Simple Interest Calculator tutorial! In this video, we'll guide you through creating a simple Java program to calculate the simple interest for a given principal amount, interest rate, and time period. Whether you're new to Java or looking to practice your coding skills, this tutorial is perfect for you. 💰🔢

👉 What you'll learn:

Basics of Java programming
Variables and data types
Mathematical operations in Java
How to calculate simple interest using Java
📘 Java Simple Interest Calculator Code:

java
Copy code
// Java program to calculate simple interest

/*
Java Program to Calculate Simple Interest

Simple Interest = (P x T x R)/100
Where,
P is the principal amount
T is the time and
R is the rate

*/

import java.util.Scanner;

public class SimpleInterest {
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter Principle Amount: ");
double P = sc.nextDouble();

System.out.print("Enter Time: ");
double T = sc.nextDouble();

System.out.print("Enter Rate: ");
double R = sc.nextDouble();

double SI = (P * T * R) / 100;

double TotolAmount = P + SI;

System.out.println("Simple Interest: " + SI);
System.out.println("Total Amount: "+TotolAmount);


}
}


👍 If you found this video helpful, please like, share, and subscribe for more Java tutorials!

#JavaTutorial #SimpleInterest #JavaProgramming #CodingForBeginners #ProgrammingBasics #JavaForBeginners #MathInJava #CodeTutorial #LearnJava #CodingTutorial #ProgrammingTutorial"