Category Archives: List Of Practical Questions AISSCE 2017

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

 
Advertisements