Write a program that prompts the user to enter the account’s present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function named futureValue that returns the future value of the account, after the specified number of months. The program should display the account’s future value.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

11.Future Value chapter 1 to 6 terminology only!!!!

Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula, which is known as the future value formula, is

F=P×(1+i)tF=P × (1+i)t

The terms in the formula are as follows:

  • F is the future value of the account after the specified time period.

  • P is the present value of the account.

  • i is the monthly interest rate.

  • t is the number of months.

Write a program that prompts the user to enter the account’s present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function named futureValue that returns the future value of the account, after the specified number of months. The program should display the account’s future value.

 

below is the code// how to add it to this code below under void challenge 10

//use only chapter 1-6 terminology!!
// must validate input using do while loop examle line 98 - 108
// //call functions and follow the challenge instructions
//Description: Assignment6 C++ Chapter 6

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;

// Function prototypes
int menuOption();

double getSales(string divisionName);
void findHighest(double salesNE, double salesSE, double salesNW, double salesSW);
void Challenge3();

double fallingDistance(int time);
void Challenge5();

double celsius();
void Challenge7();

void Challenge9();

void Challenge10();

void Challenge11();

void Challenge18();

void Challenge20();

void Challenge23();

void Challenge24();


// driver function
int main()
{
do
{
switch (menuOption())
{
case 0: exit(1); break;
case 3: system("cls"); Challenge3(); break;
case 5: system("cls"); Challenge5(); break;
case 7: system("cls"); Challenge7(); break;
case 9: system("cls"); Challenge9(); break;
case 10: system("cls"); Challenge10(); break;
case 11: system("cls"); Challenge11(); break;
case 18: system("cls"); Challenge18(); break;
case 20: system("cls"); Challenge20(); break;
case 23: system("cls"); Challenge23(); break;
case 24: system("cls"); Challenge24(); break;
default: cout << "\t\tERROR - Invalid option. Please re-enter."; break;
}
cout << "\n";
system("pause");
} while (true);

return EXIT_SUCCESS;

}

int menuOption()
{
system("cls");
cout << "\n\t\tChapter 6: Functions (page 372-380) ";
cout << "\n\t" + string(60, char(205));
cout << "\n\t\t 3. Winning Division ";
cout << "\n\t\t 5. Falling Distance ";
cout << "\n\t\t 7. Celsius Temperature Table ";
cout << "\n\t\t 9. Present Value ";
cout << "\n\t\t 10. Future Value ";
cout << "\n\t\t 11. Lowest Score Drop ";
cout << "\n\t\t 18. Paint Job Estimator ";
cout << "\n\t\t 20. Stock Profit ";
cout << "\n\t\t 23. Prime Number List ";
cout << "\n\t\t 24. Rock, Paper, Scissors Game";
cout << "\n\t" + string(60, char(196));
cout << "\n\t\t 0. Quit";
cout << "\n\t" + string(60, char(205));
cout << "\n\t\t Option: ";

int option;
cin >> option;
cin.clear();
cin.ignore(999, '\n');

return option;
}
double getSales(string divisionName)
{
double sales; // local variable

do
{
cout << "Enter the quarterly sales for " << divisionName << ": $";
cin >> sales;

if (sales < 0)
cout << "Error: invalid input sales.\n";
else
return sales;

} while (true);
}

//declaring prototype

void findHighest(double salesNE, double salesSE, double salesNW, double salesSW)
{
if (salesNE >= salesSE && salesNE >= salesNW && salesNE >= salesSW)
cout << "Sales North East: $" << salesNE;
else if (salesSE >= salesNE && salesNE >= salesNW && salesSE >= salesSW)
cout << "Sales South East: $" << salesSE;
else if (salesNW >= salesNE && salesNE >= salesNW && salesSE >= salesSW)
cout << "Sales NorthWest: $" << salesNW;
else
cout << "Sales South West: $" << salesSW;
}

 


// Winning Division - page 373
void Challenge3()
{

double salesNE = getSales("NorthEast");
double salesSE = getSales("SouthEast");
double salesNW = getSales("NorthWest");
double salesSW = getSales("SouthWest");

//Output
findHighest(salesNE, salesSE, salesNW, salesSW);

}

double fallingDistance(int time)
{
return 0.5 * 9.8 * pow(time, 2);
}

// Falling Distance - pg 374
void Challenge5()
{
int time = 0;
// do while loop for validation
do
{
cout << "Enter the time in seconds: ";
cin >> time;
if (time < 0)
cout << "Error: invalid input time.\n";
else
break; // break out of the loop
} while (true);

cout << "The distance: " << fallingDistance(time) << '\n';
}

//Celsius Temperature Table

double celsius(double c, double f)
{
return 0.0;
}

void Challenge7()
{
const int minTemp = 0
}

void Challenge9()
{
// You will implement
}

void Challenge10()
{
// write code here
}

void Challenge11()
{
// You will implement
}

void Challenge18()
{
// You will implement
}

void Challenge20()
{
// You will implement
}

void Challenge23()
{
// You will implement
}

void Challenge24()
{
// You will implement
}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY