// Eric Perino & Kathleen Williams

#include <string>
#include <iostream>
#include <iomanip>
#include <vector>

using namespace std;

class Account {

public:
 Account(string s, double b) {
 
  ID = s;
  balance = b;
 }
 
 string getID() const {
  return ID;
 }
 
 double getBalance() const {
  return balance;
 }

 void setBalance(double b) {
  balance = b;
 }

 bool withdraw(double money) {
  if (balance - money >= 0) 
   return true;
  else
   return false; 
 }

 void deposit(double money) {
  balance += money;
   
 }
 
private:
 string ID;
 double balance;


friend bool operator<(Account a, Account b) {
 return (a.balance < b.balance);
}

};

bool operator==(Account a, Account b) {
 return (a.getID() == b.getID());
}


int main() {

Account *p;
vector<Account> v;

bool done = false;
string x,a;
double b;

while(!done)
{
cout << "Enter your Account ID and Balance: " << endl;
cin >> a >> b;
Account *newAccount = new Account(a,b);

v.push_back(*newAccount);

cout << "Are you done adding Accounts? Y/N" << endl;
cin >> x;
if (x == "Y" || x == "y")
 done = true;
else
 done = false;
} // end of while loop

vector<Account>::const_iterator i;
for(int i=v.begin();i!=v.end();i++)
	{
		cout<<*i;
	}


return 0;

}
