Hello,

Sign up to join our community!

Welcome Back,

Please sign in to your account!

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

  • 0
Homework Help Staff
Teacher

Java program to calculate simple interest using constructor overloading for attributes like principal rate and time

Java program to calculate simple interest using constructor overloading for attributes like principal rate and time

Related Questions

1 Answer

  1. package javaapplication1;

    import java.util.*;

    class amount

    {

    double amount;

    double intrest;

    int year;

    amount(double a, double i)

    {

    a=amount;

    i=intrest;

    int y=year=5;

    double s_intrest;

    }

    }

    public class Main

    {

    public static void main(String[] args)

    {

    double a,i,s_intrest;

    int y=5;

    Scanner s=new Scanner(System.in);

    a=s.nextDouble();

    i=s.nextDouble();

    amount a1=new amount(a,i);

    s_intrest=(a*i*y)/100;

    System.out.println(s_intrest);

    }

    }

You must login to add an answer.