2nd puc computer science notes (5 marks questions and answers)




2nd puc computer science notes,ii puc computer science notes,2nd puc computer science,2nd puc computer science 5 marks questions and answers,2nd puc computer science important questions chapter wise,12th computer science notes pdf,2nd puc computer science important questions with answers pdf,2nd puc computer science important questions chapter wise with answers,2nd puc computer science important questions with answers,2nd puc computer science question and answer,2nd puc computer science passing package, 2nd puc computer science notes pdf

Computer Science Second PUC
2nd puc computer science chapters

Chapter 1 Typical configuration of computer system
Chapter 2 Boolean Algebra
Chapter 3 Logic Gates
Chapter 4 Data Structure
Chapter 5 Review of C++
Chapter 6 Basic concepts of OOP
Chapter 7 Classes and Objects
Chapter 8 Function Overloading
Chapter 9 Constructor and Destructor
Chapter 10 Inheritance (Extending classes)
Chapter 11 Pointers
Chapter 12 Data File Handling
Chapter 13 Database Concepts
Chapter 14 Structured Query Language
Chapter 15 Networking Concepts
Chapter 16 Internet and Open source concepts
Chapter 17 Web designing

2ND PUC COMPUTER SCIENCE NOTES PDF (5 MARKS QUESTIONS AND ANSWERS)


      1. Explain basic concepts of object oriented programming OR describe any five major 
              characteristics of OOP.
      Ans: Following are the major characteristics of OOPs 
      -  Objects 
      - Classes 
      - Data abstraction 
      - Data encapsulation 
      - Inheritance 
      - Overloading 
      - Polymorphism 
      - Dynamic binding 
      - Message passing
      Ø  Objects: An object may be a person, place or a table of data. An object is a collection of data members and function members.
Ex: Apple, Orange, Mango etc are the objects of the class fruit
Objects take memory and have addresses







 Object-1 (student)
 









       Ø  Classes: A class is a group of objects having similar characteristics. Once a class is defined, any
           number of objects of that class are created
       Ex 1: man and woman belongs to the same class called Human Being.
 Ex 2: planets, sun, moon are members of class solar system. 













      Ø  Data abstraction: Abstraction is a process of representing essential features without including background details or explanations.
      Ø  Data encapsulation: data encapsulation combines both data and functions in a single unit called class. Data encapsulation prevents data from direct access. The data can be accesses only through functions present inside the class definition. Data encapsulation enables data hiding or information hiding.
      
      Object
     
 





       Ø  Inheritance: The concept of inheritance provides the use of reusability. This means that we can
           add additional features to the existing class without modifying it. Thus the process of acquiring
           properties of one class to another is called inheritance. The existing class is known as base class
           and the new class obtained is called derived class.
           The derived class shares some of the properties of the base class. Therefore a code from a base
           class can be reused by a derived class.
       Ø  Overloading: There are two types of overloading: 
           a) Operator overloading: when existing operator operates on new data type is called operator
           overloading 
           b) Function overloading: Two or more functions have same name but different number of arguments or data type of arguments. Function overloading is a process of defining same function name to carry similar types of activities with various data items.
      Ø  Polymorphism: it is a process where a function can take multiple forms based on the type of arguments, number of arguments and data type of return value.
      The ability of an operator and function to take multiple forms is known as polymorphism.
Ex: int addition(int a, int b);
       int addition( float a, float b);
Consider the addition operation. In addition of two numbers the result is the sum of two numbers.
In addition of two strings the operation is string concatenation. When an operator behaves differently based on operands, then it is said that operator is overloaded. Similarly when same function is used for multiple tasks in the same program by changing argument type and number, it is known as function overloading.
      Ø  Dynamic binding: binding is a process of connecting one program to another. Dynamic binding is
          a process of connecting one program to another during execution (when function is called).
      Ø  Message passing: a message for an object is request for execution of procedure. Message passing
          involves specifying the name of object, the name of the function and the information to be sent.
      2. What are the advantages of OOP over earlier programming methods
      Ans: Following are the advantages of OOP over earlier programming methods 
      - Using class and objects, programs are modularized 
      - Linking code and object allows related objects to share common code. This reduces code
        duplication and code reusability 
      - As the data is encapsulated along with functions, the non-member functions cannot access or
        modify data. Thus, providing data security 
      - Complexity of the program development is reduced through the use of inheritance 
      - Reduces time, as creation and implementation of OOP code is easy 
      - Through message passing OOP communicates to the outside system.
       3. What are the application of OOP.
       Ans: Applications of OOP are as follows 
       - Computer graphic applications 
       - CAD/CAM software 
       - Object oriented database 
       - User interface design such as windows 
       - Real-time systems 
       - Simulation and modeling 
       - Artificial intelligence and expert systems
       4. Explain class definition and class declaration with syntax and example
       Ans: A class definition is a process of naming a class, data and functions of the class 
       A class declaration specifies, representing objects and functions that operate on objects.                   The definition and declaration of a class includes the following 
       - The data members of the class describes the characteristics of the class 
       - The function members are the set of operations that are performed on the objects of the class. 
       - The access control specifiers (private, protected and public) to the class members within a
         program are specified 
       - Class name is used for external operations for accessing and manipulating the instance of a class 
       Syntax of a class:
       class class_name
       { 
       private: data member; 
                    function member; 
       protected: data member; 
                    function member; 
      public: data member; 
                    function member; 
       }; 
       Example:
       class student 
       { 
       private: int rollno; 
       char name[15]; 
       float percentage; 
       public: void getdata(); 
       void putdata(); 
       }; 

       5. Write a program to demonstrate the use of class and object
       Ans:
       #include<iostream.h>
       #include<conio.h>
       class demo
      { 
      private: int a,b; 
      public: void getdata(); 
      {
      cout<<”Enter the value of A: ”;
      cin>>a;
      cout<<”Enter the value of B: ”;
      cin>>b;
      }
      void putdata()
     {
     cout<<”Addition of two numbers=”<<a+b;
     } 
     }; 
     void main() 
     { 
      demo d;
d.getdata();
d.putdata();
getch();
}
      6. Explain how to write member functions written inside and outside the class definition
      Ans: To define member function inside a class the function declaration within the class is replaced by actual function definition inside the class. Only small functions are defined inside class definition
      Ex:
      class room 
     { 
      int length; 
      int breadth; 
      public: void getdata() 
                  { 
                  cin>>length; 
                  cin>>breadth; 
                  } 
                  void putdata() 
                  { 
                  cout<<length; 
                  cout<<breadth;
                   }
 };
To define member functions written outside the class definition replaced by actual function definition outside the class.
Ex:
class room
{ 
int length; 
int breadth; 
public: void getdata(); 
             void putdata(); 
}; 
void room::getdata()
{ 
cin>>length; 
cin>>breadth; 
} 
void room::putdata() 
{ 
cout<<length; 
cout<<breadth;
}
The symbol :: is known as scope resolution operator. The scope resolution operator identifies the function as a member of particular class. The use of scope resolution operator implies that these member functions are defined outside the class.
      7. Explain how objects of a class can be defined?
      Ans: when a class is defined, it specifies that the user defined data type is defined. The objects of a class are declared in the same manner like any other variable declaration 
      Syntax:
      class class_name 
      {
       private members;
       public members;
       };
       class_name object1, object2…;

 Ex:
class num
{
private: int x;
int y;
public: int sum(int a, int b);
int diff(int a, int b);
};
void main()
{
num n1,n2;
n1.sum(10,5);
n2.diff(10,5);
}
Note that an object is an instance of a class template.
      8. Explain how an array of objects can be defined?
      Ans: An array having class type elements is known as array of objects. An array of objects is declared after class definition and is defined in the same way as any other array
      Ex:
      class employee 
      { 
      char name[15]; 
      int age; 
      float salary; 
      public: 
      void getdata() 
     { 
      cout<<”Enter the name of employee: ”; 
      cin>>name; 
      cout<<”Enter the age of an employee: ”; 
      cin>>age; 
      cout<<”Enter the salary: ”; 
      cin>>salary; 
      } 
      void putdata() 
     { 
      cout<<”Name: ”<<name; 
      cout<<”Age: ”<<age; 
      cout<<”Salary: ”<<salary; 
      }
      };
      void main()
      {
      employee emp[3];
      for(int i=0;i<3;i++)
      {
      emp.getdata();
      emp.putdata();
      getch();
      }
      9. Describe the need for function overloading
      Ans: function overloading means two or more functions have same name, but differ in the number of arguments or data type of arguments. Therefore, it is said that function name is overloaded. The advantages of overloaded functions are: 
      - When functions are overloaded, then the compiler automatically decides and executes appropriate function based on type of arguments and calls the required function. Thus the code is executed faster. 

      - It is easier to understand the flow of information and debug. 
      - Code maintenance is easy. 
      - Easier interface between programs and real world objects.
      10. Explain overloaded functions with syntax and example
      Ans: function overloading means two or more functions have same name, but differ in the number of arguments or data type of arguments. Therefore, it is said that function name is overloaded. 
      Syntax:
      return_type1 function_name(argument list)
      { 
      statement(s);
      } 
      return_type2 function_name(argument list) 
     {
      statement(s); 
      }
      … 
      return_typen function_name(argument list) 
     { 
      Statement(s); 
      } 
      Ex:
      int sum(int a, int b) 
      { 
      return(a+b); 
      } 
      float sum(float a, float b) 
      { 
      return(a+b); 
      }



      11. Explain inline function with syntax and example
      Ans: In inline function compiler replaces a function call along with the body of the function. Inline function run little faster than normal functions as function calling overheads are saved. Advantages of inline function are as follows: 
      - They are compact function calls 
      - The size of the object code is reduced 
      - Very efficient code can be generated 
      - The readability of the program increases
      Syntax:
      inline retrun_type function_name(argument list) 
     { 
      statement(s); 
      } 
      Ex: 
      #include<iostream.h> 
      #include<conio.h> 
      inline int square(int a) 
      {
       return(a*a);
      }
      void main() 
     { 
     int x; 
     x=square (5); 
     cout<<”Square of 5=”<<x; 
     getch(); 
     }

      12. Explain friend function and their characteristics. Or explain friend function with syntax 
            and programming example.
      Ans: A friend function is a non member function that is a friend of a class. The friend function is declared within a class with the prefix friend. But it should be defined outside the class like a normal function without the prefix friend. 
      Syntax:
      class class_name 
      { 
       public: friend void function(void); 
       };
Characteristics of a friend function are as follows: 
- A friend function has full access right to the private and protected members of the class. 
- A friend function cannot be called using the object of that class. It can be invoked like any normal function. 
- A friend function can be declared anywhere in the class and it is not affected by access specifiers (private, protected and public). 
- They are normal external functions given special access privileges. 
- The function is declared with keyword friend. But while defining friend function it does not use either friend or :: operator.
#include<iostream.h>
#include<conio.h>
class myclass
{
int a,b;
public: void set_val(int i, int j ); 
friend int add(myclass obj);
};
void myclass::set_val(int i, int j)
{
a=i;
b=j;
}
int add(myclass obj)
{
return(obj.a+obj.b);
}
void main()
{
myclass object;
object.set_val(10,20);
cout<<”sum =”<<add(object);
getch();
}
      13. What are the rules for writing a constructor function?
      Ans: Rules for writing a constructor function are as follows 
      - A constructor name is always same as that of the class name. 
      - There is no return type for the constructors not even void. 
      - A constructor should be declared in public section. 
      - A constructor is invoked automatically when objects are created. 
      - It is not possible to refer to the address of constructors. 
      - The constructors make implicit calls to the operators new and delete when memory allocation is
        required.
      14. Explain default constructor with syntax and example
      Ans: A constructor which does not accept any arguments is called default constructor. Default constructor simply allocated memory to data members of objects. Features of default constructors are 
      - Default constructor automatically invokes when object is created. 
      - All objects of the class are to be initialized to same set of values by the default constructor. 
      - If different objects are to be initialized with different values, it cannot be done using default
        constructor.
Syntax:
class_name calss_name()
{
}
Ex:
#include<iostream.h>
#include<conio.h> 
class c 
{
int a,b;
public: c()
{
a=10;
b=20;
}        
void display()
{
cout<<a<<b;
} 
};
void main()
{
c obj;
obj.display();
getch();
}
      15. Explain parameterized constructor with syntax and example
      Ans: A constructor that takes one or more arguments is called parameterized constructor. Using this constructor it is possible to initialize different objects with different values. The parameters are used to initialize the object.
      Features of parameterized constructor are as follows: 
      - The parameterize constructor can be overloaded. 
      - For object created with one argument, constructor with only one argument is invoked and
        executed. 
      - The parameterized constructor can have default arguments and default values.
Syntax: 
class_name class_name( argument list)
{
 statement(s);
 }
Ex:
#include<iostream.h>
#include<conio.h>
class num
{
int a,b; 
public: num(int m,int n) 
{ 
a=m; 
b=n; 
} 
void display() 
{ 
cout<<”A=”<<a<<”B=”<<b 
} 
};
void main()
{
num n;
n.num(10,20);
n.display();
getch();
}
      16. Explain destructors with syntax and example.
      Ans: A destructor is a special member function that will be executed automatically when an object is destroyed. It will have, like constructor, the same name as that of the class but preceded by a tilde (~). A destructor will be called automatically when an object is destroyed. Destroying an object means de-allocating all the resources such as memory that was allocated for the object by the constructor. 
      Syntax:
      class class_name 
      {
       private: data_variables;
       public: class_name()                //constructor 
       ~class_name()             //destructor 
      };
Ex:
 #include<iostream.h>
#include<conio.h>
class num
{ 
int x; 
public: 
num(); 
void display(); 
~num();
};
num::num()
{
cout<<”In constructor:\n”;
x=100;
}
num::~num()
{
cout<<”In desctructor:\n”;
}
void num::display()
{
cout<<”Value of x=”<<x;
}
void main()
{
num n;
n.display();
getch();
}
      17. What are the advantages of inheritance?
      Ans: inheritance has the following advantages 
      - Reusing existing code. 
      - Faster development time. 
      - Easy to maintain. 
      - Easy to extend. 
      - Memory utilization.

     18. Explain types of inheritance.
     Ans: following are the types of inheritance 
      - Single inheritance: if a class is derived from a single base class, it is called as single inheritance.

       - Multilevel inheritance: the classes can also be derived from the classes that are already derived. This type of inheritance is called multilevel inheritance.


                  
       - Multiple inheritance: if a class is derived from more than one base class, it is known as multiple inheritance.

                
        - Hierarchical inheritance: if a number of classes are derived from a single base class, it is called as hierarchical inheritance.

         
        - Hybrid inheritance: it is a combination of Hierarchical and Multiple inheritance.
              

      19. What is virtual base class? give example
Ans: consider a situation where the program design would require one base class call it A and two
derived classes namely B and C, which are inherited from the base class A. further, derived class D is
created from B and C.



When two or more objects are derived from a common base class, we can prevent multiple copies of
the base class being present in an object derived from those objects by declaring the base class as
virtual when it is being inherited. Such a base class is known as virtual base class. This can be
achieved by preceding the base class name with the word virtual
Ex:
class A
{
__________
__________
};
class B: virtual public A
{
____________
____________
};
class C: virtual public A
{
____________
____________
};
class D: public B, public C
{
____________
____________
};
      20. Write a program to demonstrate the use of single inheritance
Ans: 
#include<iostream.h>
#include<conio.h>
class abc
{
int rollno;
char name[15];
public: void read()
{
cout<<”Enter the roll number: ”;
cin>>rollno;
}
void display()
{
cout<<”Roll no:”<<rollno;
cout<<”Name:”<<name;
}
};
class xyz:public abc
{
int m1;
int m2;
int t;
public: void read1() 
{ 
cout<<”Enter the first marks:”; 
cin>>m1; 
cout<<”Enter the second marks:”; 
cin>>m2; 
t=m1+m2; 
} 
void display1() 
{ 
cout<<”First marks: ”<<m1; 
cout<<”Second marks:”<<m2; 
cout<<”Total marks:”<<t; 
}
};
void main()
{
xyz ob;
ob.read();
ob.read1();
ob.display();
ob.display1();
getch();
}



      21. Explain data processing cycle
Ans: the information processing cycle consists of five specific steps, 
- Input: any kind of data- letters, numbers, symbols, shapes, images or whatever raw material put into the computer system that needs processing. Input data is put into the computer using a keyboard, mouse or other devices such as the scanner, microphone and the digital camera. In general data must be converted to computer understandable form. 

- Processing: the processing is a series of actions or operations from the input data to generate outputs. Some of the operations are classification based on some condition, calculation, sorting, indexing, accessing data, extracting part of file/attribute, substring etc. conversion of data into information by the central processing unit. For example, when the computer adds 4+2=6 that is an act of processing. 

- Storage: data and information not currently being used must be stored so it can be accessed later. There are two types of storage, primary and secondary storage. Primary storage is the computer circuitry that temporarily holds data waiting to be processed (RAM) and it is inside the computer, secondary storage is where data is held permanently. A floppy disk, hard disk or CD. ROM is example of this kind of storage. 

- Output: the result or information obtained after processing the data must be presented to the user in user understandable form. The result may in the form of reports (hard copy or soft copy). Some of the output can be animated with sound and video/picture. 

- Communication: With wired and wireless communication connections, data may be input from a far , processed in a remote area and stored in several different places and then be transmitted by modem as an e-mail or posted to the website where the online services are rendered.
      22. Explain the features of database system. or explain the advantages (features) of DBMS.
Ans: in the database approach, the data is stored at a central location and is shared among multiple
users. Thus, the main advantage of DBMS is centralized data management. The advantages of
centralized database system are as follows: 
- Controlled data redundancy: elimination of duplication of data item in different files ensures consistency and saves the storage space. The redundancy in the database cannot be eliminated completely as there could be some performance and technical reasons for having some amount of redundancy. 

- Enforcing data integrity: data integrity refers to the validity of data and it can be compromised in a number of ways. 

- Data sharing: the data stored in the database can be shared among multiple users or application programs. It is possible to satisfy the data requirements of the new applications without creating any additional data or with minimal modification 

- Ease of application development: the application programmer needs to develop the application programs according to user’s needs. The other issues like concurrent access, security, data integrity etc are handled by the RDBMS itself 

- Data security: since the data is stored centrally data security checks can be carried out whenever access is attempted to sensitive data. To ensure security, a RDBMS provides security tools such as used codes and passwords. Different checks can be established for each type of access like addition, modification, deletion etc to each piece of information in the database 

- Multiple user interfaces: For various users having different technical knowledge DBMS provides different types of interfaces such as query languages, application program interfaces, and graphical user interfaces (GUI) 

- Backup and recovery: RDBMS provides backup and recovery subsystem that is responsible for recovery from hardware and software failures. For example, if the failure occurs in between the transaction, the RDBMS recovery subsystem either reverts back the database to the state to the previous state of the transaction or resumes the transaction from the point it was interrupted so that its complete effect can be recorded in the database.
      23. Explain DBMS architecture
Ans: it is a three levels of architecture namely, internal, conceptual and external levels.
Internal level: internal level is the lowest level of data abstraction that deals with the physical
representation of the database on the computer and thus, is known as physical level. It describes how
the data is physically stored and organized on the storage medium. It includes storage space allocation
techniques for data and indexes, data compression and encryption techniques, and record placement.

Conceptual level: conceptual level describes what data is stored in the database, the relationships among the data and complete view of the user’s requirements without any concern for the physical implementation. i.e. it hides the complexity of physical storage structures. 

      External level: this level permits the user to access data in a way that is customized according to their needs, so that the same data can be seen by different users in different ways at the same time. In this way, it provides a powerful and flexible security mechanism by hiding the parts of the database from certain users, as the user is not aware of existence of any attributes that are missing from the view.
      24. Explain database model.
     Ans: A database model defines the logical design of data. The model describes the
     relationships between different parts of the data. There are three models 
      
      - Hierarchical model: this data model organizes the data in a tree like structure, in which each child node can have only one parent node. The database based on the hierarchical data model comprises a set of records connected to one another through links. The links is an association between two or more records. The top of tree structure consists of a single node that does not have any parent and is called the root node. It represents only one-to-one and one-to-many relationships. In this model each entity has only one parent but can have several children. At the top of hierarchy there is only one entity which is called root.

      - Network model: Unlike hierarchical data model, all the nodes are linked to each other without any hierarchy. The main difference is that in hierarchical data model, the data is organized in the form of trees and in network data model, the data is organized in the form of graph, in which some entities can be accessed through several level path
- Relational model: the relational model was developed by E.F.Codd in 1970. In relational model there are no physical links. All data is maintained in the form of tables (generally known as relations) consisting of rows and columns. Each row or record represents an entity and a column or field represents an attribute of the entity. Oracle, Sybase, DB2, Ingress, Informix, MS-SQL server are the examples of DBMSs
In this model, data is organized in two-dimensional tables called relations. The tables or relations are related to each other

Relational model of database


                                               
No.
Name


No.
Name
Dept no
Courses




Student
Courses

                                                                                  
No.
Dept no
Prof id
Unit





Id
Name
Courses



         
      25. Explain SQL constraints with example.
Ans: Constraints are the rules enforced on data columns on table. These are used to limit the
type of data that can go into a table. Following are the constraints available in SQL: 

- Primary key: this constraints defines a column or combination of columns which uniquely identifies each row in the table 
Ex: create table student(rollno number(2) PRIMARY KEY, name varchar(15)); 

- Foreign key: this constraints identifies any column referring the PRIMARY KEY in another table. It establishes a relationship between two columns in the same table or between different tables. 
Ex: SQL> create table grade(rollno number(2), grade char(1), foreign key(rollno) references student(rollno)); 

- Not null constraint: this constraints ensures all rows in the table contain a definite value for the column which is specified as not null. Which means a null value is not allowed 
Ex: create table student(rollno number(2) NOT NULL, name varchar(15)); 

- Unique key: this constraint ensures that a column or a group of columns in each row have a distinct value. A column(s) can have a null value but the values cannot be duplicated 
Ex: create table student(rollno number(2) PRIMARY KEY, name varchar(15) UNIQUE); 

- Check constraint: The CHECK constraint is used to limit the value range that can be placed in a column. 
Ex: create table student(rollno number(2), marks number(3) check(marks>=0 and marks<=100));
      26. Explain with example to create details of employees and give the minimum and 
             maximum in the salary domain.
      Ans: SQL> create table employee(empid number(3), ename varchar(20), salary number(8,2));
      Table created.
       SQL> insert into employee values(&empid,'&ename',&salary);
       Enter value for empid: 1
       Enter value for ename: ganesh
       Enter value for salary: 12000
       old   1: insert into employee values(&empid,'&ename',&salary)
       new   1: insert into employee values(1,'ganesh',12000)
      1 row created.

      SQL> /
      Enter value for empid: 2
      Enter value for ename: raju
      Enter value for salary: 10000
      old   1: insert into employee values(&empid,'&ename',&salary)
      new   1: insert into employee values(2,'raju',10000)
      1 row created.

      SQL> select * from employee;

     EMPID ENAME                    SALARY
---------- -------------------- ----------
         1 ganesh                    12000
         2 raju                          10000
SQL> select max(salary) from employee;

MAX(SALARY)
-----------
      12000

SQL> select min(salary) from employee;

MIN(SALARY)
-----------
      10000



       27. Explain OSI reference model
 
 
- The physical layer: it is concern with transmitting raw bits over a communication channel. It also deals with mechanical, electrical and timing interfaces 

- The data link layer: it transform a raw transmission into a line that forms frame 

- The network layer: it determines how packets are routed from source to destination 

- The transport layer: it splits up packets into smaller units if needed, and pass these to the network layer and ensure that the pieces all arrive  correctly at the other end 

- The session layer: it allows users on different machines to establish sessions between them. It includes dialog control, token management and synchronization 

- The presentation layer: it is concerned with the syntax and semantics of the information transmitted 

- The application layer: it contains a variety of protocols that are commonly needed by the user. For example, HTTP (HyperText Transfer Protocol) which is the bases for the World Wide Web (WWW) to access web pages

      28. What is topology? Explain in detail OR explain the types of topologies.
      Ans: The layout of networking is called as Topology. 
       - Bus topology or linear topology: this consists of a single length of the transmission medium onto which the various nodes are attached. The transmission from any station travels the length of the bus, in both directions, and can be received by all other stations. The bus has terminators at either end which absorb the signal, removing it from the bus.
 
Ring topology or circular topology: In this topology each node is connected to two and only two neighboring nodes and is transmitted to another. Thus data travels in one direction only, from node to node around the ring. After passing through each node, it returns to the sending node, which removes it.
 
-  Star topology: this topology consists of a central node to which all other nodes are connected by a single path.
In star topology, every node (computer workstation or any other peripheral) is connected to a central node called a hub or switch. The switch is the server and the peripherals are the clients.


 
Advantages
  • ·Star networks are very reliable because if one computer or its connection breaks it doesn’t affect the other computers and their connections
Disadvantages
  • An expensive network layout to install because of the amount of cables needed
  • If the server crashes or stops working then no computers will be able to access the network
Mesh topology: A mesh network is a network topology in which each node relays data for the network. All mesh nodes cooperate in the distribution of data in the network.

The Mesh topology is commonly used in large internetworking environments with stars, rings and buses attached to each node.

      29. What are the measures of virus prevention?
      Ans: Following are the virus prevention measures: 
       - Never use a foreign disk or CD without scanning it for viruses. 
       - Always scan files downloaded from the internet or other sources. 
       - Write protect your disks. 
       - Use licensed software. 
       - Password protect your PC to prevent unauthorized access. 
       - Install and use antivirus software. 
       - Keep antivirus software up to date.
       30. Given Boolean function F(x,y,z) =Σ(0,2,4,5,6). Reduce it using Karnaugh map
 Ans: 


        



 31. Using K-Map simplify the expression m1+m3+m5+m6+m7+m9+m11+m13 in four 
       variables W, X, Y and Z 
Ans: 


       32. Using K-map, simplify the following expression in four variables:

            F(A,B,C,D)=m1+m2+m4+m5+m9+m11+m12+m13.

Ans:
 


          33. Describe any five logical operators available in SQL.
    Ans:
ALL: This operator is used to compare a value to all values in another value set.

AND: This operator allows the existence of multiple conditions in an SQL statements’ WHERE clause.

EXISTS: This operator is used to search for the presence of a row in a specified table that meets certain criteria.

LIKE: This operator is used to compare a value to similar values using wildcard operators.

IS NULL: This operator is used to compare a value with a NULL value.


      34. Explain network securities in detail.
Ans: Authorization: Authorization is the process of allowing an authenticated users to access the resources by checking whether the user has access rights to the system. Authorization helps you to control access rights by granting or denying specific permissions to an authenticated user.

- Authentication: Authentication is the process of verifying the identity of a user by obtaining some sort of credentials and using those credentials to verify the user's identity. If the credentials are valid, the authorization process starts. Authentication process always proceeds to Authorization process.

- Encrypted smart cards: Confidentiality is the use of encryption to protect information from unauthorized disclosure. Plain text is turned into cipher text via an algorithm, then decrypted back into plain text using the same method.
Cryptography is the method of converting data from a human readable form to a modified form, and then back to its original readable form, to make unauthorized access difficult.

- Biometric systems: it involves unique aspects of a person’s body such as finger prints, retinal patterns, etc to establish his/her identity.

- Firewall: A firewall is a network security system designed to prevent unauthorized access to or from a private network. Firewalls can be implemented in both hardware and software, or a combination of both. Network firewalls are frequently used to prevent unauthorized Internet users from accessing private networks connected to the Internet, especially intranets. All messages entering or leaving the intranet pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria.


      35. Write the difference between Manual and Electronic data processing.
Ans:
Manual data processing
Computerized electronic data processing
The volume of data, which can be processed, is limited.
The volume of data which can be processed can be very large.
It requires large quantities of paper.
Reasonable, less amount of paper is used.
The speed and accuracy is limited.
The job executed is faster and accurate.
Labor cost is high.
Labor cost is economical.
Storage medium is paper.
Storage medium is secondary storage medium.


 36. Write an algorithm to insert an element into a queue.
Ans:  Step 1: if REAR=N then

                  PRINT “overflow”

                  Exit

      Step 2: if FRONT=NULL then

                  FRONT=0

                  REAR=0

Else

REAR=REAR+1

            Step 3: QUEUE[REAR]=ITEM

            Step 4: return

      37. Write an algorithm for insertion sort method.
Ans:  Step 1: for P=1 to N-1

    Step 2: temp=A[P]

                 PTR=P-1

    Step 3: while temp<A[PTR]

                A[PTR+1]=A[PTR]

                PTR=PTR-1

                End of while

    Step 4: A[PTR+1]=temp

                  End of for

    Step 5: exit



       38. Write an algorithm to insert an element in an array.

Ans:
Step 1: for I=N-1 down to P
                  A[I+1]=A[I]
                  End of for
Step 2: A[P]=ITEM
Step 3: N=N+1
Step 4: exit
       39. Write an algorithm for PUSH() and POP() operations.
       Ans: An algorithm for PUSH() Operation
                Step 1: if TOP=N then
                 PRINT “stack is full”
                 Exit
                 End of if
    Step 2: TOP=TOP+1
    Step 3: STACK[TOP]=ITEM


An algorithm for POP() Operation
     Step 1: if TOP=0 then 
                 PRINT “Stack is empty”
           Exit
Step 2: ITEM=STACK[TOP]
Step 3: TOP=TOP-1

40. Write an algorithm to search an element using binary search techniques.
Ans: Step 1: set B=LB, E=UB LOC=-1

   Step 2: while(B<=E)

                M=(B+E)/2

                If(ELE=A[M])

                LOC=M

               goto step 4

                else

                if(ELE<A[M])

                E=M-1

                else

                B=M+1

                end of while

step 3: if(LOC>=0)

                  PRINT LOC

            else

                  PRINT “Search is unsuccessful”

Step 4: exit.

 41. Give the applications of Queues.
Ans: - Simulation.
- Multi-programming platform systems. 
- Various features of operating system.
- Different types of scheduling algorithm.
- Printer server routines.
  
       42.  Write the purpose of following SQL functions: 
       i)     count()              ii) max()          iii) min()          iv)avg()           v) sum()

OR

Explain aggregate functions with an example for each.

Ans:
i) count(): this function returns the number of rows that satisfies a condition written 
                in WHERE clause.


Ex: a) select count(*) from employee;
 b)   select count(*) from employee where dept=’computer science’;
i)     max(): this function returns the maximum value from the column.
Ex: select max(salary) from employee;
ii)      min(): this function returns the minimum value from the column.
Ex: select min(salary) from employee;
iii) avg():  this function returns the average value of a numeric column.
Ex: select avg(salary) from employee;
iv) sum(): this function returns the sum of a numeric column.
Ex: select sum(salary) from employee;

43. What is copy constructor? Explain with syntax and programming example. 
Ans: The copy constructor is a constructor which creates an object by initializing it with an object of the same class.
The copy constructor is used to −
  • Initialize one object from another of the same type.
  • Copy an object to pass it as an argument to a function.
  • Copy an object to return it from a function.
Syntax:            x         a1;       //x is a class and a1 and a2 are objects of the same class
                        x          a2=a1;
#include<iostream.h>
#include<conio.h>
class copy
{
int var;
public:
copy(int temp) 
{ 
var=temp;
}
int calculate()
{
int fact,i;
fact=1;
for(i=1;i<=var;i++)
fact=fact*i;
retrun fact;
}
};
void main()
{
int n;
cout<<”Enter the number: ”;
cin>>n;
copy obj(n);
copy cpy=obj;
cout<<”Before copying : ”<<n<<”!=”<<obj.calculate()<<endl;
cout<<”After copying : ”<<n<<”!=”<<cpy.calculate()<<endl;
}  

44. What is data definition language? Give the functions of data definition language. 
Ans: DDL defines the conceptual schema providing link between the logical and the physical structure of the database.

Functions of DDL: 
- It defines the physical characteristics of each record. 
- Describes the schema and subschema. 
- It indicates the keys of the records. 
- Provides data security measures. 
- It provides logical and physical data independence.

45. What is computer virus? Write the symptoms (characteristics) of computer virus. 
Ans: “computer virus is a malicious program that disrupts the normal functioning of the computer.”
Symptoms or characteristics of computer virus, 
1.      Unexpected pop-up windows 
2. Slow start up and slow performance 
3. Suspicious hard drive activity 
4. Lack of storage space 
5. Missing files 

46. Write an algorithm to delete an element from a queue data structure. 
Ans: 
Step 1: if FRONT=NULL then
      PRINT “underflow”           
      Exit
Step 2: ITEM=QUEUE[FRONT]
Step 3: if FRONT=REAR then
       FRONT=0

             REAR=0
       else
       FRONT=FRONT+1
Step 4: return

47. What is primitive data structure? Explain different operations performed on primitive data structures. 
Ans: “data structures that are directly operated upon by machine-level instructions are known as primitive data structures.” 
Operations on primitive data structures, 
- Create: create operation is used to create a new data structure. This operation reserves memory space for the program elements. It can be carried out at compile time and run-time.
For example, int x; 

- Destroy: destroy operation is used to destroy the data structures from the memory space. When the program execution ends, the data structure is automatically destroyed and the memory allocated is eventually de-allocated. C++ allows the destructor member function destroy the object. 

- Select: select operation is used by programmers to access the data within data structure. This operation updates the data. 

- Update: update operation is used to change data of data structures. An assignment operation is a good example of update operation.
For example, int x=2;                    here, 2 is assigned to x.
Again, x=4;                                   4 is reassigned to x. the value of x now is 4 because 2 automatically replaced by 4.    

48. Explain any five relational/comparison operators in SQL with suitable examples. 
Ans: consider a=10 and b=20
Operator
Description
Example
=
Checks if the values of two operands are equal or not, if yes then condition becomes true.
(a=b) is not true
!=
Checks if the values of two operands are equal or not, if values are not equal then condition becomes true.
(a!=b) is true
Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true.
(a>b) is not true
Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true.
(a<b) is true
>=
Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true.
(a>=b) is not true
<=
Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true.
(a<=b) is true



2nd puc computer science notes karnataka pdf, 2nd puc computer science study material, 2nd puc important questions of computer science, 2nd puc computer science chapter wise notes, 2nd puc computer science important question with answers, 2nd year puc computer science notes, 2nd puc computer science chapter wise important questions, 2nd puc computer science guide, 2nd puc computer science important questions, second puc computer science important questions, puc 2nd year computer science notes, 2nd puc computer science boolean algebra notes, 2nd puc computer science classes and objects notes, 2nd puc computer science chapter 1, 2nd puc computer science chapter 4 notes, 2nd puc computer science data structure notes, 2nd puc computer science function overloading notes, passing package for 2nd puc computer science, 2nd puc computer science logic gates notes, 2nd puc computer science inheritance notes, 2nd puc computer science 1st chapter, 2nd puc computer science 1st chapter notes, 2nd puc computer science 1st chapter important questions,

















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































 


 
2nd puc computer science notes (5 marks questions and answers) 2nd puc computer science notes (5 marks questions and answers) Reviewed by Vision Academy on November 30, 2019 Rating: 5

No comments:

CheckOut

Powered by Blogger.