Friday 22 September 2017

12th C Computer Science Holiday Home work(Autum Break);

CBSE OUTSIDE DELHI BOARD PAPERS
2017, 2016, 2015, 2014 AND 2013

Questions(unit)
1. C++ Revision Tour-12 marks
     a) Direct Question- 2marks
     b) Syntax Error finding- 2marks
     c) Header file writing-1 mark
     d) Output- I- 2 marks
     e) Output-II- 3 marks
     f) Output-III- 2 marks (random numbers)
   
2. Object Oriented Programming in C++ -12 marks
    a) Direct question- 2marks
    b) Constructor and Destructor - 2 marks
    c) Class Writing program(only logic) - 4 marks
    d) Inheritance program problem solving- 4 marks

3. Data structure in C++ - 14 marks
     a) Two Dimensional Address Calculation-3 marks
     b) One Dimensional static allocation writing function only(application level) - 2 marks
     c) Two Dimensional static allocation writing function only(application level) - 3 marks
    d)  Dynamic allocation writing function only(Stack, Queue/ Insertion, Deletion) - 4 marks
    e) Infix to postfix conversion/ postfix evaluation through stack                  - 2 marks

4. Data File Handling in C++ - 06 marks
     a) Output writing/ fill in the blanks for the binary file programming - 1 mark
     b) Text file logic writing (only function) - 2 marks
     c) Binay file logic wiriting ( only function) - 3 marks

5. Boolean Algebra - 08 marks
   a) Writing Expression to Circuit / Circuit to Expression - 2 marks
   b) Writing SOP or POS Expression through table/ expression- 1 mark
   c) Boolean Laws or Expression verification through truth table / algebraically -
   d) K-MAP SOP or POS reducing expression - 3 marks




11-D prog-10 Write a algorithm and program to calculate area of rectangle, circle and triangle depending upon the user choice

Input
1. choose 1(rectangle) or 2(circle) or 3(triangle)

Output:
1.Any one

Method:
1.start
2.write " 1. Rectangle    2. Circle   and 3. Triangle";
3. read choice
4. write choice
5,. //logic
   switch(choice)
   {
          case 1:  
                      {
                            //logic for area of rectangle
                           write" enter the length and breadth ";
                           read l and b
                           A=l*b;
                          write" Area of rectangle",A;
                          break;    
                      }
           case 2:  
                      {
                         //logic for Area of circle
                       Write " enter the radius";
                        read r
                       A= 3.14*r*r
                      write " Area of circle",A
                       break;
                      }
            case 3:  
                      {
                          //logic for Area of triangle
                         write "enter the base and height";
                         read b and h
                         A=0.5 * b * h;
                        write " Area of triangle",A;
                      }
         
           default:
                         {
                            write " wrong choice ";
                            break;
                         }
    }// switch end
6.stop

Program:

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

void main()
{
   int choice;
   float l,b,A,r,h;


cout<<"Enter the Choice: 1. Rectangle 2.Circlecle ane 3.Triangle \n";
cin>>choice;
cout<<"choice="<<choice<<endl;

//logic
 switch(choice)
 {  case 1: {
     //logic for area of rectangle
     cout<<" Enter the length and breadath \n";
     cin>>l>>b;
     A=l*b;
     cout<<"\nArea of rectangle="<<A<<endl;
     break;
   }

    case 2: {
     //logic for Area of circle
     cout<<"\nEnter the radius\n";
     cin>>r;
     A=3.14*r*r;
     cout<<"Area of Circle="<<A<<endl;
     break;
   }

   case 3:  {
//logic for Area of triangle
      cout<<"\n Enter the base and height \n";

      cin>>b>>h;
      A=0.5*b*h;
      cout<<"\nArea of triangle ="<<A<<endl;
      break;
    }

   default:
    {
cout<<"\n wrong choice \n";
break;
    }
  }//switch end
}

Friday 15 September 2017

SQL Prog-1 Tables Library and Issued

SQL PRACTICALS
1.       Given the following tables for a database LIBRARY :
Book_Id
Book_Name
Author_Name
Publishers
Price
Type
Quantity
C0001
Fast Cook
Lata Kapoor
EPB
355
Cookery
5
F0001
The Tears
William Hopkins
First Publ
650
Fiction
20
T0001
 First C++
Brain Brooke
EPB
350
Text
10
T0002
C++ Brain
A. W. Rossaine
TDH
350
Text
15
F0002
Thunder
Annaborts
First Publ
750
Fiction
50
 Ans.
 create table library1
      ( Book_Id char(6),
         Book_Name char(10),
         Author_Name char(15),
         Publishers char(10),
         Price decimal,
         Type char(8),
          Quantity integer
       );
 Insert into library values ('C0001','Fast Cook','Lata Kapoor','EPB',355.00,'Cookery',5);

Insert into library values ('F0001','The tears','Willian Hopkins','First Publ',650.00,'Fiction',20);

Insert into library values('T0001','First C++','Brian Broke','EPB',350.00,'Text',10); 

Insert into library values('T0002','C++ Brain','A.W. Rosssain','TDH',350.00,'Text',15);

Insert into library values('F0002','Thundes','Annaborts','First Pub',750.00,'Fiction',50);


Table:ISSUED
Book_Id
Quantity_Issued
T0001
4
C0001
5
F0001
2
Ans: create table Issued
         (
             Book_Id char(8),
             Quantity_Issued integer
          );
Insert into Issued values ('T0001',4);
Insert into Issued values ('C0001',4);
Insert into Issued values ('F0001',4); 

Write SQL queries for (a) to (f):
a)      To show Book name, Author name and Price of books of First Publishers.
Ans: select Book_Name, Author_Name, Price from Library where Publishers = 'First Publ';

b)      To list the names from books of Text type.
Ans: select Book_Name from Library where Type='Text';

c)       To display the names and price of all books in ascending order of their price.
Ans: select Book_Name, Price from Library order by Price;

d)      To increase the price of all books of EPB Publishers by 50.
Ans: update Library set price = price + 50 where publishers= 'EPB';

e)      To display the Book_Id, Book_Name and Quantity_Issued for all books which have been issued.
Ans: select Library.Book_Id, Library.Book_Name, Issued.Quantity_Issued from Library, Issued where Library.Book_Id = Issued.Book_Id;

f)       To insert a new row in the table ISSUED having the following data : “F0003”,1
Ans: Insert into Issued values ('F0003',1);

g)    Give the output of the following queries based on the above tables:
                     
            i.            Select count(*) from Library;
Ans:  5
                     
          ii.            Select max(Price) from Library where Quantity>=15;
Ans: 750
                     
         iii.            Select Book_Name, Author_Name from Library where Publisher=”EPB”;
Ans:  Fast Cook         Lata Kapoor
          First C++         Brain Brake
                     
        iv.            Select count(distinct Publishers) from BOOKS where Price>=400;

               Ans: 1

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;
}
    }