public class company
{ public String name;
  public double capital,balance,profit;
  public int process;
  //this method establish the company  

  //constructor method
  public company(String is,double Ri) 
  {name=is;
  capital=Ri;
  balance=Ri;
  profit=0;
  process=0;
  }
   
  public void  buy(double x) 
  {balance-=x;
   process++;
   if(balance<=0) 
     {System.out.println("company is broken "+process);}
  }
  
  public void  sell(double x) 
  {balance+=x;
   profit=balance-capital;
   process++;
  }
  
  public String acount()
  { String s="------------"+name+"--------------------\n"; 
  if(balance<=0) 
     s+="company is broken \n";
  else
     s+=" capital = "+capital+" TL\n";
     s+=" balance = "+balance+" TL\n";
     s+=" profit = "+profit+" TL\n";
     s+=" number of processes = "+process+" \n";
  return s; 
  }       
}