Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

MEK3170

C Programming
CAT-2
28-04-2014
Answer all questions.
Q1). State whether the following statements are TRUE or FALSE on the box gien in front of
the statements. !"# $ar%s)
1. A &ointer 'an be use( to 'all fun'tions
". A 'onstru'tor has the same name as the 'lass.
). *ariables (e'lare( outsi(e the bo(+ of an+ fun'tion is 'onsi(ere( a
lo'al ariable.
,. -onstru'tors 'an hae (efault arguments.
.. Uninitiali/e( global ariables are automati'all+ initiali/e( to /ero.
0. A (erie( 'lass must be alwa+s (e'lare( before it is use(.
1. 2rote'te( (ata members are a''essible from with in the metho(s
of the same 'lass but not from the members of their (erie( 'lasses.
3. All the (ata 4 metho(s are &ubli' b+ (efault.
5. 6t is &ossible to store an( a''ess elements of an arra+ using
&ointers.
1#. -onstru'tors shoul( alwa+s hae a return (ata t+&e an( shoul(
return alues.
Q"). 7rite one 'om&lete -88 &rogram in'lu(ing hea(er files using &ointers to a''e&t fie
integer alues from the %e+boar(. The fie alues shoul( be store( in an arra+ using a
&ointer. 9ou are su&&ose( to use &ointers an( loo&s to (is&la+ the alues of the arra+
elements.
Q)). :Queens *ehi'les; is a 'ar hire 'om&an+ whi'h hires -ars an( *ans to its 'ustomers.
The hire fees for the ehi'les are 'al'ulate( as follows.
For a -ar < =ire Fee > !?o. of hours@Fee &er hour) 8 Extra 'harge
For a *an < =ire Fee > !?o. of hours@Fee &er hourA") 8 Extra 'harge
The fee &er hour for an+ ehi'le is Rs. 3##.## an( extra 'harge for a 'ar is Rs. 1.##.##
an( the extra 'harge for a an is Rs. "###.##
7rite a 'om&lete -88 &rogram using the obBe't oriente( 'on'e&ts to 'al'ulate the hire
fee for the ) ehi'les issue( to ) 'ustomers. Cetails are gien below.
*ehi'le ?umber Dran( ?ame *ehi'le T+&e ?o. of hours
"#"#"# $er'e(esEDen/ -ar .
,#,#,# To+ota *an 5
0#0#0# Su/u%i -ar )
All 4 One & One 4 All FET/MRC/2012Batch

You might also like