Write a program that calculates savings accounts yearly savings accounts amount. The savings account pay an interst rate of 5% yearly if the amount saved is at least $500 and they are saving for at least 5 years, otherwise the interest is 3%. Your prgram should ask the user how much money they are saving and how many years they are saving for. You will output the initial amount saved and the amount they will have in the account at the end of each year
Explanation / Answer
//in cpp (c++) #include #include using namespace std; int main(){ //declare variables int rate; double SavingAmount; int years; double balance; //SavingAmount and year from user coutSavingAmount; coutyears; if(SavingAmount>=500 && years>=5) rate=5; else rate=3; balance= SavingAmount; //output year (still initial value) cout