You are here: Home > Board Exams
All posts from

afgji.org : CBSE Class XII Computer Science Question Paper Sample Air Force Golden Jubilee Institute

Board : Air Force Golden Jubilee Institute
Exam : CBSE Class XII Computer Science
Document type : Sample Question Paper
Website : afgji.org

Download Sample/ Model Question Papers :https://www.pdfquestion.in/uploads/6122-ComputerScience.pdf

AFGJI Computer Science Question Paper

(Subject Code 083) SAMPLE PAPER 2014 – 15
Time allowed : 3 hours
Maximum Marks: 70

Related : Air Force Golden Jubilee Institute CBSE Class XII Political Science Question Paper : www.pdfquestion.in/6119.html

Instructions :
(i) All questions are compulsory.
(ii) Programming Language : Section A C+ +.
(iii) Programming Language : Section B Python.
(iv) Answer either Section A or B, and Section C is compulsory.

Section A (C++)
Q1. a. Differentiate between ordinary function and member functions in C++. Explain with an example. [2]
b. Write the related library function name based upon the given information in C++.

(i) Get single character using keyboard. This function is available in stdio.h file.
(ii) To check whether given character is alpha numeric character or not. This function is available in ctype.h file. [1]

c. Rewrite the following C++ program after removing all the syntactical errors (if any), underlining each correction. : [2]
include<iostream.h>
#define PI=3.14
void main( )
{ float r;a;
cout<<’enter any radius’;
cin>>r;
a=PI*pow(r,2);
cout<<”Area=”<<a
}

d. Write the output from the following C++ program code : [2]
#include<iostream.h>
#include<ctype.h>
void strcon(char s[])
{
for(int i=0,l=0;s[i]!=’\0′;i++,l++);
for(int j=0; j<l; j++)
{
if (isupper(s[j]))
s[j]=tolower(s[j])+2;
else if ( islower(s[j]))
s[j]=toupper(s[j])-2;
else
s[j]=’@’;
}
}

void main()
{
char *c=”Romeo Joliet”;
strcon(c);
cout<<“Text= “<<c<<endl;
c=c+3;
cout<<“New Text= “<<c<<endl;
c=c+5-2;
cout<<“last Text= “<<c
}

e. Find the output of the following C++ program : [3]
#include<iostream.h>
#include<conio.h>
#include<ctype.h>
class Class
{
int Cno,total;
char section;
public:
Class(int no=1)
{
Cno=no;
section=’A’;
total=30;
}

void addmission(int c=20)
{
section++;
total+=c;
}

void ClassShow()
{
cout<<Cno<<“:”<<section<<“:”<<total<<endl;
}
} ;

void main()
{
Class C1(5),C2;
C1.addmission(25);
C1.ClassShow();
C2.addmission();
C1.addmission(30);
C2.ClassShow();
C1.ClassShow();
}

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>
#include<string.h>
void main()
{
randomize();
char P[]=”C++PROGRAM”;
long L;
for(int I=0;P[I]!=’R’;I++)
{
L=random (sizeof(L)) +5;
cout<<P[L]<<“-“;
}
}
}
i) R-P-O-R-
ii) P-O-R-+-
iii) O-R-A-G-
iv) A-G-R-M-

Q2.a. How encapsulation and abstraction are implemented in C++ language? Explain with an example. [2]
b. Answer the questions (i) and (ii) after going through the following C++ class: [2]
class Stream
{
int StreamCode ; char Streamname[20];float fees;
public:
Stream( ) //Function 1
{
StreamCode=1; strcpy (Streamname,”DELHI”); fees=1000;
}

void display(float C) //Function 2
{
cout<<StreamCode<<“:”<<Streamname<<“:”<<fees<<endl;
}
~Stream( ) //Function 3
{
cout<<“End of Stream Object”<<endl;
}
Stream (int SC,char S[ ],float F) ; //Function 4
};

i) In Object Oriented Programming, what are Function 1 and Function 4 combined together referred as? Write the definition of function 4.
ii) What is the difference between the following statements?
Stream S(11,”Science”,8700);
Stream S=Stream(11,”Science”,8700);

c. Define a class Customer with the following specifications. [4]
Private Members :
Customer_no integer
Customer_name char (20)
Qty integer
Price, TotalPrice, Discount, Netprice float
Member Functions:

Public members :
* A constructer to assign initial values of Customer_no as 111,Customer_name as “Leena”, Quantity as 0 and Price, Discount and Netprice as 0.
*Input( ) – to read data members(Customer_no, Customer_name, Quantity and Price) call Caldiscount().

* Caldiscount ( ) – To calculate Discount according to TotalPrice and NetPrice
TotalPrice = Price*Qty
TotalPrice >=50000 – Discount 25% of TotalPrice
TotalPrice >=25000 and TotalPrice <50000 – Discount 15% of TotalPrice
TotalPrice <250000 – Discount 10% of TotalPrice
Netprice= TotalPrice-Discount
*Show( ) – to display Customer details.

d. Answer the questions (i) to (iv) based on the following code: [4]
class AC
{
char Model[10];
char Date_of_purchase[10];
char Company[20];
public( );
AC( );
void entercardetail( );
void showcardetail( );
};

class Accessories : protected AC
{
protected:
char Stabilizer[30];
char AC_cover[20];
public:
float Price;
Accessories( );
void enteraccessoriesdetails( );
void showaccessoriesdetails( );
};

class Dealer : public Accessories
{
int No_of_dealers;
char dealers_name[20];
int No_of_products;
public:
Dealer( );
void enterdetails( );
void showdetails( );
};

(i) How many bytes will be required by an object of class Dealer and class Accessories?
(ii) Which type of inheritance is illustrated in the above c++ code? Write the base class and derived class name of class Accessories.

(ii) Write names of all the members which are accessible from the objects of class Dealer.
(iv) Write names of all the members accessible from member functions of class Dealer.

Q3a) 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]

b. Write a function SORTSCORE() in C++ to sort an array of structure IPL in descending order of score using selection sort . [3]
Note : Assume the following definition of structure IPL.
struct IPL
{
int Score;
char Teamname[20];
};

2 Comments
Add a Comment
  1. Name the function / method required for
    i) Finding second occurrence of m in madam.

  2. Please show the solutions

Leave a Reply

How to add comment : 1) Type your comment below. 2) Type your name. 3) Post comment.

www.pdfquestion.in © 2021

Contact Us   Privacy Policy   SiteMap