Computer Science, asked by papiya76, 21 days ago

Write a program to calculate the simple interest where principle rs 1250, rate 8% and time 3 years.​

Answers

Answered by Anonymous
3

{\textsf{\textbf{\underline{\Large Required knowledge}}}}

In order to write the program, firstly we should know the formula to calculate simple interest.

\boxed{\text{ Simple Interest = $\dfrac{P\times R \times T}{100}$}}

Here,

  • P = Principle amount
  • R = Rate of interest
  • T = Time period

Now, I'll write my program in python since language is not mentioned in the question.

{\textsf{\textbf{\underline{\Large The program}}}}

P = 1250

R = 8

T = 3

print(f"Simple interest is, {(P*R*T)/100}")

{\textsf{\textbf{\underline{\Large Outpu{}t}}}}

>>> Simple interest is, 300.0

{\textsf{\textbf{\underline{\Large Explanation}}}}

  • We have store the values in different variables namely P, R and T for Principle, Rate of interest and time period respectively.
  • Now using the print() function, we can print the required result on the output screen.
  • We have made use of f strings where we can add mathematically expressions or value of variable inside { }.
Answered by vr106367
3

Answer:

THE FOLLOWING IS IN A JAVA PROGRAM:

public class MyClass {

   public static void main(String args[]) {

     int principle = 1250;

     int rate = 8;

     int time = 3;

     System.out.println(principle*rate*time/100.0);

   }

}

Explanation:

PLEASE MARK ME AS BRAINLIEST!!!!

Similar questions