#include<iostream>
using namespace std;
class account
{
public:
void calculate() { amount += amount*interestrate; }
static double rate() { return interestrate; }
static void rate(double);
private:
std::string owner;
double amount;
static double interestrate;
static double initate();
};
void account::rate(double newrate)
{
interestrate = newrate;
}
double account::initate()
{
return interestrate;
}
double account::interestrate = initate();
int main()
{
account::rate(2);
return 0;
}
using namespace std;
class account
{
public:
void calculate() { amount += amount*interestrate; }
static double rate() { return interestrate; }
static void rate(double);
private:
std::string owner;
double amount;
static double interestrate;
static double initate();
};
void account::rate(double newrate)
{
interestrate = newrate;
}
double account::initate()
{
return interestrate;
}
double account::interestrate = initate();
int main()
{
account::rate(2);
return 0;
}