Computer Science, asked by shadowkingt0321, 1 month ago

1. WAP to accept principal, rate and time from the user to calculate simple interest.

Answers

Answered by BrainlyProgrammer
4

Answer:

Simple Interest formula:-

 \tt \: simple \: interest =  \dfrac{principal \ast rate \ast time}{100}

//Assuming it is Java Programming

import java.util.Scanner;

class SI{

public static void main (String ar []){

Scanner sc=new Scanner (System.in);

System.out.println("Enter Principal, Rate and Time");

double principal=sc.nextDouble();

double rate=sc.nextDouble();

int time=sc.nextInt();

double si=(principal*rate*time)/100;

System.out.println("Simple Interest"+si);

}

}

ProTips:-

  • Always provide required data types to variables
  • Like rate and principal can be in decimal so it should be in double data type while time is always in integer data type
Answered by purveshKolhe
3

\huge{ \green{ \boxed{ \red{ \mathfrak{answer \: : }}}}}

Formula for Simple Interest::

 \huge \frac{p \times r \times t}{100}

QBASIC::

CLS

INPUT "Enter the principal",p

INPUT "Enter the rate",r

INPUT "Enter the time",t

PRINT "Your answer : " + (p*r*t)/100

END

JAVA::

import java.util.Scanner;

public class Brainly {

public static void main(String [] args) {

Scanner sc = new Scanner(System.in);

double p = sc.nextInt();

double r = sc.nextInt();

double t = sc.nextInt();

// first enter principal, then rate and then time in years.

System.out.println("Your answer : " + (p * r * t) / 100.0);

}

}

Logic::

==> Both programs store principal in variable p, rate in variable r, and time in variable t.

Hope This Helps You..

Similar questions