Question
Write a java program to find simple interest and compound interest. Define proper class and methods in your program.
Answer :
Word Count : 201
____ _____ ___ __________ ____.
_________ _____ _____ __________ _____ ____ ______ ______ _______.
________ ____ _____ _____ _______ _______ _________ ______.
___ _________ ________ _____ ___ _______ ____ _______.
________ ___ ______ ____ _________ ________ ___ _________ ____ __________.
____ _________ ______ ______ _____ _____ __________ ___.
__________ _________ ___ _______ ___ _____ _________ ________ ______ _______ _____.
____ ________ _______ _____ _______ _______ ___ _________ ____.
____ ______ ________ _________ _____ __________ _______ ___ ________ ________ _____ ______.
___ _______ ____ _____ ________ _______ ______ _______ ________ ____ __________.
___ ___ ___ _________ ______ ___ ______ ___ ___.
_____ ________ _______ ___ ___ ______ ________.
__________ __________ ___ ____ ______ ____ _______ _______ _______.
__________.
Skip in 10
```java // Java program to calculate Simple Interest and Compound Interest class InterestCalculator { // Method to calculate Simple Interest public double calculateSimpleInterest(double principal, double rate, double time) { return (principal * rate * time) / 100; } // Method to calculate Compound Interest public double calculateCompoundInterest(double principal, double rate, double time) { return principal * Math.pow((1 + rate / 100), time) - principal; } public static void main(String[] args) { InterestCalculator calculator =
___ _____ _____ _______ ___ ______ ______ _______ ____ ____.____ _____ ___ __________ ____.
_________ _____ _____ __________ _____ ____ ______ ______ _______.
________ ____ _____ _____ _______ _______ _________ ______.
___ _________ ________ _____ ___ _______ ____ _______.
________ ___ ______ ____ _________ ________ ___ _________ ____ __________.
____ _________ ______ ______ _____ _____ __________ ___.
__________ _________ ___ _______ ___ _____ _________ ________ ______ _______ _____.
____ ________ _______ _____ _______ _______ ___ _________ ____.
____ ______ ________ _________ _____ __________ _______ ___ ________ ________ _____ ______.
___ _______ ____ _____ ________ _______ ______ _______ ________ ____ __________.
___ ___ ___ _________ ______ ___ ______ ___ ___.
_____ ________ _______ ___ ___ ______ ________.
__________ __________ ___ ____ ______ ____ _______ _______ _______.
__________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.