हिंदी

A certain amount of money is invested for 3 years at the rate of 6%, 8% and 10% per annum compounded annually. Write a program to calculate: - Computer Applications

Advertisements
Advertisements

प्रश्न

A certain amount of money is invested for 3 years at the rate of 6%, 8% and 10% per annum compounded annually. Write a program to calculate: 

  1. the amount after 3 years.
  2. the compound interest after 3 years.

Accept certain amount of money (Principal) as an input.

Hint: A = P * `(1 + ("R"1)/100)^"T"` * `(1 + ("R"2)/100)` * `(1 + ("R"3)/100)` and CI = A − P

संक्षेप में उत्तर

उत्तर

import java.util.*; 
public class U5_Q7
{public static void main(String args[])
{
Scanner in = new Scanner(System.in); 
double P, T = 3.0, CI = 0.0, A = 0.0, R1 = 6.0, R2 = 8.0, R3 = 10.0
System.out.println("Enter the principal"); 
P = in.nextDouble(); 
A = P * Math.pow((1 + R1 / 100.0), T) * Math.pow((1 + R2 / 100.0), T) * Math.pow((1 + R3 / 100.0), T); 
CI = A − P;
System.out.println("Amount after 3 years = " + A);
System.out.println("Compound Interest after 3 years = " + CI);
}}
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.06: Input in Java - EXERCISES [पृष्ठ ६७]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.06 Input in Java
EXERCISES | Q V. 7. | पृष्ठ ६७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×