here ya go..
Code:
*****************Header File**********************
#ifndef SAVE_H
#define SAVE_H
class savingsAccount
{
public:
void savingsBalance(int);
void AnualInterestR8(float);
void modifyInterestR8(float);
void calculateMonthlyIntrest(int, float);
void print();
int holdB(int);
int holdI(float);
int balance;
int intrest;
int k = 6000;
float j = .03;
double totbal;
double calcint;
};
#endif
***************Function File**********************
#include <iostream>
using namespace std;
#include "SAVE.H"
void savingsAccount::savingsBalance(int k)
{
k = balance;
savingsAccount::holdB(k);
}
void savingsAccount::AnualInterestR8(float j)
{
j = intrest;
savingsAccount::holdI(j);
}
void savingsAccount::calculateMonthlyIntrest(int q , float w)
{
q = holdB(k);
w = holdI(j);
calcint = (q * w)/ 12;
totbal = calcint + q;
cout<<"The monthly intrest income for your current balance is: "<<calcint<<endl;
cout<<"\nYour total balance is "<<totbal<<endl;
}
void savingsAccount::modifyInterestR8(float d)
{
cout<<"Enter a new intrest rate\n";
cin>>d;
d = intrest;
}
void savingsAccount::print()
{
cout<<"*********Balance :"<<balance<<" Annual Interest r8: "<<intrest<<"**********\n";
cout<<"\n\n Monthly Balance : "<<totbal<<"Total Intrest Gained: "<<calcint<<endl;
}
int savingsAccount::holdB(int f)
{
int holdBal;
holdBal = f;
return f;
}
int savingsAccount::holdI(float q)
{
int holdInt;
holdInt = q;
return q;
}
******************Driver Program*******************
#include <iostream>
using namespace std;
#include "SAVE.H"
int main()
{
int bal;
float int1;
float int2;
savingsAccount s1;
cout<<"Seeing how i hate to follow directions, enter the ballance of your first account!\n";
cin>>bal;
s1.savingsBalance(bal);
cout<<"Input the intrest rate on your balance.\n";
cin>>int1;
s1.AnualInterestR8(int1);
s1.calculateMonthlyIntrest(bal, int1);
return 0;
}