0% found this document useful (0 votes)
65 views8 pages

Answer Marks Allotment Definition: Inline Function Are Small Function That Are Not Actually Called, Example

Download as doc, pdf, or txt
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 8

MARKING SCHEME

PRE BOARD EXAMINATION: 2014-15


Class XII (Computer Science)
Subject Code - 083

Marks
Question Answer
Allotment
Definition: inline function are small function that are not actually called,
rather than their code is expanded at the point of function call. the member
function of class, defined with in the class definition is inline by default
Example:
class square
{
int a;
public: 1
1 a) void print() 1
{
cout<<a*a;
}
};
Here print() is an inline function

i) gets and put- <stdio.h>iostream.h


½
b) ii)strcat- <string.h>
½
Corrected code:
#include<iostream.h>
void main( )
{
int b,s=0;
cin>>n;
for(b=1;b<100; b+=2) ½
c) if(b%2==0) 1x½
s+=b;
cout<<"s="<<s;
}

Error identification
Error correction
Correct output: 1x½
d) hat@*PVUQVU* 1x½

e) Correct output: 2
Option (iii) 10 Excellent$9Good$10Excellent$
Option (i)10 Excellent$ 10Excellent$80k$

1
Correct output:
20BHAKTI 1
f)
25HAKTI 1

definition 1
2 a)
Example 1
I)Function1=constructor
Function 2= destructor 1
b)
ii)function1 get executed when the object of class is created and fuction2 1
executed when the object of the class is destroyed
c) Soln:
class LED
{
int Model_No;
char Manufacture[25];
int price,sold;
double sale_amount;
double calAmt();
public:
void read();
void show();
};
double LED::CalAmt()
{
double Tot;'tot=sold*price;
return(tot);
}
void LED::read()
{
cout<<enter Model No";
cin>>Model_no;
cout<<"Enter the Name of Manufacturere";
cets(Manufacturer);
cout<<Enter Cost";
cin>>price;
cout<<"Enter no of LED Sold";
cin>>sold;
sal_amount=CalAmt();
}
void LED::Show()
{

cout<<"ModeelNo:"<<Model_No<<endl;
cout<<"Manufacturer Name"<<Manufacturer<<endl;
cout<<"Cost"<<price<<endl;
cout<<"No of LED Sold"<<sold<<endl;
cout<<"Total sale amount;"<<sale_amt;
}

2
class dfination
1
Cal_amout()
1
Read()
1
Show()
1
Ans:
I) Medicine Object - 40 Bytes
Pain Reliever . 118 Bytes
II) Medicine::enterMedicinedetails()
Medicine::void showMedicinedetails()
Tablet::entertabletdetails()
Tablet::showtabletdetails()
PainReliever::enterdetails()
PainReliever::showdetails() 1
III) Data Members: 1
d)
Tablet::tablet_name[30]; 1
Tablet::volume_lable[20]; 1
Tablet::Price;
Member Functions:
Medicine::enterMedicinedetails()
Medicine::showMedicinedetails()
Tablet::entertabletdetails()
Tablet::showtabletdetails()
IV) Data Members: Tablet::Price

Soln:
void ArrCHANGE( int A[ ] int N)
{
for( int i=0;i<N; i++)
{
if (A[i] %5==0)
A[i]=A[i]/5
3a) else
A[i]=A[i]*3;
}
}
½
Declaration of function
½
Use of loop
2
Logic & body
b) Soln 1
R=100, C=50, w=2 B=? A[20][40]=? A[10][30]=3000 2
IR,IC=0
A[i][j]=B+W[(C(i-ir)+(j-ic)
3000=B+2[(50(10-0)+(30-0)
3000=B+2[500+30]
3000=B+1060
B=1940
A[i][j]=a[20][40]
A[i][j]=B+W[(C(i-ir)+(j-ic)

3
=1940+2[(50(20-0)+(40-0)]
=1940+2[1000+40]
= 1940+2(1040)
=1940+2080
=4020

Base Address B=1940


A[20][40]=4020

Correct code:
struct node
{
int data;
node *link;
};
node *Insert(node *rear, int n)
{
Node *temp;
c) temp=new node;
temp-> data=n;
temp->link=NULL;
rear-> link=temp;
rear=temp;
return(rear);
}
Declaration of structure 1
Function declaration 1
Logic and body 2

d) Correct Ans: True


2
½ mark for each evolution of operator

Sol:
float diasum(float A[ ][ ],int R,int C)
{ int i,j;
float Dsum=0.0;
for(i=0;i<R;i++)
e) for(j=0;j<C;j++)
if((i= = j)| | (i+j)= =(size-1))
Dsum=Dsum+A[i][j];
return Dsum;
}
½
Function declaration

Logic and body
Line1File.seekg()-1*sizeof(c),ios::cur);
½
4a) Line2:file.write((char*)&c,sizeof(c);
½
b) Soln:
void UpperLetters( )

4
{
clrscr( );
ifstream fin("PARA.TXT",ios::in);
char ch;
int uppercount=0;
while(fin)
{ fin.get(ch);
if(isupper(ch))
uppercount++;
}
cout<<"\nTotal number of Uppercase alphabets in
the file = "<<uppercount;
getch( );
}
Function definition ½
½
Opening the file 1
Logic and body

Soln :
void Update( )
{ fstream finout(“PRODUCT.DAT”,ios::in|ios::out);
PRODUCT P;
finout.seekg(0);
while(finout)
{ finout.read((char *)&P, sizeof(P));
cout<<”\nThe Product Code is
“<<P.Product_Code;
cout<<”\nThe Product Description is
c) “<<P.Product_Description;
cout<<”\nEnter the Stock: “;
cin>>P.Stock;
finout.seekp(finout.seekp( )-sizeof(P));
finout.write((char *)&P,sizeof(P));
}
}

Function declaration ½
File input& output file stream format 1
Logic and body 1½


Definition and explanation Full form DDL&DML
5 a) ½
Example
b) i) SELECT FIRSTNAME,LASTNAME,ADDRESS, CITY, FROM 1
EMPLOYEES WHERE CITY=’Paris’; 1
ii) SELECT * FROM EMPLOYEES ORDER BY FIRSTNAME DESC; 1
iii) SELECT FIRSTNAME,LASTNAME,,SALARY+BENEFITS
FROM EMPLOYEES,EMPSALARY WHERE
DESIGNATION=’Manager’ AND 1

5
EMPLOYEES.EMPID=EMPSALARY.EMPID;
iv) SELECT MAX(SALARY) FROM EMPSALARY WHERE
DESIGINATION=’Manager OR DESIGNATION=’Clerk’;
v) The output is:
FIRSTNAME SALARY
Rachel 32000
PETER 28000
vi) The output is: 1
COUNT(DISTINCIT DESIGNATION) 1
4
vii) The output is:
DESIGNATION SUM(SALARY)
Manager 215000
Clerk 135000
viii) There is no output. There is an error, i.e the BENEFITS
column is not in EMPLOYEES table
2
6 a) Correct Truth Table and varified

x
XY'Z
xX Y

b) Y XY'Z+Z' 2
Z Z'Y

Ans:
A.B’.C+A’.B.C+A’.B.C’
101+011+010
M5+M3+M2 1/2
c)
=∑(2,3,5) 1/2
POS=п(0,1,4,6.7.)
=(M0,M1,M4,M6,M7)
=(A+B+C).(A+B+C’)+(A’+B+C).(A’+B’+C).(A’+B’+C’)
d) Ans:
1 1

ab 1 1
cd 00 01 11 10

11
01
00 1 1 1

6
Quard -1,Pair-2
F=b'd'+bc'd+abc

k-Map Drawn
Groups making
Solution

1
1
1
Correct difference: ½
7 a) Two difference each ½

Correct two difference each


b)
1
1
c) Correct answer

Correct :
d) Two advantage of each 1

i)Bus Topology:
1
Centre B Centre C

Centre A Centre D
e)
ii) Centre C:it has maximum no of computer . it will save the cabling cost
and most of the traffic will be local as per 80:20 rule 1
iii) a) Each of center requires a hub to connect several computers in the
centre
b) as per layout each center need to install separate repeaters as each
centre will have hub installed that acts like a repeater 1
iv) optical fiber 1
Linux –operating system
f) Open office-office suite. 1

g) Cyber law encompasses a wide variety of political and legal issue related to
the internet and other communication Technologies, including intellectual 1
property privacy , freedom of expression and jurisdiction

7
8

You might also like