Can someone help me with this program Modify the savings acc
Solution
#include <iostream>
void getBalance(float);
/* run this program using the console pauser or add your own getch, system(\"pause\") or input loop */
using namespace std;
int main(int argc, char** argv) {
float balance =0.0,min,max,deposit=0;
int a,b;
int i;
cout << \"DEPOSIT:\\t\" ;
cin >> balance;
deposit =balance;
cout << \"MINIMUM interest rate(in decimal form):\\t\";
cin >> min;
cout << \"MAXIMUM interest rate(in decimal form):\\t\";
cin >> max;
a = ((max*100) - (min * 100))+1;
for(b=1;b<=a;b++){
switch(b){
case 1:cout << \"Rate \"<< b << \"%:\" << \"\ \";
for(i=1;i<=3;i++){
balance = balance + (balance *(min)) ;
cout << \"\\t\\tYear\"<< i <<\":\\t\" << balance << \"\ \";
}
break;
case 2:cout << \"Rate \"<< b << \"%:\" << \"\ \";
min = min + 0.01;
balance = deposit;
for(i=1;i<=3;i++){
balance = balance + (balance *(min)) ;
cout << \"\\t\\tYear\"<< i <<\":\\t\" << balance << \"\ \";
}
break;
case 3:cout << \"Rate \"<< b << \"%:\" << \"\ \";
balance = deposit;
for(i=1;i<=3;i++){
balance = balance + (balance *(max)) ;
cout << \"\\t\\tYear\"<< i <<\":\\t\" << balance << \"\ \";
}
break;
}
}
cout << \"Initial deposited amount =\" ;getBalance(deposit) ;
return 0;
}
void getBalance(float deposit){
cout << deposit;
}

