Computer Mania

Computer Mania
tricks and tips

Search This Blog

Sunday, October 31, 2010

bank operation a simple c++ program

#include
#include
#include
#include
#include
class bank
{
 public:
  int acno[50];
  char name[50][15];
  char type[50][15];
  int typenum[50];
  float bal[50];
  static int max;
  void create(int,int);
  void deposit(int,int);
  void withdraw(int,int);
  void interest(int,int);
  void balance(int,int);
};
int bank::max;
void bank::create(int no,int fs)
{
 int k,i;
 float ba;
 char na[5];
 for(i=0;i
  if(acno[i]==no)
  {
   cout<<"Account number already Exist\n";
   getch();
   return;
  }
 a:
 cout<<"Enter name:";
 cin>>na;
 for(k=0;k
  if((na[k]>=97&&na[k]<=122)||(na[k]>=65 && na[k]<=90))
   continue;
  else
  {
   cout<<"Name must be an alphabet\n";
   goto a;
  }
  bal:
  cout<<"Enter Initial Deposit:";
  cin>>ba;
  if(ba>=500)
  {
   acno[max]=no;
   strcpy(name[max],na);
   bal[max]=ba;
   flushall();
   if(fs==1)
   {
    typenum[max]=1;
    strcpy(type[max],"Current Account");
   }
   else if(fs==2)
   {
    typenum[max]=2;
    strcpy(type[max],"SavingAccount");
   }
   balance(acno[max++],fs);
  }
  else
  {
   cout<<"Accont must be greater than 500";
   goto bal;
  }
 getch();
}
void bank::deposit(int no,int f)
{
 int i;
 float ba;
 for(i=0;i
  if(acno[i]==no && typenum[i]==f)
  {
   cout<<"Enter the amount:";
   cin>>ba;
   if(ba>0)
   {
    bal[i]+=ba;
    balance(acno[i],f);
    getch();
    return;
   }
   else
   {
    cout<<"Invalid Amount";
    getch();
    return;
   }
 }
 cout<<"Account not found\n";
 getch();
}
void bank::withdraw(int no,int f)
{
 int i,fl=0;
 float ba;
 for(i=0;i
 {
  if(acno[i]==no && typenum[i]==f)
  {
   fl=1;
   cout<<"Enter Amount:";
   cin>>ba;
   if(ba>0)
   {
    if((bal[i]-ba)>=500)
    {
     bal[i]-=ba;
     cout<<"Account Number:"<<<"\nName:"<<<"\nBeforeWithdrawal:"<<<"\nAfter Withdrawal:"<
     getch();
     return;
    }
    else
     cout<<"Balance is too low\nCurrent Balance:"<
   }
   else
    cout<<"Invalid amount\n";
   }
  }
  if(fl==0)
   cout<<"Account not found";
 getch();
}
void bank::interest(int no,int f)
{
 int y,i,in,fl=0;
 for(i=0;i
  if(acno[i]==no && typenum[i]==f)
  {
   fl=1;
   cout<<"Enter Interest in %:";
   cin>>in;
   cout<<"Enter number of years:";
   cin>>y;
   if(in>0 && y>0)
   {
    bal[i]=bal[i]+(bal[i]*y*in/100);
    balance(acno[i],f);
   }
  }
  if(fl==0)
   cout<<"Account not found";
 getch();
}
void bank::balance(int no,int f)
{
 int i,j,fl=0;
 for(i=0;i
  if(acno[i]==no && typenum[i]==f)
  {
   fl=1;
   for(j=0;j<60;j++)
    cout<<"-";
   cout<<"\nAccountNo\tName\t\tBalance\t\tAccountType\n";
   for(j=0;j<60;j++)
    cout<<"-";
   cout<<"\n"<<<"\t"<<<"\t\t"<<<"\t\t"<<<"\n";
   getch();
   return;
  }
  if(fl==0)
   cout<<"Account not found";
  getch();
}
void main()
{
 int op,no,f;
 char t[15];
 bank b;
 while(1)
 {
  x:
  clrscr();
  cout<<"\t\tBANKING SYSTEM\n"<<"\t\t~~~~~~~~~~~~~~~~~~\n";
  cout<<"1.Current Account\n2.Saving Account\n3.Exit\nOption:";
  cin>>f;
  while(1)
  {
   clrscr();
   if(f==1)
    cout<<"\n\tCURRENT ACCOUNT\n1.New\n2.Deposit\n3.Withdraw\n4.Balance\n5.Exit\nOption:";
   else if(f==2)
    cout<<"\nSAVING ACCOUNT\n\n1.New\n2.Deposit\n3.Withdraw\n4.Balance\n5.Interest\n6.Exit\nOption:";
   else
    exit(0);
   cin>>op;
   switch(op)
   {
    case 1:
     cout<<"Enter acno:";
     cin>>no;
     if(f==1)
      b.create(no,1);
     else
      b.create(no,2);
     break;
    case 2:
     cout<<"Enter acno:";
     cin>>no;
     b.deposit(no,f);
     break;
    case 3:
     cout<<"Enter acno:";
     cin>>no;
     b.withdraw(no,f);
     break;
    case 4:
     cout<<"Enter acno:";
     cin>>no;
     b.balance(no,f);
     break;
    case 5:
     if(f==1)
      goto x;
     else
     {
      cout<<"Enter acno:";
      cin>>no;
      b.interest(no,f);
      break;
     }
    case 6:
     if(f==1)
     {
      cout<<"Invalid";
      break;
     }
     else
      goto x;
   }
  }
 }
}

Sunday, February 21, 2010

Changing the photo in your orkut

Changing the photo in your orkut profile is simple.


1)At first enter into your orkut profile and click edit profile under your photo

2)select the general tab ,the option change photo will appear under your profile photo

3)Select the photo that you want and then show the path by using the browse button

Removing the photo is also simple :follow the above step and just click remove photo

this option will remove the photo very quickely.If the photo will not be removed just refresh .

sometimes it is necessary to clear your cache and cookies

Saturday, February 20, 2010

Windows Command tricks

Windows command prompt

1.How to copy and paste in command prompt
The ctrl+c and ctrl+v doesnot work in command prompt.To copy some text from command prompt just right click it and you can find the option Mark .Then drag the contents that you want.Right click again to paste on the clipboard.Then right click and select the paste option .Your text will be saved in the command prompt.


The another way is to right click on the command’s title bar and click on properties.under the options tab check on the Quick edit mode.You can directly do the copy (by right clicking it) and paste by another right click.



2. LIST OF COMMANDS THAT ARE TYPED IN THIS SESSION

Just simply press the F7 key for displaying the list of commands that has been used in this session.You can select the commands that we want by using the arrow key and press enter to select






3.Drag and drop paht in command

The simple way is to copy the path you wanted,and paste it on the command prompt.The next method is to use the cd command.



4.Auto complete
In this you just enter a command and just press tab key or press F8 to show complete filenames without typing the entire names.

eg:if you want to enter into the directory windows and you are in the c prompt.just type cd and put a space and then press the tab button.This will help you to select the possible directories.



5)Fullscreen

Press Alt+Enter for full screen(some systems doesnot support full screen).

To exit from full screen press Alt+Enter once again



6)For customizing the command prompt

You can change the cursor size,window size,colors,fonts etc for command prompt.

You can do this by rightclicking the title bar of command prompt and then select the properties .Then change the colors and other options as you wish.





7)Using arrow keys

Using the arrow key you can select the commands previously typed in this session.for this just press the right and left arrow



note:Windows 7 doesnot support the fullscreen option for command prompt.



8)To open command window – an easy method

Just right click on desktop pressing the shift key.






do you know that cd.. is used to change the directory

this can be also be write in the form cd..

Friday, January 15, 2010

computer viruses

There are so many computer viruses disturbing us in our daily life.Beware of these viruses .I will tell you some tips about the viruses and thus you can protect by yourself.
You already hear about the trojans.They are very harmful if you are an internet user.The trojans donot infect the file delibrately.It just attract the users.The user download the software or something that the hidden trojan is located.Then it make our system a server.Trojan has two executable programs.One is the client and the other is the server.Our system acts as a server from which the hackers download the datas,such as passwords,bank account no,etc.There are so many problems the trojans causes.I will tell you later.
Thank u for reading