Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Discounting
//g++ 7.4.0 //Discounting: finding the present value of a future sun //created by Rezaul Hoque on December 10,2020 //contact at jewelmrh@yahoo.com #include <iostream> #include <cmath> using namespace std; int main () { double s, p,m, i, t,base, top, etop; cout<<"Enter sum, discount rate & time:\n"; cin>>s>>i>>t; cout<<"Now enter number of times the sum to be compounded:\n"; cin>>m; base=(1+(i/m)); etop=i*t; top=m*t; //multiple compounding if(m<365) p=s/pow(base,top); else //continuous compounding p=s/exp(etop); cout<<"The sum that will pay $ "<<s<<" after "<<t<<" year(s) is actually worth $"<< p<<" today "<<endl; return 0; }
run
|
edit
|
history
|
help
0
gp series
Średnia bez zera
srednie
Korelacja Pearsona lol
derivative
Pointer to class members
simple serialization
NameTempSpecial
multiply_without_asterisk
better o/p of factor problem