Created
August 18, 2011 19:51
-
-
Save twopoint718/1154992 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cmath> | |
| using namespace std; | |
| int main() { | |
| double CostOfItem; | |
| double NumberYears; | |
| double Inflation; | |
| double Result; | |
| cout << " What's the cost of the item ? : " ; | |
| cin >> CostOfItem ; | |
| cout << " Number of years from now that the item will be purchased: " ; | |
| cin >> NumberYears ; | |
| cout << " Enter the rate of Inflation: " ; | |
| cin >> Inflation ; | |
| // Result = CostOfItem*Inflation^X | |
| Result = pow(CostOfItem * (1 + Inflation/100), NumberYears); | |
| cout << Result << endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment