Question
So basiclly I'm supposed to get this output Enter future value Enter annual interest rate Enter number of years Present value: $295302.77 Future value: $1000000.00
So basiclly I'm supposed to get this output
Enter future value
Enter annual interest rate
Enter number of years
Present value: $295302.77
Future value: $1000000.00
Annual interest rate: 5.0%
Years: 25
**********
and i get this.How do i fix this?
**************************************************This is my code*********************************************************
#include
double futureVal() { double futureValue;
cout > futureValue;
return futureValue; } double annualInterest() { double interestRate;
cout > interestRate;
return interestRate; } int numOfYears() { int numberYears;
cout > numberYears;
return numberYears; } double calculatePresentValue(double futureValue, double interestRate, int numberYears) { return futureValue/pow((1+interestRate),numberYears);
}
int main() { double resultPresentValue;
double futureValue = futureVal(); if (futureValue
double interestRate = annualInterest(); if (interestRate
interestRate = interestRate/100; int numberYears = numOfYears(); if(numberYears
resultPresentValue = calculatePresentValue(futureValue, interestRate, numberYears); { cout
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started