SlideShare a Scribd company logo
1 of 2
Write a program that calculates the final value of a ten year, $10,000 investment whose annual
return gradually declines from 2% to 1% over that term.
Solution
//Header file section
#include<iostream>
using namespace std;
//Program begins with a main function
int main()
{
//Initialize variables
double investment=10000, highIntrest=0.02,changeIntrest=0.01,years=10,result;
//prompt output
cout<<"Year "<<"Final_value "<<endl;
//Calculate the final value of a ten year
for(int i=1;i<=10;i++)
{
investment = (investment* highIntrest)+investment;
highIntrest=changeIntrest;
cout<<i<<"Â Â Â Â "<<investment<<endl;
}
cout<<"Final Value of a ten year="<<investment<<endl<<endl;
//Pause the system for a while
system("pause");
return 0;
}
Write a program that calculates the final value of a ten year- $10-000 (1).docx

More Related Content

More from drosa1

Write a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxWrite a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxdrosa1
 
You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxdrosa1
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxdrosa1
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxdrosa1
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxdrosa1
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxdrosa1
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxdrosa1
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxdrosa1
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxdrosa1
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docxdrosa1
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxdrosa1
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxdrosa1
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxdrosa1
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docxdrosa1
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxdrosa1
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxdrosa1
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxdrosa1
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxdrosa1
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxdrosa1
 

More from drosa1 (19)

Write a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docxWrite a program to throw the InputMismatchException-Solutionimport jav.docx
Write a program to throw the InputMismatchException-Solutionimport jav.docx
 
You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docx
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docx
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docx
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docx
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docx
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docx
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docx
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docx
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docx
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docx
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docx
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docx
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docx
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docx
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docx
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docx
 

Recently uploaded

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 

Recently uploaded (20)

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 

Write a program that calculates the final value of a ten year- $10-000 (1).docx

  • 1. Write a program that calculates the final value of a ten year, $10,000 investment whose annual return gradually declines from 2% to 1% over that term. Solution //Header file section #include<iostream> using namespace std; //Program begins with a main function int main() { //Initialize variables double investment=10000, highIntrest=0.02,changeIntrest=0.01,years=10,result; //prompt output cout<<"Year "<<"Final_value "<<endl; //Calculate the final value of a ten year for(int i=1;i<=10;i++) { investment = (investment* highIntrest)+investment; highIntrest=changeIntrest; cout<<i<<"Â Â Â Â "<<investment<<endl; } cout<<"Final Value of a ten year="<<investment<<endl<<endl; //Pause the system for a while system("pause"); return 0; }