//class declaration and definition of Bankaccount
"double balance, interest, rate;"
int year;
"cout" < "enter="" initial="" bank="" balance:="">
cin >> balance;
cout < "what="" are="" the="" estimated="" years="" you="" plan="" to="" maintain="" your="" initial="" balance:="">
cin >> year;
cout < "="" \n***bank="" balance="" interest="">
if (balance < 30000)="">
"rate = 0.02;"
}
"else if (balance < 50000)"="">
"rate = 0.03;"
}
"else if (balance < 80000)"="">
"rate = 0.04;"
}
else {
rate = 0.05;
}
interest = balance * rate;
balance = balance + interest;
"cout" < "setiosflags"("ios::fixed"="" |="" "ios::showpoint")=""><>
"cout" < ""after="" 1="" year,="" $""="">< "balance"="">< "="" at="" an="" interest="" rate="" of="" "="">< rate=""><>
"for (int i = 2; i <= year;="" i++)"="">=>
"interest = balance * rate;"
"balance" = "balance" + "interest";"
"cout" < "after="" "="">< i="">< "="" years,="" $"="">< "balance"="">< "="" at="" an="" interest="" rate="" of="" "="">< rate=""><>
}
return0;
}