0% found this document useful (0 votes)
77 views2 pages

Computer Science II PUC Viva Questions

The document contains questions and answers related to computer science for a Part A and Part B exam. Part A questions cover topics like classes, objects, data members, member functions, access specifiers, operators, inheritance, constructors, destructors, data structures, arrays, stacks, queues, pointers, header files, and data types in C++. Part B questions cover topics like SQL commands, data types in SQL, keys, URLs, HTML tags and the file extension for HTML.

Uploaded by

khanrehaan904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views2 pages

Computer Science II PUC Viva Questions

The document contains questions and answers related to computer science for a Part A and Part B exam. Part A questions cover topics like classes, objects, data members, member functions, access specifiers, operators, inheritance, constructors, destructors, data structures, arrays, stacks, queues, pointers, header files, and data types in C++. Part B questions cover topics like SQL commands, data types in SQL, keys, URLs, HTML tags and the file extension for HTML.

Uploaded by

khanrehaan904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Al Ameen Pre University College, Hosur Road, Bangalore

II PUC viva Questions


Subject :-- Computer Science PART A
1. Class:--A class is a blueprint of an object.
2. Object:--An object is an instant of a class.
3. Data Member:--the variables declared inside a class are called data member.
4. Member functions:-- the function declared / Defined inside a class are called member function.
5. Non -Member Functions:--the function that are not declared / Defined inside a class are called non-member function.
6. Features of OOPs(OR characteristics of OOPs).
Object, class ,Data abstraction. Encapsulation, inheritance, polymorphism
[Learn each definition]
7. What are access specifiers OR Visibility modes OR Access Modifiers.
Ans. Private, Protected and Public[Learn each definition]
8. What is the use of (dot) . operator.
Ans. The dot operator Is used to connect the object and the member.
9. What is the use of scope resolution:: operator.
Ans. ::is used to define the member function outside the class and used to identify to which class the member function
belongs to.
10. Difference between struct and class in C++.
11. Define function overloading:--it means multiple function have the same name but different in their parameters.
Ways to overload a function.
i. By having different number of arguments.
ii. By having different type of arguments.
12. Constructor:--it is a member function having same name as its class and it is used to initialize the object of that class.
Type of constructor.
i. Default constructor: -- a constructor that takes no parameters.
ii. Parameterized constructor: -- a constructor with parameters.
iii. Copy constructor.
13. Destructor:-- it is a member function having same name as its class preceded by ~ (tilde) sign and it is used destroy
the object of that class.
14. Inheritance:-- it is a process of creating a new class from existing class.

Types of inheritance.
[Link] inheritance II. Multi- level inheritance III. Multiple Inheritance
Iv. Hierarchical inheritance V. Hybrid Inheritance
15. Base Class:--it is an already existing class whose properties are inherited by another class. It is also called super or
parent class.
16. Derived Class:-- it is the class that inherit properties from base class. It is also called sub or child class.
17. Data structure:--is defined as the particular way of organizing data and operation performed on that data. It is
classified as primitive and non- primitive DS.
[Learn Primitive and non primitive]
18. Array:-- an array is a collection of data elements of same data type.
Types of Array
I. One dimensional Array [ eg int a[3]; ]
II. Two dimensional Array [ eg int a[3][2]; ]
III. Multi dimensional Array [eg int a[3][2][3] ; ]
19. Stack:--is a LIFO data structure in which insertion and deletion of element takes place at only one end know as TOP.
20. Queue:--is a FIFO data structure in which insertion and deletion of elements takes place at two ends Rear and Front
respectively.
21. Pointer :-- a pointer is a variable that holds the address of another variable in memory
*p-indicates value &p- holds address
22. Header files
#include<iostream.h> [uses for input & output statement i.e. cin & count]
#include<conio.h> [uses for getch() and clrscr() functions]
#include<iomanip.h> [uses for setw() & endl() functions]
#include<stdlib.h> [exit(0) function]
#include<math.h> [uses sqrt() abs() etc]
Note: stream is sequence of bytes
H for header file
23. Data type
24. Int(2 byte), float(4 byte), char (1 byte), double(8 byte) etc
[1 byte = 8 bits]
25. What are input and output statements used in c++
Ans. Cin & cout
26. What is an extension of c++ program.
.cpp
PART –B.
1. SQL(Structured Query Language)
2. Table:--collection of rows & columns that contains useful data/information is called a table. It is also called a
Relation.
3. Field:-- set of characters that represents specific data elements. It is a column in a relation also called attribute.
4. Tuple:-- a row in a relation . also called record.
5. Degree:-- No. of attributes in a relation is called degree of a relation.
6. Types of SQL Commands.
i. DDL(Data Definition Language).
Create table, alter table, drop table etc.
ii. DML(Data Manipulation Language).
Select, insert, update, delete etc.
iii. DCL(Data Control Language).
Grant and Revoke
iv. TCL(Data Control Language)
Commit & Rollback
7. Data types in SQL.
Number, char , Varchar/Varchar2, date, time etc
8. Learn the definition of Primary key, unique key , candidate key & Foreign key.
9. URL:-- Uniform Resource Locator, provides the lacation of a web document/resource.
URL is a web address of a resource on internet.
10. HTML:--(hyper text Markup Language)
Is used to create webpages.
Other languages used to create webpages are DHTML, XML, Javascript etc
11. Html Tages
12. <b>:--for bold, <th> :-- table heading
<p>:-- for Paragraph , <td>:-- table data
<tr>:-- table Row ,<u> underline
<i>,<title><body>
Heading tages <h1>…<h6>
13. Extension for html file ?
Ans .html

Common questions

Powered by AI

In C++, the main difference between struct and class revolves around access control. By default, members of a struct are public, while members of a class are private . This fundamental distinction impacts their use in programming. Structures are typically used for passive objects with public data members that are easy to access, whereas classes are used for active objects with encapsulated data, restricting direct manipulation. The choice between struct and class often depends on the level of encapsulation needed; classes provide stricter control over data and operations, supporting object-oriented principles more effectively .

Inheritance allows for the creation of new classes based on existing ones, serving as a means of establishing a hierarchical relationship between classes. It enables code reusability by allowing derived classes to inherit characteristics and behaviors of base classes, reducing redundancy . Polymorphism, on the other hand, allows objects to be treated as instances of their parent class, enabling a single interface to represent different data types or classes. This enhances maintainability by allowing code to handle new, unforeseen cases seamlessly, often through function overloading and method overriding. Both inheritance and polymorphism enable flexibility and scalability in software development, but polymorphism specifically allows for extending capabilities without altering existing code structure, thus enhancing maintainability .

A class in object-oriented programming serves as a blueprint for creating objects, encapsulating data and functions that manipulate this data, which define its characteristics and behaviors. This supports encapsulation by combining data and functions into a single entity. An object, on the other hand, is an instance of a class, representing a specific example of the data described by the class. Through encapsulation, access to the data of an object is restricted to the functions that are defined within the class, thus safeguarding the data from unauthorized access and misuse. Encapsulation and data abstraction work together to allow objects to interact with one another without needing to understand their underlying implementation, which promotes modularity and maintainability .

HTML tags are fundamental in structuring webpage content, providing hooks for styling and behavior scripts. They encapsulate content within start and end tags, defining the document's structure and applying specific semantics. For example, <p> tags structure text into paragraphs, <h1> to <h6> tags denote headings of different levels, imparting semantic meaning and facilitating navigation . Tags like <b>, <i>, and <u> apply stylistic modifications, strength, italics, and underline, respectively, representing different semantic meanings. Additionally, layout-related tags such as <table>, <tr>, <td> conceptualize tabular data, while <div> and <span> tags are used within CSS to apply styles and control layout. These tags collectively allow HTML documents to be machine-readable and human-understandable, enabling the creation of structured, accessible content .

Function overloading in C++ allows multiple functions with the same name to coexist in the same scope, differentiated by their parameter lists—different numbers or types of arguments . This feature enhances program flexibility by enabling functions to process various types of data without changing their name, simplifying the interface. For example, an overloaded function 'print' can handle int, float, or string inputs by defining it: print(int), print(float), and print(string). This reduces redundancy and, therefore, increases maintainability, allowing changes and extensions without altering the function names or interface, decreasing potential errors .

The dot operator in C++ is used to access members of an object, effectively tying together the object and the members of the class it was instantiated from . For example, if an object named 'obj' is created from a class, its members are accessed using 'obj.member'. In contrast, the scope resolution operator '::' serves a different purpose by allowing the definition of member functions outside their class definition or specifying the class to which a certain member belongs when ambiguities arise within a program's structure. This operator enhances readability and maintains organization in complex projects by clearly linking function definitions to their class declarations .

Access specifiers in C++—private, protected, and public—are essential for controlling the visibility and accessibility of class members, thereby ensuring secure and effective use of data encapsulated within classes. Private access restricts access to members so they can only be modified by functions within the same class, providing a high level of data protection. Protected members can be accessed by derived classes, offering a balance between encapsulation and inheritance utility. Public members are accessible from outside the class, necessary for defining interfaces for object interaction. These specifiers enforce data hiding and abstraction principles, ensuring that class internals are shielded from improper access and modification, which enhances security and reliability in software development .

Constructors and destructors play a pivotal role in managing the lifecycle of objects in C++. Constructors initialize objects upon creation, with different types serving specific scenarios: default constructors initialize objects with default values, parameterized constructors allow for initialization with specific values, and copy constructors create copies of existing objects . Destructors, denoted with a tilde (~), automatically manage resource cleanup when objects go out of scope, preventing memory leaks and ensuring efficient resource use . Together, they automate and streamline object initialization and destruction, crucial for robust resource management in complex applications, directly impacting performance and stability .

SQL commands in database management are critical for maintaining, querying, and securing data within databases. Data Definition Language (DDL) commands like CREATE, ALTER, and DROP manage the structure of database objects, setting up schemas as required . Data Manipulation Language (DML) commands including SELECT, INSERT, UPDATE, and DELETE allow precise data querying and modification, underpinning dynamic data interactions. Data Control Language (DCL) commands such as GRANT and REVOKE control data access and permissions, implementing security frameworks by restricting unauthorized access. Transaction Control Language (TCL) commands like COMMIT and ROLLBACK ensure data consistency and reliability during transactions, providing mechanisms to either finalize changes or revert to previous states upon errors . This multi-faceted approach to data handling boosts a database system's robustness, ensuring data integrity and security in diverse operational conditions.

Stacks and queues are fundamental data structures used to abstract various real-world scenarios and optimize computational processes. A stack functions as a Last In, First Out (LIFO) structure, ideal for scenarios where tasks must be processed in reverse order of arrival, such as undo functionalities in software . Its LIFO nature simplifies function call management through recursive calls and backtracking algorithms, minimizing overhead. A queue implements a First In, First Out (FIFO) approach, resembling scenarios like task scheduling, where the first task to enter is the first to execute . Both structures inherently simplify and enhance the efficiency of operations, leveraging minimal complexity for common procedures like insertion and deletion, optimizing both memory use and processor time .

You might also like