1 ImportJava.util.Scanner;2 3 /**4 * Created by Lenovo on 2016/3/9.5 */6 Public classMain {7 Public Static voidMain (string[] args) {8Scanner Scanner =NewScanner (system.in);9 DoubleF,p,i,n;TenSystem. out.printf ("Enter initial amount"); Onep=scanner.nextdouble (); ASystem. out.printf ("Input investment Years"); -n=scanner.nextdouble (); -System. out.printf ("Input rate"); theI=scanner.nextdouble (); -F=p*math. POW (1 +i,n); - System. Out.print (F); - } +}
1. Customer said: Help me develop a compound interest calculation software.
Complete the compounding Formula calculation program and push it successfully onto GitHub.
Cut-off time: 3.10 Before 12 o'clock in the evening.
It's done according to this request.
Demonstrate.
Calculation: The principal is 1 million, the interest rate or the return on investment is 3%, the investment life is 30, then 30 years after the interest income: calculated by compounding formula is: 1,000,000x (1+3%) ^30
Customer proposed:
2. If according to simple interest calculation, how much is the principal and interest?
3. If a pension of $3 million is to be raised after 30, the average annual return is 3%, what is the amount of principal that must be invested now?
Complete 23 functions and successfully push to GitHub.
Cut-off time: 3.12 Before 11 o'clock in the evening
Remember to update the progress bar.
In addition, do you feel that customers will have further requirements, and before the next meeting to prepare for the presentation?
1 ImportJava.util.Scanner;2 3 Public classClass2 {4 5 Public Static voidMain (string[] args) {6Scanner Scanner =NewScanner (system.in);7 DoubleF,p=0,i,n;intSelect=1,select2=0;8System. out.printf ("Whether you need to calculate the principal (0~1 selection)");9Select2=scanner.nextint ();Ten if(select2==1) One{p=CALUTENP (); A System. Out.print (p); -Select=0; - } the -System. OUT.PRINTLN ("Enter initial amount"); -p=scanner.nextdouble (); -System. out.printf ("Input investment Years"); +n=scanner.nextdouble (); -System. out.printf ("Input rate"); +I=scanner.nextdouble (); ASystem. out.printf ("Whether you need to calculate simple interest: (0 is Yes)"); atselect=scanner.nextint (); - - if(select==0) -F=p*1+i*2; - Else -F=p*math. POW (1 +i,n); in System. Out.print (F); - to + } - the Public Static DoubleCALUTENP () { * Doublef,n,i,f; $Scanner Scanner =NewScanner (system.in);Panax Notoginseng - for(intj=0;j<8;j++) the { +System. Out.println (""); A } theSystem. out.printf ("Enter expected amount"); +f=scanner.nextdouble (); -System. out.printf ("Input Years"); $n=scanner.nextdouble (); $System. out.printf ("Input rate"); -I=scanner.nextdouble (); -f=f/(Math. POW (1 +i,n)); the returnF; - Wuyi the - Wu - } About $}
Customers also want to:
4. Interest rate is so low, compounding profits are so strong, if take 1 million yuan to buy annual rate of return 10% of the stock, if all smooth, too long, 1 million yuan becomes 2 million yuan?
Compound Interest Calculation 1.0~1.1-software engineering