From 00ded38a728c34d631b192359814a46585dc5317 Mon Sep 17 00:00:00 2001 From: Yash Parsana Date: Tue, 11 May 2021 22:19:21 +0530 Subject: [PATCH 1/3] new file ex2_2.cpp added --- ch02/ex2_2.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ch02/ex2_2.cpp diff --git a/ch02/ex2_2.cpp b/ch02/ex2_2.cpp new file mode 100644 index 000000000..e69de29bb From 73b3405c5ebfe866fec41a70c27a83054833f466 Mon Sep 17 00:00:00 2001 From: Yash Parsana Date: Tue, 11 May 2021 22:38:02 +0530 Subject: [PATCH 2/3] new file ex2_2.cpp added --- ch02/ex2_2.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/ch02/ex2_2.cpp b/ch02/ex2_2.cpp index e69de29bb..f2411f9f4 100644 --- a/ch02/ex2_2.cpp +++ b/ch02/ex2_2.cpp @@ -0,0 +1,47 @@ +//AUTHOR YASH PARSANA +//DATE 11-05-2021 +//CALCULATOR To calculate a mortgage payment + +#include +using std::cin; +using std::cout; +using std::endl; + +float po(float r,int n) +{ + float ans=1; + + for(int z=1;z<=n;z++) + { + ans*=r; + } + return ans; +} +int main() +{ + float p_amount,rate; // FLOAT TAKES HALF SPACE AS COMPARE TO DOUBLE AND HERE HAVE NO REQUIREMENT OF DOUBLE + int year; + + cout<<"Please Enter principal Amount : "; + cin>>p_amount; + cout<>rate; + cout<>year; + cout< Date: Tue, 11 May 2021 22:41:56 +0530 Subject: [PATCH 3/3] new file ex2_2.cpp added --- ch02/ex2_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch02/ex2_2.cpp b/ch02/ex2_2.cpp index f2411f9f4..20092772e 100644 --- a/ch02/ex2_2.cpp +++ b/ch02/ex2_2.cpp @@ -4,7 +4,7 @@ #include using std::cin; -using std::cout; +using std::cout; using std::endl; float po(float r,int n)