Friday, 15 September 2017

12TH C SECTION: PRACTICAL -07 BANKING SYSTEM WITH INHERITANCE


PRACTICAL -07 BANKING SYSTEM WITH INHERITANCE
#include <iostream.h>
#include <conio.h>

class account
{
  char cust_name[20];
  int  acc_no;
  char acc_type[20];
public:
   void get_accinfo()
   {
       cout<<"\n\nEnter Customer Name :- ";
       cin>>cust_name;
       cout<<"Enter Account Number :- ";
       cin>>acc_no;
       cout<<"Enter Account Type :- ";
       cin>>acc_type;
   }
   void display_accinfo()
   {
       cout<<"\n\nCustomer Name :- "<<cust_name;
       cout<<"\nAccount Number :- "<<acc_no;
       cout<<"\nAccount Type :- "<<acc_type;
   }
};

class cur_acct : public account
{
  float balance;
  public:
    void disp_currbal()
    {
      cout<<"\nBalance :- "<<balance;
    }
    void deposit_currbal()
    {
      float deposit;
      cout<<"\nEnter amount to Deposit :- ";
      cin>>deposit;
      balance = balance + deposit;
    }
    void withdraw_currbal()
    {
      float penalty,withdraw;
      cout<<"\n\nBalance :- "<<balance;
      cout<<"\nEnter amount to be withdraw :-";
      cin>>withdraw;
      balance=balance-withdraw;
      if(balance < 500)
      {
      penalty=(500-balance)/10;
      balance=balance-penalty;
      cout<<"\nBalance after deducting penalty : "<<balance;
      }
      elseif(withdraw > balance)
      {
      cout<<"\n\nYou have to take permission for Bank Overdraft Facility\n";
      balance=balance+withdraw;
      }
      else
      cout<<"\nAfter Withdrawl your Balance revels : "<<balance;
     }
};

class sav_acct : public account
{
  float savbal;
  public:
     void disp_savbal()
    {
      cout<<"\nBalance :- "<<savbal;
    }
    void deposit_savbal()
    {
      float deposit,interest;
      cout<<"\nEnter amount to Deposit :- ";
      cin>>deposit;
      savbal = savbal + deposit;
      interest=(savbal*2)/100;
      savbal=savbal+interest;
    }
    void withdraw_savbal()
    {
      float withdraw;
      cout<<"\nBalance :- "<<savbal;
      cout<<"\nEnter amount to be withdraw :-";
      cin>>withdraw;
      savbal=savbal-withdraw;
      if(withdraw > savbal)
      {
      cout<<"\n\nYou have to take permission for Bank Overdraft Facility\n";
      savbal=savbal+withdraw;
      }
      else
      cout<<"\nAfter Withdrawl your Balance revels : "<<savbal;
     }
};


float cur_acct :: balance;
float sav_acct  :: savbal;


void main()
{
 clrscr();
 cur_acct c1;
 sav_acct s1;

 cout<<"\nEnter S for saving customer and C for current a/c customer\n\n";
 char type;
 cin>>type;

 int choice;

   if(type=='s' || type=='S')
     {
       s1.get_accinfo();
       while(1)
       {
     clrscr();
     cout<<"\nChoose Your Choice\n";
     cout<<"1)   Deposit\n";
     cout<<"2)   Withdraw\n";
     cout<<"3)   Display Balance\n";
     cout<<"4)   Display with full Details\n";
     cout<<"5)   Exit\n";
     cout<<"6)   Choose Your choice:-";
     cin>>choice;
     switch(choice)
     {
       case 1 : s1.deposit_savbal();
            getch();
            break;
       case 2 : s1.withdraw_savbal();
            getch();
            break;
       case 3 : s1.disp_savbal();
            getch();
            break;
       case 4 : s1.display_accinfo();
            s1.disp_savbal();
            getch();
            break;
       case 5 : goto end;
       default: cout<<"\n\nEntered choice is invalid,\"TRY AGAIN\"";
     }
       }
     }
    else
     {
       {
       c1.get_accinfo();
       while(1)
       {
     cout<<"\nChoose Your Choice\n";
     cout<<"1)   Deposit\n";
     cout<<"2)   Withdraw\n";
     cout<<"3)   Display Balance\n";
     cout<<"4)   Display with full Details\n";
     cout<<"5)   Exit\n";
     cout<<"6)   Choose Your choice:-";
     cin>>choice;
     switch(choice)
     {
       case 1 : c1.deposit_currbal();
            getch();
            break;
       case 2 : c1.withdraw_currbal();
            getch();
            break;
       case 3 : c1.disp_currbal();
            getch();
            break;
       case 4 : c1.display_accinfo();
            c1.disp_currbal();
            getch();
            break;
       case 5 : goto end;
       default: cout<<"\n\nEntered choice is invalid,\"TRY AGAIN\"";
     }
       }
     }
end:
}
}[/Code]

/12C. Prog-12 Write a Program to print the address and value at address by using the concept of //array of pointers.


#include<iostream.h>
#include<conio.h>

void main()
{
  clrscr();
  int *ptr[5];
  int a,b,c,d,e;
  ptr[0]=&a;
  ptr[1]=&b;
  ptr[2]=&c;
  ptr[3]=&d;
  ptr[4]=&e;

  for(int i=0;i<5;i++)
  {
    cout<<"\n Enter value for location "<<i+1<<" ";
    cin>>*ptr[i];
  }
   for(i=0;i<5;i++)
   {
     cout<<"\n value at location "<<i+1<<" ";
     cout<<" : "<<*ptr[i];
     cout<<"\n At address"<<ptr[i];
   }
   getch();
}

12th C Program 8 : Counting number of vowels


#include<fstream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
 clrscr();
 char str[50],ch;
 int no=0;
 ofstream fo("string.txt");
 cout<<"\n Enter a String:";
 gets(str);
 fo<<str;
 fo.close();
 ifstream fi("string.txt");
 cout<<"\n String Enter is";
 while(fi)
{
 fi.get(ch);
 cout<<ch;
 switch(ch)
{
 case'a':
 case'A':
 case'e':
 case'E':
 case'i':
 case'I':
 case'o':
 case'O':
 case'u':
 case'U':
 no++;
}
}
fi.close();
cout<<"\n No of Vowels :"<<no;
getch();
}

Thursday, 14 September 2017

11th D Prg-9 Write an algorithm and program to check whether a given number is palindrome or not.

Algorithm
Input
1. n
Output
1. Palindrome or not
Method:
1. Start
2. Read n
3. Write n
4. n1=n;
5. rev=0;
6.  // logic
  do
  {
      r= n % 10;
      rev = rev * 10 + r;
     n = n / 10;
  } while (n != 0);
7. if (n1 == rev)
    write " the given number is palidrome ";
    else
    write " The given number is not palindrome";
8.stop
Example:
1. 121 is a plindrome
2. 256 is not a palindrome
 


Tuesday, 12 September 2017

12th C CS September Monthly test blue print - 17 marks - 1hour

Boolean Algebra (8 + 8 =16marks  + 1= 17 marks)

Date of  Exam: 18/09/2017

1) Boolean Circuit and Expression : 2 + 2 =4 marks

2)  Writing SOP & POS Expression (3 variables): 1+1 = 2 marks

3)  Boolean Laws verification (truth table /Laws): 2+ 2 =4 marks

4)  K-Map SOP & POS simplifying expression: 3 + 3 = 6 marks

5) Direct question= 1 marks


Reference: 12th Computer Science (C++) by Sumita Arora - It is not a NCERT text book, it is reference only.

and CBSE Board papers.







12th C - September-2017 Monthly Test Time Table


1) 18/09/2017  Monday   Computer Science (7th and 8th Period)

2)19/09/2017  Tuesday  English

3) 20/09/2017  Wednesday  Physics (5th and 6th period)

4) 21/09/2017  Thursday    Chemistry

5) 22/09/2017  Friday  Maths

Thursday, 7 September 2017

/*11-D Program-8 Write a program to input number of week days (1-7) and translate to its equivalent name of the week. (1 to Monday, 2 to Tuesday……7 to Sunday)*/




#include<iostream.h>
void main()
{
   int n_o_d;


  cout<<"Enter the number of day\n";
  cin>>n_o_d;

  switch(n_o_d)
  {
case 1:
{
 cout<<" Monday \n";
 break;
}
case 2:
{
 cout<<" Tuesday \n";
 break;
}
case 3:
{
 cout<<" Wednesday \n";
 break;
}
case 4:
{
 cout<<" Thursday \n";
 break;
}
case 5:
{
 cout<<" Friday \n";
 break;
}
case 6:
{
 cout<<" Saturday\n";
 break;
}
case 7:
{
 cout<<"Sunday \n";
 break;
}
default:
{
 cout<<" Wrong Choice \n";
 break;
}
    }