You are on page 1of 2

Programming Concepts

1. What is a copy constructor a. It is possible to copy the constructor b. It means that the constructor is already copied c. When executes copies the entire object d. All of the above 2. o! do you decide !hich integer type to use a. integer type is al!ays int b. "he compiler decides it for you c. It does not matter !hich one you use d. #one of the above o! do you chec% !hether a lin% list is circular a. Create another similar lin% list b. "raverse through it and compare values c. It is not possible to find if it is circular d. #one of the above

$.

&. What is the difference bet!een private and protected a. All are the same and can be used in functions b. private can be used !hen calling functions in t!o files c. private is scoped !ithin the class and protected !ithin inherited classes d. #one of the above '. What is a namespace a. Any variable name can be a name space b. A logically defined module that can contain classes c. Any set of classes having similar names d. All of the above (. What is the difference bet!een declaration and definition a. declaration means specifying types) definition means allocating values b. declaration means allocating values) definition means specifying types c. both are the same d. none of the above *. What does it mean by declaring a function or variable static a. "he value of the function or variable does not change b. +nly one instance of the function or variable is present c. ,oth are same d. #one of the above

,. -imple Programming -%ills


1. .iven an employees table !ith the columns /mpI0) 1irst#ame) 2astname) ire0ate) and "ermination0ate3 Write a 4uery to return all employees still !or%ing for the company

!ith last names starting !ith 5-mith5 sorted by last name then first name. 2. 6ou are given a string) !rite a function to reverse that string. 1or example if you are given -"7I#. the ans!er !ill be .#I7"-. 6ou can use any language you %no!. $. Write a simple program to thro! an exception on division by 8 and then catch the exception and !rite an error message at the output 9no need to !rite the complete program) just program snippet !ill be o%ay.: &. What !ill be the output of the follo!ing pseudo code. #ote that the print statement is executed three times so there !ill be three output lines i ; '< print ==i< print i==< print i = 1<

C. -imple 2ogic
1. A bus run at 188 %m>hr top speed. It can carry a maximum of ( persons. If speed of bus decreases in fixed proportion !ith increase in number of person) find speed !hen three person are traveling in bus? 2. "he price of a product is reduced by $8@ . ,y !hat percentage should it be increased to ma%e it 188@? $. "he poor have it) the rich !ant it) but if you eat it you !ill die. What is this? &. A school has $8@ students from Aaharashtra .+ut of these 28@ are ,ombay students. 1ind the total percentage of ,ombay? '. if 1;' 2;2' $;$2' &;&$2' ';? (. If A>, ; $>')then 1'A ; ? *. Which of these numbers doesnBt seem to fit3 $) ') *) C) 11) 1$

You might also like