SlideShare a Scribd company logo
CBSE Grade 12 - Computer Science Sample QuestionPaper
Section A
1. a. [2]
i) Which language is the predecesor of C++ language?
ii) Is C++ a case sensitive language? Justify your answer.
1.b. [1]
i) Give an example of a function used to handle characters along with the name of the header
file to be included.
ii) An float variable f_num holds the value 2.8. Name the function that can be used to store 2
into an integer variable i_num from the variable f_num. Name the required header file to use
this function.
1.c. Rewrite the following C++ program after removing all the syntactical errors (if
any), underlining each correction. [2]
#include <iostrem.h>
#define g=9.8;
void main()
{
float mass, force;
cout>>"Enter mass";
cin<<mass;
force := mass*g;
cout>>'Force is'>>force;
};
1.d. Write the output from the following C++ program code: [2]
#include <iostream.h>
#define MAX 4
char *Family[MAX]={"Father","Mother","Son","Daughter"};
int Age[MAX];
void ComputeAge(int AgeOfDaughter)
{
Age[MAX-1]=AgeOfDaughter;
Age[MAX-2]=AgeOfDaughter+4;
Age[MAX-3]=(AgeOfDaughter+6)*2;
Age[MAX-MAX]=Age[MAX-3]+5;
}
void main()
{
ComputeAge(14);
for(int i=0;i<MAX;i++)
cout<<"Age of "<<Family[][i]<<" is "<<Age[i]<<" years";
}
1.e Write the output from the following C++ program code: [3]
#include <iostream.h>
class SamsungSales
{
int NoOfUnits;
float UnitPrice;
float ProfitAmount,ProfitPercentage;
SamsungSales(float profitpercent)
{
ProfitPercentage = profitpercent;
}
void RegisterSales(int units,float price)
{
NoOfUnits = units;
UnitPrice = price;
}
void ComputeProfit()
{
ProfitAmount = (NoOfUnits*UnitPrice*ProfitPercentage)/100;
}
void DisplaySales()
{
cout<<NoOfUnits<<"->"<<UnitPrice<<"->"<<ProfitAmount<<"n";
}
};
void main()
{
SamsungSales S6(20),S6Edge(30);
cout<<"SAMSUNG Salesn";
S6.RegisterSales(100,40000);
S6.DisplaySales();
S6Edge.RegisterSales(50,50000);
S6Edge.ComputeProfit();
S6Edge.DisplaySales();
S6.ComputeProfit();
S6.DisplaySales();
cout<<"!!! Great going !!!";
}
1.f. Study the following C++ program and select the possible output(s) from it :
Find the maximum and minimum value of L. [2]
#include <stdlib.h>
#include <iostream.h>
void main()
{
char *BowlAnOver[9]={"5 Runs","No Ball","Wide","Dot Ball","1 Run","2 Runs","3
Runs","Boundary","Sixer","Wicket"};
randomize();
long L;
for(int i=0;i<6;i++)
{
L=random(6)+4;
cout<<BowlAnOver[][L]<<"-";
}
}
i) Wicket-No Ball-3 Runs-Boundary-2 Runs-1 Run-
ii) Wicket-2 Runs-Sixer-Bounday-1 Run-3 Runs-
iii) 2 Runs-Wicket-Boundary-Sixer-1 Run-3 Runs-
iv) 2 Runs-1 Run-Sixer-Wide-3 Runs-Boundary-
2. a. [2]
i) Differentiate object oriented programing and procedural progrming.
ii) List two advantages of object oriented programming.
ii) Is C++ a case sensitive language? Justify your answer.
2.b. Answer the questions (i) and (ii) after going through the following C++ class [2]
class SuperSinger
{
public:
int SingerID;
char SingerName[100];
int Votes;
SuperSinger() // Function 1
{
SingerID=0;
strcpy(SingerName,"");
Votes=0;
}
SuperSinger(int ID, char S[]) // Function 2
{
SingerID=ID;
strcpy(SingerName,S);
Votes=0;
}
SuperSinger(SuperSinger &S) // Function 3
{
SingerID=S.SingerID;
strcpy(SingerName,S.SingerName);
Votes=S.Votes;
}
Vote()
{
Votes++; // Statement 1
}
~SuperSinger() { } // Function 4
};
i) Name the concept of object oriented programing used in Function 1, Function 2 and Function
3
ii) Name the category of construtor Function 3 belongs to. Define this category.
iii) When is Function 4 invoked? What is it referred to as in object oriented programming?
iv) Name the operator used in Statement 1. In what modes can these operators be used?
2.c. Define a class RetailStore with the following specifications [4]
Private members:
• apparel_id integer
• apparel_name char(30)
• cost_price, sales_price float
• quantity_on_hand integer
Public members:
• A default constructor to reset values
• GetApparelData() to get input from users for the applicable private members and call
ComputeSalesPrice() to determine the SalesPrice
• ComputeSalesPrice() to compute SalesPrice based on the conditions below on profit
percentage:
• 20% if cost_price is greater than 5000
• 10% if cost_price is greater than 4000
• 5% if cost_price is greater than 2000
• 3% for all other items
• ShowApparelData() to display all private members
2.d. Answer the questions below based on the code below: [4]
class customer
{
int cust_id;
char cust_name[50];
char cust_tel[20];
protected:
void StoreCustomer();
pubic:
customer();
void GetCustomer();
void DispCustomer();
};
class branch
{
int br_id;
char br_name[50];
protected:
char br_addr[200];
char br_tel[20];
public:
branch();
void GetBranch();
void DispBranch();
};
class telco : private branch, public customer
{
int telco_id;
char telco_name[100];
float turnover;
public:
telco();
void GetTelco();
void DispTelco();
};
i) Write the names of all data members and member functions accessible from an instance of
class telco.
ii) List the data members accessible from
a) GetTelco()
b) DispBranch()
iii) What type of inheritance is implemented in the above code? Show a diagramatic
representation of the inheritance implemented.
iv) Declare an instance of telco class called IndiaTel. How many bytes are required to store this
object.
[3]
3.a. An array T[-1..35][-2..15] is stored in the memory along the row with each element occupying 4
bytes. Find out the base address and address of element T[20][5], if an element T[2][2] is stored at the
memory location 3000. Find the total number of elements stored in T and number of bytes allocated to T
[3]
3.b. Write a function WorldCup2015() in C++ to sort an array of the following structure in descending
order of Points using bubble sort
struct WorldCupTeams
{
char Country[50];
int Points;
};
[4]
3.c. Write member functions to PUSH and POP a dynamically allocated stack with objects derived from the
following structure:
struct CBSEStudents
{
int Grade;
int NoOfStudents;
CBSEStudents *next;
};
3.d. [2]
Write a function in C++ to print the sum all the numbers divisible by 6 in a 2-dimnsional array which is
passed as an argument to the function.
3.e. [2]
Evaluate the following postfix expression. Show the status of stack after execution of each operation
separately.
4,15,*,60,/,4,4,-,5,*,+
4.a. Write C++ statements for the following requirements: [1]
i) Open binary file "MyData.bin" in append mode with the required declaration
ii) Move the file pointer to read the file 10 bytes before the current position
4.b. [2]
Write a C++ function to count the number of sentences in the file "MyProjectReport.txt" and
display the count.
4.c. [3]
Write a C++ function to search customers having invoice amout more than Rs. 1,00,000 from
binary file "Customers.dat" and display the details of these customers. Assume the availability of
the following class that implements the requirement.
class Customers
{
int cust_id;
char cust_name[50];
char cust_addr[200];
float invoice_amount;
public:
void GetCustomerData()
{
cin>>cust_id>>cust_name>>cust_addr>>invoice_amount;
}
void Display()
{
cout <<"nID:" <<cust_id;
cout<<"tName:" <<cust_name;
cout<<"tAddr:" <<cust_addr;
count<<"tInvoice Amount:" <<invoice_amount<<"n";
}
float GetInvoiceAmount() {return invoice_amount;}
};
Section B
5.a. [2]
i) Define primary key
ii) What datatype can be used to store your date of birth?
5. Based on the table below answer the questions in (b) and (c)
Table: DEPARTMENTS
Dept_No Dept_Name Manager_ID
D10 Sales 1234
D20 Finance 1235
D30 Human Resources 1236
D40 Marketing 1237
Table: EMPLOYEES
Emp_no Emp_Name Dept_No Grade
1234 Priya D10 100
1100 Renga D10 50
1110 Harini D20 50
1120 Smitha D40 60
1235 Lakshmi D20 100
1130 Anandhi D30 70
1236 Abi D30 100
1140 Muthu D20 50
1237 Suji D40 100
1150 Kamala D40 60
5.b. Write SQLs for the following: [4]
i) List the employees sorted by dept_no
ii) List the departments in descending order of dept_name
iii) Display dept_name, manager_id and the name of the manager
iv) List the dept_name and number of employees in each department
5.c. Write the output for the following SQL commands [2]
i) SELECT dept_no, COUNT(*) FROM employees GROUP BY dept_no;
ii) SELECT COUNT(DISTINCT dept_no) FROM employees;
iii) SELECT Grade, COUNT(*) FROM employees GROUP BY Grade;
iv) SELECT emp_name, dept_name FROM employees e, departments d WHERE
d.dept_no=e.dept_no;
6.a. Name the law shown below and veriy using truth table: [2]
X+Y.Z = (X+Y) . (X+Z)
6.b. Draw a logical circuit for the following boolean expression: [2]
_ _
F = (A.B) + (C+D)
6.c. Write the Sum of Product form of the function F(U,V,W) for the following truth table
representation of F: [1]
U V W F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
6.d. Obtain the minimal form for the following Boolean expression using K-map. [3]
F(M,N,O,P) = SUM(2, 4, 5, 9, 10, 11, 12)
7.a. [1]
i) What is network?
ii) List 2 reasons to have network
7.b. What is mobile computing? [1]
7.c. Expand the following: [1]
i) CDMA
ii) DHTML
7.d. Differentiate client side scripting and server side scripting [1]
7.e. BlueSoft company has the following details: [4]
• Distance between Development Block & Research block is 100m
• Distance between Development Block & Admin block is 20 m
• Distance between Research block & Admin block is 40 m
• 20 computers are required in Development block
• 100 computers are required in Admin block
• 80 computers are required in Research block
i) In which block should the server be installed?
ii) Design the cabl layout & represent the same diagramatically such that effective
communication would occur
iii) Recommend the bst possible connection from the list below from this company in Delhi to
their client in London:
• Satellite link
• Infrared
• Ethernet cable
iv) Which of the following device(s) is best recommended to connect the computers in the Delhi
office?
• Switch
• Modem
• Gateway
7.f. Differntiate freeware and shareware [1]
7.g. What is virus? List 2 types of viruses [1]

More Related Content

What's hot (20)

PDF
CS Sample Paper 1
kvs
 
PDF
Class xi sample paper (Computer Science)
MountAbuRohini
 
PPT
Qno 1 (f)
Praveen M Jigajinni
 
PPT
Computer Programming- Lecture 9
Dr. Md. Shohel Sayeed
 
PPT
Python Part 1
Sunil OS
 
PPT
Computer Programming- Lecture 10
Dr. Md. Shohel Sayeed
 
PPT
Computer Programming- Lecture 7
Dr. Md. Shohel Sayeed
 
PPT
OOP v3
Sunil OS
 
PPTX
Basic c++ programs
harman kaur
 
DOCX
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
PPT
Lecture 12: Classes and Files
Dr. Md. Shohel Sayeed
 
DOC
programming in C++ report
vikram mahendra
 
PDF
Sample Paper 2 Class XI (Computer Science)
Poonam Chopra
 
PDF
Object Oriented Programming Using C++ Practical File
Harjinder Singh
 
PPT
Bca 2nd sem u-2 classes & objects
Rai University
 
DOCX
Xiicsmonth
rishikasahu1908
 
PDF
Computer science ms
B Bhuvanesh
 
PDF
2014 computer science_question_paper
vandna123
 
DOCX
Sample paper i.p
poonamchopra7975
 
CS Sample Paper 1
kvs
 
Class xi sample paper (Computer Science)
MountAbuRohini
 
Computer Programming- Lecture 9
Dr. Md. Shohel Sayeed
 
Python Part 1
Sunil OS
 
Computer Programming- Lecture 10
Dr. Md. Shohel Sayeed
 
Computer Programming- Lecture 7
Dr. Md. Shohel Sayeed
 
OOP v3
Sunil OS
 
Basic c++ programs
harman kaur
 
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
Lecture 12: Classes and Files
Dr. Md. Shohel Sayeed
 
programming in C++ report
vikram mahendra
 
Sample Paper 2 Class XI (Computer Science)
Poonam Chopra
 
Object Oriented Programming Using C++ Practical File
Harjinder Singh
 
Bca 2nd sem u-2 classes & objects
Rai University
 
Xiicsmonth
rishikasahu1908
 
Computer science ms
B Bhuvanesh
 
2014 computer science_question_paper
vandna123
 
Sample paper i.p
poonamchopra7975
 

Viewers also liked (13)

PPTX
HTML - Structure
mrhoopsfan23
 
PPTX
Html structure
akkias
 
PPTX
Web comparison
Fatin Othman
 
PPT
Evaluating Websites
Lisa Barnett
 
PDF
The Worst Website Ever - Case Study Lings Cars
Marcin Kosedowski
 
PPTX
Websites: The Good, the Bad and the Ugly
Blackbaud
 
PPTX
CBSE, Grade12, Computer Science, Random Numbers - Notes
Malathi Senthil
 
PPTX
Html5 structure & semantic
Muktadiur Rahman
 
PPTX
Html5 Basics
Pankaj Bajaj
 
PPT
Intro to HTML5
Vlad Posea
 
PDF
Html5 intro
Ynon Perek
 
PPT
Intro to Web Design
Kathy Gill
 
PDF
Echo HTML5
Nathan Smith
 
HTML - Structure
mrhoopsfan23
 
Html structure
akkias
 
Web comparison
Fatin Othman
 
Evaluating Websites
Lisa Barnett
 
The Worst Website Ever - Case Study Lings Cars
Marcin Kosedowski
 
Websites: The Good, the Bad and the Ugly
Blackbaud
 
CBSE, Grade12, Computer Science, Random Numbers - Notes
Malathi Senthil
 
Html5 structure & semantic
Muktadiur Rahman
 
Html5 Basics
Pankaj Bajaj
 
Intro to HTML5
Vlad Posea
 
Html5 intro
Ynon Perek
 
Intro to Web Design
Kathy Gill
 
Echo HTML5
Nathan Smith
 
Ad

Similar to CBSE Grade12, Computer Science, Sample Question Paper (20)

DOC
Sp 1418794917
lakshmi r
 
PDF
Computer Science Sample Paper 2
kvs
 
PDF
Computer Science Sample Paper 2015
Poonam Chopra
 
PDF
Programming fundamentals using c++ question paper 2014 tutorialsduniya
TutorialsDuniya.com
 
PDF
Mid term sem 2 1415 sol
IIUM
 
PDF
EEE 3rd year oops cat 3 ans
Karthik Venkatachalam
 
DOCX
Cs pritical file
Mitul Patel
 
PDF
Cbse question paper class_xii_paper_2000
Deepak Singh
 
PPTX
OOPS (object oriented programming) unit 1
AnamikaDhoundiyal
 
PDF
Object Oriented Programming using C++ PCIT102.pdf
GauravKumar295392
 
PDF
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
Gautham Rajesh
 
PDF
c++ referesher 1.pdf
AnkurSingh656748
 
PPTX
C++ theory
Shyam Khant
 
PDF
Ch 4
AMIT JAIN
 
PPT
C++ data types
pratikborsadiya
 
PPTX
cppt-170218053903 (1).pptx
WatchDog13
 
PDF
200 mcq c++(Ankit dubey)
Ankit Dubey
 
PPTX
CPP-overviews notes variable data types notes
SukhpreetSingh519414
 
PPT
C++ tutorials
Divyanshu Dubey
 
PDF
OOPs theory about its concepts and properties.
ssuser1af273
 
Sp 1418794917
lakshmi r
 
Computer Science Sample Paper 2
kvs
 
Computer Science Sample Paper 2015
Poonam Chopra
 
Programming fundamentals using c++ question paper 2014 tutorialsduniya
TutorialsDuniya.com
 
Mid term sem 2 1415 sol
IIUM
 
EEE 3rd year oops cat 3 ans
Karthik Venkatachalam
 
Cs pritical file
Mitul Patel
 
Cbse question paper class_xii_paper_2000
Deepak Singh
 
OOPS (object oriented programming) unit 1
AnamikaDhoundiyal
 
Object Oriented Programming using C++ PCIT102.pdf
GauravKumar295392
 
CBSE XII COMPUTER SCIENCE STUDY MATERIAL BY KVS
Gautham Rajesh
 
c++ referesher 1.pdf
AnkurSingh656748
 
C++ theory
Shyam Khant
 
Ch 4
AMIT JAIN
 
C++ data types
pratikborsadiya
 
cppt-170218053903 (1).pptx
WatchDog13
 
200 mcq c++(Ankit dubey)
Ankit Dubey
 
CPP-overviews notes variable data types notes
SukhpreetSingh519414
 
C++ tutorials
Divyanshu Dubey
 
OOPs theory about its concepts and properties.
ssuser1af273
 
Ad

Recently uploaded (20)

PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 

CBSE Grade12, Computer Science, Sample Question Paper

  • 1. CBSE Grade 12 - Computer Science Sample QuestionPaper Section A 1. a. [2] i) Which language is the predecesor of C++ language? ii) Is C++ a case sensitive language? Justify your answer. 1.b. [1] i) Give an example of a function used to handle characters along with the name of the header file to be included. ii) An float variable f_num holds the value 2.8. Name the function that can be used to store 2 into an integer variable i_num from the variable f_num. Name the required header file to use this function. 1.c. Rewrite the following C++ program after removing all the syntactical errors (if any), underlining each correction. [2] #include <iostrem.h> #define g=9.8; void main() { float mass, force; cout>>"Enter mass"; cin<<mass; force := mass*g; cout>>'Force is'>>force; }; 1.d. Write the output from the following C++ program code: [2] #include <iostream.h> #define MAX 4 char *Family[MAX]={"Father","Mother","Son","Daughter"}; int Age[MAX]; void ComputeAge(int AgeOfDaughter) { Age[MAX-1]=AgeOfDaughter; Age[MAX-2]=AgeOfDaughter+4; Age[MAX-3]=(AgeOfDaughter+6)*2; Age[MAX-MAX]=Age[MAX-3]+5; } void main()
  • 2. { ComputeAge(14); for(int i=0;i<MAX;i++) cout<<"Age of "<<Family[][i]<<" is "<<Age[i]<<" years"; } 1.e Write the output from the following C++ program code: [3] #include <iostream.h> class SamsungSales { int NoOfUnits; float UnitPrice; float ProfitAmount,ProfitPercentage; SamsungSales(float profitpercent) { ProfitPercentage = profitpercent; } void RegisterSales(int units,float price) { NoOfUnits = units; UnitPrice = price; } void ComputeProfit() { ProfitAmount = (NoOfUnits*UnitPrice*ProfitPercentage)/100; } void DisplaySales() { cout<<NoOfUnits<<"->"<<UnitPrice<<"->"<<ProfitAmount<<"n"; } }; void main() { SamsungSales S6(20),S6Edge(30); cout<<"SAMSUNG Salesn"; S6.RegisterSales(100,40000); S6.DisplaySales(); S6Edge.RegisterSales(50,50000); S6Edge.ComputeProfit(); S6Edge.DisplaySales(); S6.ComputeProfit(); S6.DisplaySales(); cout<<"!!! Great going !!!"; }
  • 3. 1.f. Study the following C++ program and select the possible output(s) from it : Find the maximum and minimum value of L. [2] #include <stdlib.h> #include <iostream.h> void main() { char *BowlAnOver[9]={"5 Runs","No Ball","Wide","Dot Ball","1 Run","2 Runs","3 Runs","Boundary","Sixer","Wicket"}; randomize(); long L; for(int i=0;i<6;i++) { L=random(6)+4; cout<<BowlAnOver[][L]<<"-"; } } i) Wicket-No Ball-3 Runs-Boundary-2 Runs-1 Run- ii) Wicket-2 Runs-Sixer-Bounday-1 Run-3 Runs- iii) 2 Runs-Wicket-Boundary-Sixer-1 Run-3 Runs- iv) 2 Runs-1 Run-Sixer-Wide-3 Runs-Boundary- 2. a. [2] i) Differentiate object oriented programing and procedural progrming. ii) List two advantages of object oriented programming. ii) Is C++ a case sensitive language? Justify your answer. 2.b. Answer the questions (i) and (ii) after going through the following C++ class [2] class SuperSinger { public: int SingerID; char SingerName[100]; int Votes; SuperSinger() // Function 1 { SingerID=0; strcpy(SingerName,"");
  • 4. Votes=0; } SuperSinger(int ID, char S[]) // Function 2 { SingerID=ID; strcpy(SingerName,S); Votes=0; } SuperSinger(SuperSinger &S) // Function 3 { SingerID=S.SingerID; strcpy(SingerName,S.SingerName); Votes=S.Votes; } Vote() { Votes++; // Statement 1 } ~SuperSinger() { } // Function 4 }; i) Name the concept of object oriented programing used in Function 1, Function 2 and Function 3 ii) Name the category of construtor Function 3 belongs to. Define this category. iii) When is Function 4 invoked? What is it referred to as in object oriented programming? iv) Name the operator used in Statement 1. In what modes can these operators be used? 2.c. Define a class RetailStore with the following specifications [4] Private members: • apparel_id integer • apparel_name char(30) • cost_price, sales_price float • quantity_on_hand integer Public members: • A default constructor to reset values • GetApparelData() to get input from users for the applicable private members and call ComputeSalesPrice() to determine the SalesPrice • ComputeSalesPrice() to compute SalesPrice based on the conditions below on profit percentage: • 20% if cost_price is greater than 5000
  • 5. • 10% if cost_price is greater than 4000 • 5% if cost_price is greater than 2000 • 3% for all other items • ShowApparelData() to display all private members 2.d. Answer the questions below based on the code below: [4] class customer { int cust_id; char cust_name[50]; char cust_tel[20]; protected: void StoreCustomer(); pubic: customer(); void GetCustomer(); void DispCustomer(); }; class branch { int br_id; char br_name[50]; protected: char br_addr[200]; char br_tel[20]; public: branch(); void GetBranch(); void DispBranch(); }; class telco : private branch, public customer { int telco_id; char telco_name[100]; float turnover; public: telco(); void GetTelco(); void DispTelco();
  • 6. }; i) Write the names of all data members and member functions accessible from an instance of class telco. ii) List the data members accessible from a) GetTelco() b) DispBranch() iii) What type of inheritance is implemented in the above code? Show a diagramatic representation of the inheritance implemented. iv) Declare an instance of telco class called IndiaTel. How many bytes are required to store this object. [3] 3.a. An array T[-1..35][-2..15] is stored in the memory along the row with each element occupying 4 bytes. Find out the base address and address of element T[20][5], if an element T[2][2] is stored at the memory location 3000. Find the total number of elements stored in T and number of bytes allocated to T [3] 3.b. Write a function WorldCup2015() in C++ to sort an array of the following structure in descending order of Points using bubble sort struct WorldCupTeams { char Country[50]; int Points; }; [4] 3.c. Write member functions to PUSH and POP a dynamically allocated stack with objects derived from the following structure: struct CBSEStudents { int Grade; int NoOfStudents; CBSEStudents *next; }; 3.d. [2] Write a function in C++ to print the sum all the numbers divisible by 6 in a 2-dimnsional array which is passed as an argument to the function. 3.e. [2] Evaluate the following postfix expression. Show the status of stack after execution of each operation separately. 4,15,*,60,/,4,4,-,5,*,+ 4.a. Write C++ statements for the following requirements: [1]
  • 7. i) Open binary file "MyData.bin" in append mode with the required declaration ii) Move the file pointer to read the file 10 bytes before the current position 4.b. [2] Write a C++ function to count the number of sentences in the file "MyProjectReport.txt" and display the count. 4.c. [3] Write a C++ function to search customers having invoice amout more than Rs. 1,00,000 from binary file "Customers.dat" and display the details of these customers. Assume the availability of the following class that implements the requirement. class Customers { int cust_id; char cust_name[50]; char cust_addr[200]; float invoice_amount; public: void GetCustomerData() { cin>>cust_id>>cust_name>>cust_addr>>invoice_amount; } void Display() { cout <<"nID:" <<cust_id; cout<<"tName:" <<cust_name; cout<<"tAddr:" <<cust_addr; count<<"tInvoice Amount:" <<invoice_amount<<"n"; } float GetInvoiceAmount() {return invoice_amount;} }; Section B 5.a. [2] i) Define primary key ii) What datatype can be used to store your date of birth? 5. Based on the table below answer the questions in (b) and (c) Table: DEPARTMENTS
  • 8. Dept_No Dept_Name Manager_ID D10 Sales 1234 D20 Finance 1235 D30 Human Resources 1236 D40 Marketing 1237 Table: EMPLOYEES Emp_no Emp_Name Dept_No Grade 1234 Priya D10 100 1100 Renga D10 50 1110 Harini D20 50 1120 Smitha D40 60 1235 Lakshmi D20 100 1130 Anandhi D30 70 1236 Abi D30 100 1140 Muthu D20 50 1237 Suji D40 100 1150 Kamala D40 60 5.b. Write SQLs for the following: [4] i) List the employees sorted by dept_no ii) List the departments in descending order of dept_name iii) Display dept_name, manager_id and the name of the manager iv) List the dept_name and number of employees in each department 5.c. Write the output for the following SQL commands [2] i) SELECT dept_no, COUNT(*) FROM employees GROUP BY dept_no; ii) SELECT COUNT(DISTINCT dept_no) FROM employees;
  • 9. iii) SELECT Grade, COUNT(*) FROM employees GROUP BY Grade; iv) SELECT emp_name, dept_name FROM employees e, departments d WHERE d.dept_no=e.dept_no; 6.a. Name the law shown below and veriy using truth table: [2] X+Y.Z = (X+Y) . (X+Z) 6.b. Draw a logical circuit for the following boolean expression: [2] _ _ F = (A.B) + (C+D) 6.c. Write the Sum of Product form of the function F(U,V,W) for the following truth table representation of F: [1] U V W F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 6.d. Obtain the minimal form for the following Boolean expression using K-map. [3] F(M,N,O,P) = SUM(2, 4, 5, 9, 10, 11, 12) 7.a. [1] i) What is network? ii) List 2 reasons to have network
  • 10. 7.b. What is mobile computing? [1] 7.c. Expand the following: [1] i) CDMA ii) DHTML 7.d. Differentiate client side scripting and server side scripting [1] 7.e. BlueSoft company has the following details: [4] • Distance between Development Block & Research block is 100m • Distance between Development Block & Admin block is 20 m • Distance between Research block & Admin block is 40 m • 20 computers are required in Development block • 100 computers are required in Admin block • 80 computers are required in Research block i) In which block should the server be installed? ii) Design the cabl layout & represent the same diagramatically such that effective communication would occur iii) Recommend the bst possible connection from the list below from this company in Delhi to their client in London: • Satellite link • Infrared • Ethernet cable iv) Which of the following device(s) is best recommended to connect the computers in the Delhi office? • Switch • Modem • Gateway 7.f. Differntiate freeware and shareware [1] 7.g. What is virus? List 2 types of viruses [1]