c++ Problem 3 Interest Earned 12 points Assuming there are no deposits other tha
ID: 3753020 • Letter: C
Question
c++
Problem 3 Interest Earned 12 points Assuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as: Amount Principal (Rate/T) Principal is the balance in the savings account, Rate is the interest rate, and T is the number of times the interest is compounded during a year (T is 4 if the interest is compounded quarterly Write a program that asks for the principal, the interest rate, and the number of times the interest rate is compounded. You may use any functions provided by # include cmath. Format your output nicely that all numbers and decimals align as shown in the example! Limit decimals to two digits. INPUT Interest Rate: Times Compounded: 12 Initial Investment:1000 4.25 -OUTPUT Principal: interest at 4.25%:$ 43.34 Amount in Savings: 1043.34 s 1000.00 Problem 4 Ingredient Adjuster 5 pointsExplanation / Answer
Program:
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x,tc,ii;
float ir,temp,ci,a;
cout<<" Interest Rate:";
cin>>ir;
cout<<" Times Compounded:";
cin>>tc;
cout<<" Initial Investment:";
cin>>ii;
tc=tc/12;
temp=(ir/100);
temp=temp+1;
ci=pow(temp,tc);
a=ci*ii;
cout<<" Principal :"<<ii;
cout<<" Intrest at :"<<ir<<":"<<(a-ii);
cout<<" Amount in Savings:"<<a;
return 0;
}
Output:
Interest Rate:4.25
Times Compounded:12
Initial Investment:1000
Principal :1000
Intrest at :4.25:42.5
Amount in Savings:1042.5
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.