#include <string>
#include <iostream>
#include <iomanip>
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() {
 string ID;
 double balance;
 int choice = 0;
 
 cout << "Enter your new account ID and balance: ";
 cin >> ID >> balance;
 Account bob(ID,balance);
 cout << "ID: " << bob.getID() << " Balance: " << bob.getBalance() << endl;
 
 cout << "Enter your new account ID and balance: ";
 cin >> ID >> balance;
 Account bill(ID,balance);
 cout << "ID: " << bill.getID() << " Balance: " << bill.getBalance() << endl;
 
 if (bob == bill) 
  cout << "These people are the same: " << endl;
 else
  cout << "Not the same" << endl;
  
 if (bob < bill) 
  cout << "bob is poorer than bill " << endl;
 else
  cout << "it is not the case bob is poorer than bill" << endl;
 
 while (choice != 5) {
 cout << "(1) Deposit, (2) Withdraw, (3) Set Balance, (4) Get Balance, (5) Quit" << endl;
 cin >> choice;
 
 if (choice == 1) {
  int amount = 0;
  cout << "Enter amount to deposit: ";
  cin >> amount;
  bob.deposit(amount);
  cout << "ID: " << bob.getID() << " Balance: " << bob.getBalance() << endl;;
 }
 
 if (choice == 2) {
  int amount = 0;
  cout << "Enter amount to withdraw: ";
  cin >> amount;
  if (bob.withdraw(amount))
   bob.setBalance(bob.getBalance() - amount);
  else
   cout << "You cannot perform this transaction" << endl;
  cout << "ID: " << bob.getID() << " Balance: " << bob.getBalance() << endl; 
 }
 
 if (choice == 3) {
  int amount = 0;
  cout << "Enter amount to set: ";
  cin >> amount;
  bob.setBalance(amount);
  cout << "ID: " << bob.getID() << " Balance: " << bob.getBalance() << endl;
 }
 
 if (choice == 4) {
  cout << "ID: " << bob.getID() << " Balance: " << bob.getBalance() << endl;
 }
 
} 
 return 0;
}
