Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

image text in transcribed

**************************************************This is my code*********************************************************

#include #include #include using namespace std;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions