Holiday Homework / Revision Sheet Class XI Sub: Computer Science Prepared By: Mr. Paritosh Srivastava

 

Day 1 (26/09/2017)

Q.1  Convert the following numbers as expected.                                     

            (a)  (1001.101)2 =  (    )10

            (b)  (75)8 =  (    )16

Q.2  What is type casting .Explain with example.

Q.3  What is main role of sizeof( ) in C++ ? Explain with example.

Q.4  What is BOOTING process? How it is important in Computer?

Q.5  What is difference between interpreter and complier?

Q.6  Draw the block diagram for nested if- else statement.

Q.7  Explain any 2 factors which affect to processor performance.

Q.8  Explain either Time sharing or real time operating system.

Q.9  Explain the operator precedence with suitable example.

Q.10  Explain about different states of process in operating system.

Day 2 (27/09/2017)

Q1. What are C++ tokens.

Q2. What is cascading of I/O operators?

Q3. What is the difference between ‘h’ and “h” in c++?

Q4. How are files and devices implemented at lowest level?

Q5. What is an interpreter?

Q6.How many times “hello” will be printed in the following code fragment:

for (i=0; i<5; i++)

cout<< “hello”;

Q7.Evaluate the following, where a, b, c are integers and d, f are floating point numbers.

The value of a=8, b=4 and d=2.5

  • f = a * b + a/b
  • c = d-a + b % a
  • c= (++a) * (b++) – (++d)
  • f = (++b) / b – a %b

Q8. Explain ‘break’ and ‘continue’.

Q9. What is the output of the following:

  1. # include<iostream.h>

void main ( )

{

int i=0;

for (i=1; i<=20;i++)

{

cout<<i;

i=i+2;

}

}

 

  1. # include<iostream.h>

void main( )

{

a=3;

a=a+1;

if (a>5)

cout<<a;

else

cout<<(a+5);

}

Q10. What will be the output of the following program segment:

If input is as:

(a) w     (b) r     (c) s     (d) f

cin >>code

switch (code)

{

case ‘w’: cout<<”winter”;

case ‘r’ : cout<<”rainy”;

break;

case ‘s’ : cout<<”summer”;

break;

default: cout<<” wrong code”;

}

Day 3 (28/09/2017)

1.Write a program in c++ to calculate the commission for the salesmen. The commission is calculated as follows.

Sales

Made

Commission

Rate

30001 onwards 15%
22001 to 30000 10%
12001 to 22000 7%
5001 to 12000 3%
0 to 5000 0%

 

  1. Write a program to calculate and print the roots of a quadratic equation ax2+bx+c=0.

 

  1. A bank accepts a fixed deposit for one year or more and the policy it adopts on interest is as follows:
  2. i) if a deposit less than 2000 and for 2 or more years , the interest rate is five percent compound annually.
  3. ii) if a deposit is Rs. 2000 or more but less than Rs. 6000 and for 2 or more years, the interest rate is seven percent compounded annually.

iii) if a deposit is more than  or equal to Rs. 6000 and for 1 year or more , the interest rate is eight percent compounded annually.

  1. iv) on all deposits for 5 years or more , interest is ten percent compounded annually.
  2. v) on all other deposits not covered above conditions, the interest is three percent compounded annually.

Given the amount deposited and number of years, write a program to calculate the money in the costumers account at the end of the specified time.

 

  1. Write a program in c++ using conditional operator to find the largest of three numbers entered through keyboard.

 

  1. A computer programming contest requires teams of 5 members each. Write a program that ask the user to enter number of players and then display the total number of teams and number of player left over.

 

  1. Write a program to calculate the area of a circle or triangle or rectangle according to the choice given by the user.

 

  1. What will be the output of the following code fragment?

 

int year;

cin>> year;

if(year % 100==0)

{

if(year%400==0)

cout<<”Leap”;

}

else

cout<<” Not  a century year.

If the input given is

  1. 2000
  2. 1900
  • 1971

 

  1. What is dangling else problem? How is it overridden? Give example.
  2. Predict the output of the following code fragment:
  3. i) int a, b=3;

cin>>a;

if(a)

b=a++ -1;

cout<< “a=”<<a<<endl;

cout<<”b=”<<++b<<endl;

When the value of a is input as 6.

  1. ii) cin>>a;

if(a=5)

cout<<”Five”;

else

cout<<” Not Five”;

if the input given is 7.

  1. Distinguish between a unary, binary and a ternary operator. Give example of c++ operators for each one of them.                                 Day 4 (29/09/2017)

 

  1. What is type conversion? How many types of type conversion is allowed in c ++. Explain with example.
  2. Name the header files required for successful execution of a program that uses the following components:
  3. i) endl ii) setprecision( )          iii) ceil( )          iv) fabs( )
  4. What is the effect of access specifiers on data type?

How  does it affect the floating point data type?

  1. What are the differences between syntax and runtime errors? Give example.
  2. What is the memory requirement for the following constants?
  3. i) “ Meera\’s Birthday” ii) “\?” iii) ‘\a’ iv) “my name”
  4. Write the equivalent C++ expression for the following expressions:
  5. i) tan-1 1  + tan-1 1 + tan-1 1 + tan-1 1p

3            5            7            8     4

  1. ii) y = [ sinx ]tan x + [ cos x]sec x
  2. What are constants? How these are different from ordinary variables?
  3. Predict and correct the logical error present in the following code fragment:

if(k=1)

cout<<”ONE”;

else

cout<<” NOT ONE”;

  1. Define the following terms:
  2. i) Refference Variable
  3. ii) Abstraction

iii) pointer

  1. Predict the output of the following codes:( Make sure the Syntax is correct)
  2. i) if(1)

cout<<” Be careful”;

cout<<”You might commit a mistake”;

  1. ii) if(!5)

cout<<” How many times”;

else

cout<<”No more please”;

cout<<” O.K”;

iii) if(0)

cout<<”Third time again”;

cout<<”Last chance”;

else

cout<<” Very good”;

 

Day 5 (30/09/2017)

 

  1. Write alternate code for the following codes using
  2. i) Only if
  3. ii) Using conditional operator

if(a= = 0)

cout<<” Zero”;

if(a= = 1)

cout<<” One”;

if(a = =2)

cout<<” Two”;

  1. Fill in the blanks:
  2. i) (100011101)2=(_______)10
  3. ii) (354)8=(______)2

iii) (A6D12)16=(____)8

  1. Write the 1’s Complement form of the following binary numbers:

100010111, 11101

  1. Expand the following: BIOS, ISCII, SJN, SRAM
  2. Write shortly about the 3rd generation computers.
  3. What do you mean by Non-Preemptive scheduling?
  4. Write the Name of 4 Operating systems that are used world wide.
  5. What do you mean by utility software? Give one example.
  6. What is BOSS? Write the names of softwares of this family.
  7. Define the term Booting.
  8. What is a Path?

12 What is a keyword? Is ‘asm’ a key word?

Advertisements

List Of Practical Questions 2017

Questions for Practical File 2017

Questions (Autumn Break) 30

Questions (Winter Break) 20

K_map(05)

Sql Queries(05)

1 WAP to perform Insertion and deletion operation in queue.
2 WAP to perform PUSH and POP operation in Stack.
3 WAP to perform insert and delete operation in Linked List.
4 WAP to perform Binary Search using class.
5 WAP to perform selection sort using Class.
6 WAP to perform Bubble Sort using class.
7 WAP to count the total no of vowels in a file.
8 WAP to count the no of uppercase , lowercase , digits in a file.
9 WAP to create a backup of a file.
10 WAP to find the record of a student from file and print the record.
11 WAP to implement following operations in an array using class:

A)    Transpose

B)    Trace

C)    Multiplication

D)    Addition

E)     Substraction

12 WAP to Count the no of vowels , numbers and spaces in a file.
13 WAP to write an object of Class PRODUCT in a binary file , and add a product to a file and delete a product from file.

Private Members

PCode            of type integer

ProductName      of type string

Price            of type float

Quantity         of type integer

Discount         of type float

A function CAL_DISC() to calculate Discount as per the following rule:

If Quantity  <=  50       Discount is 0

If 50 < Quantity <= 100   Discount is 5 If Quantity > 100         Discount is 10

14 A class STUDENT has 3 data members:

Name, Roll Number, Marks of 5 subjects, Stream

and member functions to input and display data. It also has a function member to assign stream on the basis of the table given below:

Average Marks    Stream

96% or more    Computer Science

91% – 95%      Electronics

86% – 90%      Mechanical

81% – 85%      Electrical

75% – 80%      Chemical

71% – 75%      Civil

Declare a structure STUDENT and define the member functions.

Write a program to define a structure STUDENT and input the marks of n (<=20) students and for each student allot the stream. (Don’t use any array).

15 Define a POINT class for two-dimensional points (x, y). Include a default constructor, a copy constructor, a negate() function to transform the point into its negative, a norm() function to return the point’s distance from the origin (0,0), and a print() function besides the functions to input and display the coordinates of the point.

Use this class in a menu driven program to perform various operations on a point.

16 Write a program to input the name of a text file from the user and display:

a)    The number of blanks present in the file.

b)   The number of lines present in the file.

c)     The number of capital alphabets present in the file.

d)    The number of small alphabets present in the file.

e)     The number of lines starting with a capital alphabet.

f)      The number of words present in the file.

g)     The number of digits present in the file.

The number of words ending with a vowel

17 Create two payroll files COMP1.DAT and COMP2.DAT. Each of the files should have the following fields:

EmpNo   : Integer

Name    : A string of 20 characters

Salary  : A floating point number.

Both the files should be created in the increasing order of the EmpNo. Your program should then merge the two files and obtain a third file NEWCOMP.DAT. The program should also display the data from all the three files.

Do not use arrays for merging and sorting of the files. You can assume that the EmpNo are unique.

18 Write a menu driven program in C++ to perform the following functions on a binary file “BOOK.DAT” containing objects of the following class:

class Book

{          int BookNo;

char Book_name[20];

public:

// function to enter book details

void enterdetails();

//function to display Book details

void showdetails();

//function to return Book_no

int Rbook_no() {return Book_no;}

//function to return Book_name

int Rbook_name() {return Book_name;}

};

1.         Append Records

2.         Modify a record for a given book no.

3.         Delete a record with a given book no.

4.         Search for a record with a given Book name

5.         Display a sorted list of records (sort on Book No.)

Display a sorted list of records (Sort on Book Name)

19 Write a function in C++ which accepts an integer array and its size as arguments/parameters and exchanges the values of first half side elements with the second half side elements of the array.

Example:

If an array of eight elements has initial contents as

2,4,1,6,7,9,23,10

The function should rearrange the array as

7,9,23,10,2,4,1,6

20 Write a menu driven program which allows the user to perform the following operations on a stack (Array implementation):

1)   Push

2)   Pop

3)   Display

21 Write a menu driven program which allows the user to perform the following operations on a queue (Array implementation):

1)   Insert

2)   Delete

3)   Display

22 Write a menu driven program which allows the user to perform the following operations on a stack (Linked implementation):

1)   Push

2)   Pop

3)   Display

23 Write a menu driven program which allows the user to perform the following functions on a queue (Linked implementation):

1)   Insert

2)   Delete

3)   Display

If F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11), obtain a simplified form using K-Map
If F(a,b,c,d)=∑(0,1,2,3,4,5,7,8,9,11,13,15),obtain a simplified form using K-Map
If F(a,b,c,d)=π(0,1,3,4,5,11,13,15,),obtain a simplified form using K-Map
If F(a,b,c,d)=π(0,1,3,4,5,7,8,9,11,13)obtain a simplified form using K-Map
If F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11,13,15,),obtain a simplified form using K-Map

SQL Commands                                                                                                                                

Table: Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 NULL 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 NULL 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30

The command along with the result must be written in the answer sheet.

  1. Display the details of all the employees whose Grade is not NULL.
  2. Display the various department numbers from the table Employee. A department number should be displayed only once.
  3. Display the names and salaries of all the employees who are not working in department 20.
  4. Display the details of all the employees whose salary is between 32000 and 38000.
  5. Display the names of all the employees who are working in department 20 or 30. (Using IN operator)
Table Name : Employee

Employee_id First_name Last_name Salary Joining_date Department
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance

Table Name : Incentives

Employee_ref_id Incentive_date Incentive_amount
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
1.       Get all employee details from the employee table                   

Select * from employee

2. Get First_Name,Last_Name from employee table

                       Select first_name, Last_Name from employee

3. Get First_Name from employee table using alias name “Employee Name”

                        Select first_name Employee Name from employee

4. Get First_Name from employee table in upper case

                        Select upper(FIRST_NAME) from EMPLOYEE

5. Get First_Name from employee table in lower case

                         Select lower(FIRST_NAME) from EMPLOYEE

6. Get unique DEPARTMENT from employee table

                         select distinct DEPARTMENT from EMPLOYEE

7. Select first 3 characters of FIRST_NAME from EMPLOYEE

Oracle Equivalent of SQL Server SUBSTRING is SUBSTR

Query : select substr(FIRST_NAME,0,3) from employee

SQL Server Equivalent of Oracle SUBSTR is SUBSTRING,

Query : select substring(FIRST_NAME,0,3) from employee

MySQL Server Equivalent of Oracle SUBSTR is SUBSTRING.

In MySQL start position is 1, Query : select substring(FIRST_NAME,1,3) from employee

8. Get position of ‘o’ in name ‘John’ from employee table

Oracle Equivalent of SQL Server CHARINDEX is INSTR,

Query : Select instr(FIRST_NAME,’o’) from employee where first_name=’John’

SQL Server Equivalent of Oracle INSTR is CHARINDEX,

Query: Select CHARINDEX(‘o’,FIRST_NAME,0) from employee where first_name=’John’
MySQL Server Equivalent of Oracle INSTR is LOCATE,

Query: Select LOCATE(‘o’,FIRST_NAME) from employee where first_name=’John’

9. Get FIRST_NAME from employee table after removing white spaces from right side

select RTRIM(FIRST_NAME) from employee

10. Get FIRST_NAME from employee table after removing white spaces from left side

select LTRIM(FIRST_NAME) from employee

11. Get length of FIRST_NAME from employee table

Oracle,MYSQL Equivalent of SQL Server Len is Length ,

Query :select length(FIRST_NAME) from employee
SQL Server Equivalent of Oracle,MYSQL Length is Len

Query :select len(FIRST_NAME) from employee

12. Get First_Name from employee table after replacing ‘o’ with ‘$’

select REPLACE(FIRST_NAME,’o’,’$’) from employee

13. Get First_Name and Last_Name as single column from employee table separated by a ‘_’

Oracle Equivalent of MySQL concat is ‘||’,

Query : Select FIRST_NAME|| ‘_’ ||LAST_NAME from EMPLOYEE

SQL Server Equivalent of MySQL concat is ‘+’,

Query : Select FIRST_NAME + ‘_’ +LAST_NAME from EMPLOYEE
MySQL Equivalent of Oracle ‘||’ is concat,

 Query : Select concat(FIRST_NAME,’_’,LAST_NAME) from EMPLOYEE

14. Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee table

Select FIRST_NAME, to_char(joining_date,’YYYY’) JoinYear , to_char(joining_date,’Mon’), to_char(joining_date,’dd’) from EMPLOYEE

SQL Queries in SQL Server, select SUBSTRING (convert(varchar,joining_date,103),7,4) , SUBSTRING (convert(varchar,joining_date,100),1,3) , SUBSTRING (convert(varchar,joining_date,100),5,2) from EMPLOYEE

SQL Queries in MySQL, select year(joining_date),month(joining_date), DAY(joining_date) from EMPLOYEE

 

Practical Question for Practice

List of Practical questions for COMP SCIENCE (083) AISCCE 2016-17

1 WAP to perform Insertion and deletion operation in queue.
2 WAP to perform PUSH and POP operation in Stack.
3 WAP to perform insert and delete operation in Linked List.
4 WAP to perform Binary Search using class.
5 WAP to perform selection sort using Class.
6 WAP to perform Bubble Sort using class.
7 WAP to count the total no of vowels in a file.
8 WAP to count the no of uppercase , lowercase , digits in a file.
9 WAP to create a backup of a file.
10 WAP to find the record of a student from file and print the record.
11 If F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11,13,15,),obtain a simplified form using K-Map
12 If F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11), obtain a simplified form using K-Map
13 If F(a,b,c,d)=∑(0,1,2,3,4,5,7,8,9,11,13,15),obtain a simplified form using K-Map
14 If F(a,b,c,d)=π(0,1,3,4,5,11,13,15,),obtain a simplified form using K-Map
15 If F(a,b,c,d)=π(0,1,3,4,5,7,8,9,11,13)obtain a simplified form using K-Map
SQL Commands                                                                                                                                

Table: Employee
No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 NULL 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 NULL 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30

The command along with the result must be written in the answer sheet.

a.       Display the details of all the employees whose Grade is not NULL.

b.      Display the various department numbers from the table Employee. A department number should be displayed only once.

c.       Display the names and salaries of all the employees who are not working in department 20.

d.      Display the details of all the employees whose salary is between 32000 and 38000.

e.       Display the names of all the employees who are working in department 20 or 30. (Using IN operator)

 

Table Name : Employee

Employee_id First_name Last_name Salary Joining_date Department
1 John Abraham 1000000 01-JAN-13 12.00.00 AM Banking
2 Michael Clarke 800000 01-JAN-13 12.00.00 AM Insurance
3 Roy Thomas 700000 01-FEB-13 12.00.00 AM Banking
4 Tom Jose 600000 01-FEB-13 12.00.00 AM Insurance
5 Jerry Pinto 650000 01-FEB-13 12.00.00 AM Insurance
6 Philip Mathew 750000 01-JAN-13 12.00.00 AM Services
7 TestName1 123 650000 01-JAN-13 12.00.00 AM Services
8 TestName2 Lname% 600000 01-FEB-13 12.00.00 AM Insurance

Table Name : Incentives

Employee_ref_id Incentive_date Incentive_amount
1 01-FEB-13 5000
2 01-FEB-13 3000
3 01-FEB-13 4000
1 01-JAN-13 4500
2 01-JAN-13 3500
1. Get all employee details from the employee table

                                   Select * from employee

2. Get First_Name,Last_Name from employee table

                       Select first_name, Last_Name from employee

3. Get First_Name from employee table using alias name “Employee Name”

                        Select first_name Employee Name from employee

4. Get First_Name from employee table in upper case

                        Select upper(FIRST_NAME) from EMPLOYEE

5. Get First_Name from employee table in lower case

                         Select lower(FIRST_NAME) from EMPLOYEE

6. Get unique DEPARTMENT from employee table

                         select distinct DEPARTMENT from EMPLOYEE

7. Select first 3 characters of FIRST_NAME from EMPLOYEE

Oracle Equivalent of SQL Server SUBSTRING is SUBSTR

Query : select substr(FIRST_NAME,0,3) from employee

SQL Server Equivalent of Oracle SUBSTR is SUBSTRING,

Query : select substring(FIRST_NAME,0,3) from employee

MySQL Server Equivalent of Oracle SUBSTR is SUBSTRING.

In MySQL start position is 1, Query : select substring(FIRST_NAME,1,3) from employee

8. Get position of ‘o’ in name ‘John’ from employee table

Oracle Equivalent of SQL Server CHARINDEX is INSTR,

Query : Select instr(FIRST_NAME,’o’) from employee where first_name=’John’

SQL Server Equivalent of Oracle INSTR is CHARINDEX,

Query: Select CHARINDEX(‘o’,FIRST_NAME,0) from employee where first_name=’John’


MySQL Server Equivalent of Oracle INSTR is LOCATE,

Query: Select LOCATE(‘o’,FIRST_NAME) from employee where first_name=’John’

9. Get FIRST_NAME from employee table after removing white spaces from right side

select RTRIM(FIRST_NAME) from employee

10. Get FIRST_NAME from employee table after removing white spaces from left side

select LTRIM(FIRST_NAME) from employee

11. Get length of FIRST_NAME from employee table

Oracle,MYSQL Equivalent of SQL Server Len is Length ,

Query :select length(FIRST_NAME) from employee
SQL Server Equivalent of Oracle,MYSQL Length is Len

Query :select len(FIRST_NAME) from employee

12. Get First_Name from employee table after replacing ‘o’ with ‘$’

select REPLACE(FIRST_NAME,’o’,’$’) from employee

13. Get First_Name and Last_Name as single column from employee table separated by a ‘_’

Oracle Equivalent of MySQL concat is ‘||’,

Query : Select FIRST_NAME|| ‘_’ ||LAST_NAME from EMPLOYEE

SQL Server Equivalent of MySQL concat is ‘+’,

Query : Select FIRST_NAME + ‘_’ +LAST_NAME from EMPLOYEE
MySQL Equivalent of Oracle ‘||’ is concat,

 Query : Select concat(FIRST_NAME,’_’,LAST_NAME) from EMPLOYEE

14. Get FIRST_NAME ,Joining year,Joining Month and Joining Date from employee table

SQL Queries in Oracle,

Select FIRST_NAME, to_char(joining_date,’YYYY’) JoinYear , to_char(joining_date,’Mon’), to_char(joining_date,’dd’) from EMPLOYEE

SQL Queries in SQL Server, select SUBSTRING (convert(varchar,joining_date,103),7,4) , SUBSTRING (convert(varchar,joining_date,100),1,3) , SUBSTRING (convert(varchar,joining_date,100),5,2) from EMPLOYEE

SQL Queries in MySQL, select year(joining_date),month(joining_date), DAY(joining_date) from EMPLOYEE

 

 

VIVA QUESTIONS FOR AISSCE PRACTICAL 2016-17

 

1.Define program.

2.Define Programming language

3.Explain different stages of Programdevelopment

4.Whatialgorithm?

5.Classification of languages

6.Importance of main()

7.Difference between C and C++.

8.Features of OOPs

9.Difference between Object OrientedPrograms and Procedure OrientedPrograms.

10.Define Tokens.

11.Define Keywords

12.Identifiers (their characteristics)

13.Operators (Arithmetic, Relational,Logical, Ternary, Scope resolution,sizeof(), increment, decrement,indirection, at address)14.Difference between fundamental datatypes and derived data types

15.Fundamental data types, memorysize, range.16.Type casting

17.Data type modifiers – long, short,signed and unsigned etc.

18.Different types of execution –sequential, selection and iteration.

19.ASCII

20.Difference between prefix and postfix

21.Difference between global variablesand local variables.

22.Arithmetic assignment operators (+=,-=, *=, /=, %=)

23.Difference between entry-controlledloops and exit-controlled loops

24.Elements control a loop –initialisation expression, testexpression, body of the loop andupdate expression.

25.Nested loop

26.Difference between rvalue and lvalue

27.What is compilation?

28.What is debugging?

29.Different types of errors – compilationerror, run time error and logical error

30.What is an array?

31.Equation for finding total number of elements in an array (UB – LB + 1).

32.What is a matrix?

33.How can we find the address of anelement in a 2-D array?

  1. What is the difference between rowmajor and column major form of anarray?

35.What is a string?

36.What is the importance of ‘\0’ in astring?

37.What are the criteria used for matrixaddition and multiplication?

38.What do you mean by diagonalelements of a matrix?

39.What is a symmetric matrix?

40.Which are the important stringhandling functions used in C++?(strcpy(), strlen(). strcmp(), strcat(),strrev())

41.Character functions used in C++(isalpha(), isdigit(), isalnum(),isupper(), islower(), toupper(),tolower())

42.What do you mean by scope of avariable?

43.What is a function?

44.What is function signature or functionprototype?

45.Difference between calling functionand called function?

46.Difference between actualparameters and formal parameters.

47.Difference between break andcontinue.

48.Importance of exit() function.

49.Difference between call by value andcall by reference method of functioncall.

50.Classification of functions – functionswithout argument and without returnvalue, functions with argument andwithout return value, functionswithout argument and with returnvalue, functions with argument andwith return value

51.Difference between pre-definedfunctions and user-defined functions.

52.What do you mean by pre processor directives?

53.What is a structure?

54.What is self referential structure?

55.Difference between structure andunion.

56.What is type compatibility?

57.What is enumeration?

58.Difference between getch() andgetche() functions.

59.ImpoRtant storage classes – Auto,Extern, Register, Static etc

60.What is the use of randomizefunction?

61.What are pointers?

62.What is a null pointer?

63.Difference between static memoryallocation and dynamic memoryallocation.

64.What is the importance of new anddelete operators in C++?

65.C++ memory map.

66.What do you mean by garbagevalue?

67.What is the difference between = and==?

68.What is a block or compoundstatement?

69.Define class and object.

70.What is the difference between aclass and a structure?

71.What is modularity?

72.Define abstraction and data hiding.

73.What is inheritance?

74.Different types of inheritance.

75.Advantages of inheritance

76.Define base class, super class,abstract class and derived class.

77.Visibility modes- private, public andprotected.

78.Global and local objects and their scope.

79.Difference between member functions and non-member functions.

80.What is polymorphism?

81.What are constructors anddestructors?

82.Features of a constructor.

83.Differences between constructorsand other member functions of aclass.

84.What is function over riding?

85.What is a friend function?

86.Different types of constructors –default, parameterised and copyconstructor.

87.What are files?

88.Basic operations in a file.

89.File stream classes and their uses –ifstream, ofstream and fstream.

90.Different methods used for opening afile.

91.What is a stream?

92.Different file modes – ios::app, ios::in,ios::out, ios::truncate etc.

93.Difference between seekg() andseekp(), tellg() and tellp().

94.Difference between a text file and abinary file

.95.What is eof().

96.What is a friend function?

97.What is function overloading?

98.What is function overriding?

99.What is this pointer?

100.Difference between primitive andnon-primitive data types.

101.Difference between stack and queue.

102.Different searching techniques usedin an array

103.Different sorting methods used in anarray

104.Define data, database, databasemanagement system

105.Data redundancy

106.What is domain?

107.What is a relation?

108.Define the terms tuple, degree,cardinality, attributes etc.

109.What is a view?

110.Difference between a table and aview.

111.What is a key?

112.Define candidate key, primary key,alternate keys, composite primarykey, foreign key etc.

113.What is the difference between selectand project operations in DBMS?

114.What is the difference between unionand set intersection operations?

115.What is SQL?

116.Different data types used in SQL.

117.Difference between character andvarchar2.118.What is data dictionary or metadata?

119.Different categories of commands used in SQL-DDL, DML,TCL and DCL.

120.What is a constraint?

121.Different constraints used in SQL –unique, primary key, default, check,not null.

122.Aggregate functions used in SQL.

123.What is pseudo column?

124.Explain the commands – SELECT,INSERT, CREATE, ALTER,UPDATE, DROP, TRUNCATE,DELETE etc.

125.What is a schema?

126.Difference between DROP andDELETE commands in a table.

Short Questions with Answers

 

  1. What are inline member functions?Ans. Functions defined inside a class are inline.

    2. What is the difference between ordinary functions and inline functions?

    Ans. No function call is made to inline functions as the source code is copied to the program during compilation whereas in ordinary functions, the control is switched over to the function block when function is called.

    3. What are the situations where the inline functions do not work?

    Ans. Inline functions does not work in the following situations

    a. functions with return values,or having switch, goto, or loop

    b. functions containing static variables

    c. a recursive function

    d. function having return statement (even if it does not return values)

    4. What are the basic differences between a structure and a class?

    Ans. Structure has only data members whereas class has both data member and member functions. By default all members of a structure are public whereas all members of a class are private by default.

    5. What is a friend of a class?

    Ans. Any ordinary function (non-member of a class) which has access privileges to the private members of a class are called friends of a class.

    6. Which are the three types of (categories of ) a class function?

    Ans. Accessor function – which can only access the data members(not edit it), mutator function – which can manipulate the data members (getdata(),calculate()), manager function – specific functions (constructor, destructor)

    7. Explain Encapsulation, Data hiding, Data Abstraction with reference to classes.

    8. What must be done to make the static data member of a class work?

    Ans. Declaration within class and definition outside the class

    9. What is the difference between static member function and ordinary member functions:

    Ans. Static function of a class can access only the other static members of a class. Static function of a class is invoked by using the class name instead of object name.

    10. How does the memory allocation for member functions and data members take place?

    Ans. Member functions are created and placed in memory only once when the class is defined. The memory is allocated for objects’data members when the objects are declared. All objects share the same member functions.

    11. Name the methods through which polymorphism is exhibited in C++?

    Ans. Through operator overloading, function overloading and virtual functions.

    12. What are overloaded functions?

    Ans. Functions having the same name but which differs in number of type of arguments is called overloaded functions. It has nothing to do with return types( data type of functions)

    13. What contributes to function overloading – function signatures or return type of function – Ans. function signature

    14. Name the various types of constructors- default , parameterized, copy constructor

    15. How is a copy constructor called ? Ans – It is called by call by reference only.

    16. What is default constructor ?

    Ans. A constructor with no arguments or all arguments having default values.

    17. What are the uses of scope resolution?

     Ans- used to defined methods of a class outside the class, to unhide global variable having the same name as the local variable in a block

    18. What do you mean by temporary instance of a class?

    Ans. Objects created for the purpose of execution only. …..

    19. The differences between constructors and destructor are:

    Ans. constructors can take arguments but destructor can’t , constructors can be overloaded but destructors can’t be overloaded.

    20. Write a statement in C++ to prove that even primitive data types have constructors . Ans – int k(2).

    21. What are the privileges of friend function of a class- to access the private and protected members of a class

    22. What happens when constructor functions are invoked – objects are created.

    23. How many ways of representing an integer – decimal, octal and hexadecimal

    24. Which is the standard library –iostream.h

    25. Difference between goto and gotoxy – goto is C++ statement and gotoxy () is a function defined in conio.h

    26. Why is char treated as integer? –memory represents char in ASCII codes(numeric)

    27. What is the length of escape sequences ? – 1 byte.

    28. Name the only data type of which we cannot declare any variables?

    Ans. Void

    29. Name the fundamental data types of C++

    Ans. Int, char, float, double, void.

    30. What is the difference between Union and Enumeration?

    Ans. Union is when two variables usually of different types sharing the same memory location ( any one occupies memory at a time). Enumeration is a way of declaring integer constants. Eg. Union share { int x, char y;};

    Enum p{F, S, T};

    31. Name an exit controlled and an entry controlled loop.

    Ans. Exit controlled – do{…..}while(); Entry controlled – while(){….}

    32. Which of the following is not a jump statement? Switch, goto, break, exit.

    Ans. Switch.

    33. Which of the following will work only in a loop – break, goto, continue, exit.

     Ans. Continue and break.

    34. Which is the default data type of C++? – Ans. Int

    35. If a function does not have a data type specified which will be its datatype by default ? – Ans. Int

    36. What is the default value of a static variable or global variable?

    Ans – zero

    37. Which are the storage class specifiers in C++?

    Ans. Auto, register, extern, static.

    38. A function that calls itself for its processing is known as – recursive function

    39. Strings are character arrays. The last index of it contains the null-terminated character – ‘\0’.

    40. What is the only function all C++ programs must contain? – main()

    41. The directives for the preprocessors begin with – #

    42. Differences between ‘a’ and “a”- ‘a’ is character of I byte whereas “a” is a string of 2 bytes.

    43. What is the difference between int K[2] and int K(2) ? – first is in integer array of size 2 whereas second is declaring a variable K with initial value 2.

    44. Differences between abort() and exit() – abort()- aborts “abnormal termination” exit()- closes all files and writes the buffered output before termination.

    45. biggest number that can be represented by – int (32,767) and unsigned int (65,535)

    46.

     Structure:47. What is the difference between a structure and an array?

    Ans. Structures are heterogeneous collection of data whereas arrays are homogenous collection of data. Members of a structure are referred to by dot operator whereas array elements are referred to by subscript values.

    48. What is the condition of assigning one structure to another?

    Ans. Both structures must be of the same type ( same tag name)

    49. What is the difference between typedef and reference variable?

    Ans. Typedef creates an alternative name for a standard data type whereas reference creates an alternative name for a variable.

    50. What is the function of #define?

    Ans. Used to declare symbolic constants and macros.

    51. What is the default inheritance visibility mode? – private (if no visibility is specified it is private)

    52. Can a derived class access the private members of the base class? If Yes, how? – can only access them through the nonprivate members.

    53. What is inheritance graph? – derivation form multiple base classes.

    54. what is order of constructor and destructor invocation in case of inheritance.?

     When object of derived is inherited first the constructor of base class and then the derived class but for destructor first the destructor of derived class and then the base class is invoked.

    55. What is the difference between protected and private members of class –

     Ans. protected members are inheritable –private members are not.

    56. What is the size of a class without any data member?

    1 byte.

    57. Which operator can be used prove that the private members of the base class are actually hidden in the derived (visible ) but not accessible?

     Ans. Sizeof() operator on the object of the derived class will prove this.

    58. What is Virtual Base classes?

    Ans. In multiple bases classes are inherited.

     59. What is containership or aggregation or containment?

    Ans. When a class contains objects of other class types as its members it is called containership

    60. Explain Has- A relationship, Is – A relationship.

    Ans. When a class inherits from another class, the derived has a IS-A relationship with the base class. When a class contains the object of another class type – then the class containing the object has a HAS –A relationship with the contained class.

    61. When a subclass is a base class of another class it is – multilevel inheritance.

    62. What is function overriding ?

     Ans. When a function of base class is re-defined in derived class – it is called function overriding.

    63. What is the advantage of inheritance ? Ans – code reusability and saving of programming time.

    64. Differentiate between ‘IS-A’ , ‘HAS-A’ and ‘HOLDS-A’ relationship in inheritance.

    65. What are visibility modes ? Differentiate between them.

    Ans. Private, protected, public.

    66. by default all files are treated as – text files in C++ ( not binary)

    67. explain the file modes – ios::ate, ios::app, ios::noncreate….

    68. difference between get() and getline().

    69. use of seekg, seekp , tellg, tellp.

    70. What is a stream ?

    Ans. A sequence of bytes – flow of bytes into or out of a program.

    71. Name the stream classes in C++ for I/O – ofstream, ifstream, fstream.

    72. Name the member functions belonging to fstream class – get(), seekp(), seekg()

    73. What is the difference between binary and text files?

    74. Which functions can be used to manage binary files in C++ ?

    Ans. Read and Write functions.

    75. While writing class objects what is written to files data members or member functions?

    Ans. Only data members.

    76. How random access is is managed in C++?

    Ans. Random access is managed by using seekg(), seekp(), tellg(), tellp() functions.

     77. What is the difference between constant pointers and pointer to a constant?

    78. What is the disadvantage of calling a function by reference?

     Ans. When a function is called by reference method only variables can be passed not constants or expressions as in call by value method.

    79. Which operator is used to refer to the object pointers(class and structure) ?

    Ans. Arrow operators ->

    80. What is this pointer? – explain

    81. State two situations in which this pointer is not used in classes?

    Ans. static member functions do not have this pointer and friend functions are not passed this pointer

     82. Which are the two memory management operators in C++.

    Ans. New and delete.

    83. What is Static memory allocation and dynamic allocation ? static- at compilation time and dynamic at run time(using NEW operator)

    84. What is life time of dynamically allocated memory variable ? – till it is de-allocated.

    85. What is memory leak – if the no. of dynamically allotted memory variable are not deleted using delete –

    86. How are arrays passed to a function? – by reference/pointers and not by value method

    87. What do you mean by traversal – processing all data elements of an array is called traversal.

    88. What is the size of an array A [-10…..20] ? – 31

    89. What is a vector – a numeric one dimensional array.

    90. Which are the two ways of memory allocation of a 2-D array – row and column major

    91. What is the precondition for a binary search ? – array should be sorted.

    92. Stack is – LIFO and Queue is FIFO.

    93. Which are the two types of queues ? circular and dequeue

     94. Differentiate between arrays, stacks and queues.

    95. Merits and demerits of linear and binary search.

    Ans. Linear search – demerits takes more iterations to find an element especially if it is towards the end of array. Array need not be sorted.

     96. If arr is an array of integer – is arr++ expression legal – why? (no- base address of a array cannot be changed)

    97.  Definition of database,relation,,DBMS,RDBMS, domain, field, tuple, attribute, cardinality, degree, primary key, alternate key.

    98. Operations on relation – selection, projection, union ,Cartesian product

    99.Difference between create table and alter table , create table and create view commands, delete table and drop table.

    100. Group functions – sum(), max(), min(), avg(), count()

    101. Differentiate between DDL and DML commands with example.

    102. Universal gates – NAND and NOR . Why are they called universal gates.

    103. Main theorems of Boolean Algebra, principle of duality

    104. Definitions of network,Internet,switching techniques-Circuit, Message, Packet, Transmission media- Twisted, coaxial cable, optical fibre, micro wave, radio wave, satellite, buad rate, bandwidth,LAN,MAN,WAN,totplogies,hub,switch,router,bridge,repeater,firewall,cookies

  2. 105. FULL forms of HTTP, FTP,TCP/IP,SLIP/PPP, MODEM,CDMA,WLL,SMS,WWW,URL

         106.What is function prototype and function signature.

         107.Differentiate between call by value and call by reference.

        108.What is method overloading and method overriding

        109.What is pointer to an array and an array of pointers.

        110.Differentiate between Structure and Class.

        111.What is inline function.

 

 

Compiled By :    Paritosh Srivastava

                                PGT(Comp)

                                KV Aliganj

January Lesson Plan

LESSON PLAN

 CLASS                       XII

SUBJECT                 Computer Science                                                                                                                      

TOPIC                       Paper Solving and Revision.

SUB-TOPIC  

  1. Solving previous year papers.
  2. Solving HOTS.

GENERAL AIM

Students must have knowledge of paper solving and time management in Exams.

SPECIFIC AIMS

Students will have maximum knowledge of paper solving .

 PREVIOUS KNOWLEDGE

All the topics covered previously.

 TEACHER’S ACTIVITY  

Preparation of sample paper and providing it to the students.

PUPIL’S ACTIVITY

 Solving Sample Papers and HOTS.

 

LESSON PLAN

UNIT/TOPIC :12 Array

DATE OF COMMENCEMENT : 13/01/17

CLASS : XI-A, Computer Science

NO. OF PEROIDS REQUIRED      LESSON NOTE DATE OF COMPLETION : 25/01/17

NO. OF PEROIDS USED :

Gist of the Unit Additional information/values, sources and teaching aids used Objectives related to the information including diagram Additional exercises/questions for home assignment
Structured Data Type:

Arrays

Declaration/initialisation of One-dimensional array, Inputting array elements, Accessing array elements, Manipulation of Array elements (sum of elements, product of elements, average of elements, linear search, finding maximum/minimum value); Declaration/Initialization of a String, string manipulations (counting vowels/ consonants/digits/special characters, case conversion, reversing a string, reversing each word of a string);

 

Two-dimensional Array : Declaration/initialisation of a two-dimensional array, inputting arry elements Accessing array elements, Manipulation of Array elements (sum of row element, column elements, diagonal elements, finding maximum/minimum values)

Books:

–          Computer science by Sumita Arora

–          Learning and programming in C++ by E Balagurusamy

–          Study material provided by KVS.

–          Together with for practice questions

Internet:

–          created Power point presentations and from various sites.

 

 

 

–          To understand the concept of array.

–          To understand the concepts of single dimensional and multi-dimensional array

–          Illustrate the working of array, application of array etc.

 

1.      Write a program to print largest and smallest element of an array.

2.      Write a program to reverse a vector without using a temporary variable.

3.      Write various program on 2 dimensional to add, subtract and product it.

4.      Write a program on 2 dimensional to do the following action-

–          Sum of rows

–          Sum of columns

–          Sum of diagonal elements

5.      From a two dimensional array, write a program to prepare a one dimensional array that will have all the elements of the 2-D array .

 

 

 

 

 

Presentation on Array

https://paritoshpari.files.wordpress.com/2015/07/arrays.ppt

Please Click here for Quiz on Arrays….

https://docs.google.com/forms/d/e/1FAIpQLSeJZbZKlI31p6sJxKTg1g9XOZRh749PhDpUxuyufsi-nydWqw/viewform

SLOW –LEARNER STUDENT

  • What are loops?
  • What are conditional statements?
  • What are arrays?
  • How are elements stored in arrays?
  • What is role of exit () function?

 

AVERAGE STUDENT

  • What are various types of Loops?
  • What is difference between multiple if’s and switch statement?
  • What are different types of arrays?
  • What are various operations that can be performed on arrays?
  • What are various formatted input and output Statements?

 

BRIGHT STUDENT

  • WAP to print the natural nos from 1 to 100 in ascending and descending order?
  • WAP to print Fibonacci series?
  • WAP to generate random numbers from 1 to 10?
  • WAP to add two matrices?
  • What are jump statements and why it must be avoided in programs?

Marks Statement of Students

https://docs.google.com/spreadsheets/d/1GCGmmv6-2GvfBe1mk6v-mr0WEFL22zMXLToRRcwElKI/edit?usp=sharing

November Lesson Plan

LESSON PLAN

DATE             November 1 – November 15 

CLASS                       XII

SUBJECT                 Computer Science                                                                                         

TOPIC                       Boolean Algebra.

SUB-TOPIC  

  1. Logic Gate.
  2. K Maps.

GENERAL AIM

To introduce Boolean algebra, using various basic gates and universal gate to implement logic circuit and using K map to simplify logic circuits.

SPECIFIC AIMS

Students must be able to learn use of logic gates in building circuits and must be able to simplify the complex circuits using laws of Boolean algebra, truth table and K maps.

TEACHING OBJECTIVES

Concept of 0/1 must be clear to students and they must be able to perform all Boolean operations and build simple as well complex circuits and must be able to use various logic gates in building functions .Also they must be able to simplify complex function to simpler ones using K maps and laws.

PREVIOUS KNOWLEDGE

Students are expected to know about Boolean arithmetic i.e. addition, subtraction etc. basics of logic gates and conditional expressions.

TEACHER’S ACTIVITY  

                 (Teacher will ask questions based on previous knowledge of the students and will take up topic    accordingly)

  • What are bits?
  • What are logic gates?
  • What are conditional expressions?
  • How can we combine conditions?
  • What is truth table?
  • Rules of Binary Addition.
  • What is 1’s and 2’s complement?

PUPIL’S ACTIVITY

Children concepts should be analyzed on the basis of the answers they give. Accordingly we will take up the topic.

ANNOUNCEMENT OF TOPIC

Boolean algebra and Karnaugh Maps

INTRODUCTION

NOT; Truth Tables; Closure Property, Commutative Law, Associative Law, Identity law, Inverse law, Principle of Duality, Idem potent Law, Distributive Law, Absorption Law, Involution law, DeMorgan’s Law and their applications; Obtaining Sum of Product (SOP) and Product of Sum (POS) form from the Truth Table, Reducing Boolean Expression (SOP and POS) to its minimal form, Use of Karnaugh Map for obtaining minimal

form of Boolean expressions (up to 4 variables); Applications of Boolean Logic:Digital electronic circuit design using basic Logic Gates (NOT, AND, OR, NAND, NOR)Use of Boolean operators (AND,OR) in SQL SELECT statementsUse of Boolean operators (AND, OR) in search engine queries.

TEACHING METHOD

Lecture method followed by Practical Interactive Method.

TEACHING AIDS

Markers, Computers, Black-Board, Chalk etc.

TEACHING POINT TEACHER’S ACTIVITY PUPIL’S ACTIVITY BLACK BOARD SUMMARY
What are logic gates To explain what is logic gate and explain its importance in building logical circuits. To understand various logic gates and how conditional expressions are evaluated using this gates and building logical circuits using these gates. Various logic gates will be explained and simplification of complex logical circuits will be explained to students.
To explain that there are 3 basic logic gates

AND
OR

NOT

 

To make them understand that simple circuits can be made through these simple logic gates and can be simplified further. How it is done in Boolean algebra.
To explain various laws

Demorgans Laws

Distributive law

Identity Law

Involution Law

 

 

To make them understand these laws and proving these laws using algebraic method and using truth table. To understand laws and their prove.Impleming them in expression simplification.
To use K map in circuit simplification To make them understand using K map and various rules for using it;

Pair

Quad

Octet

Map Rolling

 

To understand the use of K map and its use in circuit simplification.

RECAPITULATION

  1. Gates are building blocks of logical circuits.
  2. AND, OR, NOT are basic logic gates.
  3. NAND and NOR are universal gates.
  4. K map is graphical tool to simplify Boolean logic circuits.

 

EVALUATION TOOLS

  1. Prove that X.(X+Y)=X by algebraic method.
  2. Give duals for the following :
  1. a) A+ ĀB
  2. b) AB+ĀB
  3. State and verify Involution law.
  4. Draw logic circuit diagram for the following expression:Y= AB+BC+CĀ
  1. State and verify Duality principle.

HOME-ASSIGNMENT

SLOW –LEARNER STUDENT

  1. State and verify De-Morgan’s law in Boolean algebra.
  2. Prove (x+y)(x+z) = x+yz algebraically.
  3. State absorption law.
  4. What is minterm?
  5. State and verify associative law.

AVERAGE STUDENT

  1. State and verify associative law.
  2. State and verify distributive law.
  3. State the principle of duality in Boolean algebra and give the dual of the Boolean expression (x+y). (x+z).
  4. Draw the circuit diagram for F = AB’C + C’B using NAND to NAND logic only.
  5. Given a Boolean function F= XY + X’Y’ + Y’Z. Implement it with only NAND-to-NAND logic.
  1. Draw the logic circuit diagram for F=ABC + A’B’C + A’BC’
  2. Reduce the following Boolean expression using K – Map:F (A, B, C, D) =    ∑ (0, 1, 2, 3,4, 5, 10, 11, 15)

BRIGHT STUDENT

  1. Reduce the following Boolean expression using K-Map.

F (a,b,c,d) = S (1,4,5,8,9,12,13)

  1. Reduce the following Boolean expression using K-Map.

F (a,b,c,d) = S (2,3,6,7,9,12,14,15)

  1. 3. Reduce the following Boolean expression using K-Map.

F (a,b,c,d) = P (2,3,5,8,9,10,11,15)

  1. 4. Reduce the following Boolean expression using K-Map.

F (a,b,c,d) = P (0,1,2,4,5,7,9,12,14,15)

  1. 5. Reduce the following Boolean expression using K-Map.

F (a,b,c,d) = P (1,4,5,6,8,10,11,13)

 

 

Teacher’s Signature                                                                                          Principal’s Signature

 

Come to learn Go to serve.