Computer Science, asked by Agent761, 5 months ago

Write a program in java to accept principal, rate and time. Calculate interest accumulated for first year, second year and third year compounded annually.​

Attachments:

mehtabsolanki14: hii

Answers

Answered by mrfries77
1

Answer:

public class Accounting{

    public static void main(String []args){

       double interest = calculate_interest(45000, 0.095, 6);

       System.out.println(interest);

    }

   

    public static double calculate_interest(double principle, double rate, double time) {

   

        return(principle * rate * time);

       

    }

}

Explanation:

The formula for interest is principle * rate * time.


Agent761: but we want interest for 3 years
Agent761: and can you please give answer according to class 8
mrfries77: Please specify parameters in the future. I don't know the numbers given to you in class.
Similar questions