Monday 7 November 2016

11C-Prog-15. Write a Algorithm and Program to calculate factorial of an integer.

15.   Write a Algorithm and Program to calculate factorial of an integer.

Algorithm:
Input
1) n
Output:
1)fact

Method
1.Start
2.Read n
3.print n
4. //logic

  fact=1;
 for(i=1;i<=n;i++)
 begin
   fact=fact*i;
 end;
5.print "factorial=",fact;
6.stop

12-D-Prog-17.Write a Program to implement Insertion Sort using a 1-D array.

17.Write a Program to implement Insertion Sort using a 1-D array.

 #include<iostream.h>
 void InsSort(int[ ], int);

int main()
 {
   int AR[50],item, n, index;
   cout<<"How many elements do u want to create array with?(max..50)..";
   cin>>n;
   cout<<"\n Enter Array elements ..\n";
   for(int i=0;i<n;i++)
    cin>>a[i];
 
   InsSort(AR, n);
   cout<<"\n \n The sorted array is as shown below \n";
   for(i=0;i<n;i++)
    cout<<AR[i]<<" ";
   cout<<endl;
   return 0;
 }

 void InsSort(int AR[ ], int size)
 {
   int t,j;
   AR[0]=INT_MIN;
   for(int i=1;i<=size;i++)
   {
     t=AR[i];
     j=i-1;
    while(t<AR[j])
    {
      AR[j+1]=t;
      j--;
     }
    AR[j+1]=t;
    cout<<"Array after pass-"<<i<<"-is";
      for(int k =1;k<=size;k++)
       cout<<AR[k]<<" ";
      cout<<endl;
   }
 }
       
 
   

12-D-16.Write a Program to implement Bubble sort using a 1-D array.

16.Write a Program to implement Bubble sort using a 1-D array.

 #include<iostream.h>
 void Bubblesort(int[ ], int);

int main()
 {
   int AR[50],item, n, index;
   cout<<"How many elements do u want to create array with?(max..50)..";
   cin>>n;
   cout<<"\n Enter Array elements ..\n";
   for(int i=0;i<n;i++)
    cin>>a[i];
 
   Bubllesort(AR, n);
   cout<<"\n \n The sorted array is as shown below \n";
   for(i=0;i<n;i++)
    cout<<AR[i]<<" ";
   cout<<endl;

 }
 void Bubblesort(int AR[], int size)
 {
   int t,ct=0;
   for(int i=0; i<size; i++)
   {
     for(int j=0; j<(size-1); j++)
     {
       if(AR[j]>AR[j+1])
        {
          t=AR[j];
          AR[j]=AR[j+1];
          AR[j+1]=t;
         }
      }
      cout<<"Array after iteration-"<<++ct<<"-is:";
      for(int k=0;k<size;k++)
       cout<<AR[k]<<" ";
      cout<<endl;
    }
 }

Sunday 6 November 2016

11-C-H.Y CS Blue print 70 marks Year:2016

H.Y CS Blue print 70 marks Year:2016

1.   Computer Fundamental-      5 marks
2.   Programming methodology-  5 marks
3.   Getting started with C++ - 10 marks
4.   Data Handling  - 10 marks
5.   Operator & Expression –  7 marks
6.   Flow of control - 15 marks
7.   One Dimensional  Array – 10 marks
8.   Inbuilt Function -  8 marks

Practical Examination:
 
Thursday-17-11-2016: Batch-02 Practical Exam-30
Tuesday-15-11-2016: Batch-03
Saturday-19-11-2016: Batch-01


1 to 15 programs in a record:

*  2 Programs (Algorithm and Program) - 20 marks
Record – 5 marks
 * Viva - 5 marks

Thursday 3 November 2016

12-D BLUE PRINT: 1ST PRE BOARD OF COMPUTER SCIENCE-2016-17

S NO.
UNIT
EASY
MARKS
AVERAGE
MARKS
HARD
MARKS
TOTAL
1
C++ REVESION TOUR
1.DIRECT QUESTION
2.NAMING THE HEADER FILES
2(1)
1(1)
1.SYNTAX ERROR
2(1)
1.OUTPUT FINDING-1
2.OUTPUT FINDING-2
3.OUTPUT FINDING-3
2(1)
3(1)
2(1)
12(6)
2
OBJECT ORIENTED PROGRAMMING
1.DIRECT QUESTIONS
2(1)       
1.CONSTRUCTOR AND DESTRUCTOR
2(1)
1.CLASS LOGIC WRITING(PROGRAM)
2.ANSWER THE QUESTION(INHERITANCE CONCEPT)
4(1)

4(1)
12(4)
3
DATA STRUCTURE AND POINTER
1.ADRESS CALCULATION
2.INFIX TO POSTFIS AND POSTFIX EVAL (STACK)
3(1)

2(1)
STATIC ALLOCATION OF OBJECTS(-1D)
2(1)
1.DYNAMIC ALLOCATION OF OBJECTS
2.STATIC ALLOCATION OF OBJECTS (2-D)
4(1)


3(1)

14(5)
4
DATA FILE HANDLING


1. FILL IN THE BLANKS BINARY FILE PROG.
2.TEXT FILE (FUNCTION)
1(1)

2(1)
1.BINARY FILE(FUNCTION)
3(1)
6(3)
5
DATA BASE AND SQL
1.DIRECT QUESTION
2.SQL COMMANDS
3.OUTPUT QUERIES
2(1)
4(1)
2(1)




8(3)
6
BOOLEAN ALGEBRA
1.LAWS(18+2=20)
2.LOGIC CIRCUIT
3.SOP AND POS EVALUATION
4.K-MAP SOP/POS
2(1)
2(1)
1(1)

3(1)




8(4)
7
NETWORK
1.INTRODUCTION OF NETWORK
2.MEDIA, DEVICES, TOPOLOGIES AND PROTOCOL
3.SECURITY
4.WEB SERVERS
5.OPEN SOURCE TECHNOLOGIES
1(2)

4(1)


1(2)
1(1)
1(1)




10(7)

TOTAL

36 (19)

9(5)

25(8)
70(23)

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 Publishers
650
Fiction
20
T0001
My First C++
Brain and Brooke
EPB
350
Text
10
T0002
C++ Brainworks
A. W. Rossaine
TDH
350
Text
15
F0002
Thunderbolts
Annaborts
First Publishers
750
Fiction
50
Ans:
 create table library
      ( Book_Id char(10),
         Book_Name char(15),
         Author_Name char(17),
         Publishers char(12),
         Price decimal,
         Type char(10),
          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’,’My First C++’,’Brian & Broke’,’EPB,350.00,’Text’,15);

Table:ISSUED
Book_Id
Quantity_Issued
T0001
4
C0001
5
F0001
2
Ans: create table Issued
         (
             Book_Id char(6),
             Quantity_Issued integer
          );

Insert into Issued values (‘T0001’,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.Books_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 BOOKS;
Ans:  5
                               ii.            Select max(Price) from BOOKS where Quantity>=15;
Ans: 750
                              iii.            Select Book_Name, Author_Name from BOOKS where Publisher=”EPB”;
Ans:  Fast Cook         Lata Kapoor
          My First C++    Brain & Brake
                             iv.            Select count(distinct Publishers) from BOOKS where Price>=400;

Ans: 1

Wednesday 2 November 2016

12-D Prog-11. write a programe to illustrate use of this pointer

//12-D Prog-11. write a programe to illustrate use of this pointer
#include<iostream.h>
#include<conio.h>
#include<stdio.h>

class sample
{
  int code;
  char str[20];
  public:
   void Insert();
   void Display();
};
void sample :: Insert()
{
  cout<<"\n Enter the code";
  cin>>this->code;
  cout<<"\n Enter string ";
  gets(this->str);
}
void sample::Display()
{
  cout<<"\n code="<<this->code;
  cout<<"\n string="<<this->str;
}

void main()
{
   clrscr();
   sample o;
   o.Insert();
   o.Display();
   getch();
}

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

//12D. 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();
}