Computer Science, asked by aanchaldhiman5011, 1 year ago

Write a c++ program to create account class. define constructor for this class. define a method to find the simple interest. make necessary assumptions.

Answers

Answered by sumon425
0

#include <iostream>

using namespace std;

class Account

{

private:

float principle,rate,time;

public:

Account(float p, float r, float t)

{

principle = p;

rate = r;

time = t;

}

float si()

{

return (principle*rate*time)/100;

}

};

int main()

{

Account ac(7259,7.5,6);

cout<<"Simple Interest is "<<ac.si()<<endl;

return 0;

}

Similar questions