Wednesday, July 18, 2012

ENG301 - FINAL TERM PAPER - 17 July 2012



Contributor: http://www.webmasterbus.com | Webmaster Forum.
More at: http://taimoorsultan.com/ http://taimoorsultan.com/ http://taimoorsultan.com/
ENG301 - FINAL TERM PAPER - ATTENDED ON 17-07-2012

40 Mcqs
2 x 4
3 x 4
5 x 4
In persuasive requests, write the names of appeals that we use to get the attention of the reader. (2 marks)
What points should be taken into account by the presenter about his voice quality during an oral presentation. (2 marks)
What do you understand by MLA and APA formats. (2 marks)
What is an informal report. (2 marks)
Why do we write functional resume. (3 marks)
What is verbal sparring? Explain with the help of examples. (3 marks)
What is the format for  headings  in MLA style. (3 marks)
What are resolution minutes? Explain with the help of an example (3 marks)
How far do you agree that internal communication in an organization is important to function properly. (5 marks)
How can you build interest and intensify desire of your reader in your application letter (5 marks)
Tuesday, July 17, 2012

ENG201 Final Term Current Paper July Spring 2012

total 52 question among them 40 mcqs,

remaining contain question of 2 marks , 3 marks and 5 marks

what is consideration, apostrophe,  name three kind of job interview, what is meant by intenetend readers, what is memorandum and its internal usage,

how can u write buz msg efectivly, what is reinforsment phase?

these are some question which is of 3 , 2 and  5 marks

ENG201 today final term 16 july 2012
mcqs from old papers

long questions ralated to resume. research.
and some are
make a note on email.
what is open ended interview.
phycsical entrance makes a good effect in an interview. discuss
electronic media advantages in business communication

Eglish current paper

character sticks  of inter view

BAr GRaph, PICTO graph

Accuracy

correction

Letter of Recommendation

visual aids

all question have 5 ,3 or 2 mrks

ENG301 Current Final Term Paper July Spring 2012

My Eng-101:

1) Five types of determiners

2) Write six main types of  tenses.

3) Usage of definite and indefinite articles.

4) Replace the cliches.

5) Have you ever  involved in any serious wrongdoing. What lesson you have experienced? write a  paragraph (100-130 words)

6) Identify the main idea, errors etc

7) Define the Cyclic and chronological way of organizing text.

CS302 Final Term July Spring 2012 Current Paper

CS302 16 July 2012 Current Paper

Mcques were mostly new some belongs to past paper.

FIFO memory Implementation            (5 Marks)

Some binary values or number that were for converting into the Hexa decimal number                                              (5 Marks)

2 Application of ROM              (5 or 3 Marks )

Name of memory operstions               (2 Marks)
 In the highest frequency component in an analog signal is 20 KHz, what is the minimum sample frequency                                                     (2 Marks)

today paper (total 40 mcq's and 4 2marks Ques 4 3marks ques and 4 5marks ques)

Question No: 1 ( Marks: 1 ) - Please choose one A 8-bit serial in / parallel out shift register contains the value “8”, _____ clock signal(s) will be required to shift the value completely out of the register.

► 1

► 2

► 4

► 8 (Page 356)

Question No: 2 ( Marks: 1 ) - Please choose one

The divide-by-60 counter in digital clock is implemented by using two cascading counters:

► Mod-6, Mod-10 (Page 299)

► Mod-50, Mod-10

► Mod-10, Mod-50

► Mod-50, Mod-6

The minimum time for which the input signal has to be maintained at the input of flip-flop is called ______ of the flip-flop.

► Set-up time

► Hold time (Page 242)

► Pulse Interval time

► Pulse Stability time (PST)

Question No: 4( Marks: 1 ) - Please choose one

A Nibble consists of _____ bits

► 2

► 4 (Page 394)

► 8

► 16

Question No: 5 ( Marks: 1 ) - Please choose one

The output of this circuit is always ________.

► 1

► 0

► A

The total amount of memory that is supported by any digital system depends upon ______

► The organization of memory

► The structure of memory

► The size of decoding unit

► The size of the address bus of the microprocessor (Page 430)

________ is used to simplify the circuit that determines the next state.

► State diagram

► Next state table

► State reduction

► State assignment (Page 335)

A multiplexer with a register circuit converts _________

► Serial data to parallel

► Parallel data to serial (Page 356) rep

► Serial data to serial

► Parallel data to parallel

A positive edge-triggered flip-flop changes its state when ________________

► Low-to-high transition of clock (Page 228)

► High-to-low transition of clock

► Enable input (EN) is set

► Preset input (PRE) is set

Flip flops are also called _____________

► Bi-stable dualvibrators

► Bi-stable transformer

► Bi-stable multivibrators (Page 228)

► Bi-stable singlevibrators

DRAM stands for __________

► Dynamic RAM (Page 407)

► Data RAM

► Demoduler RAM

► None of given options

________ is used to minimize the possible no. of states of a circuit.

► State assignment (Page 341)

► State reduction

► Next state table

► State diagram

________ is used to simplify the circuit that determines the next state.

► State diagram

► Next state table

► State reduction

► State assignment (Page 335)

FIFO is an acronym for __________

► First In, First Out (Page 424)

► Fly in, Fly Out

► Fast in, Fast Out

► None of given options

______ of a D/A converter is determined by comparing the actual output of a D/A converter with the expected output.

► Resolution

► Accuracy (Page 460) rep

► Quantization

► Missing Code

and many more from old paper



Subjective

3. Differentiate between Moore machine and Mealy machine. (Marks 2)

Answer:- Page 318

The Sequential circuit whose output depends on the current state and the input is known as Mealy Machine. Sequential circuit whose output is determined by the current state only is known as Moore Machine.

Q No. 6 How can calculate the frequency of an unknown signal?

Name three Operations that can be performed on FLASH Memory

2. Explain Rotate Right Operation of shift register with the help of Diagram. (Marks 3)

Question No: ( Marks: 5 )

Explain Memory Select or Enable Signals

Explain application of demultiplexer

3: Explain the next-state table with the help of a table for any sequential circuit?

CS301 Final Term Paper July Spring 2012 Current Paper

My today paper of cs301

Total 52 questions

4o mcqs

4 questions of 2 marks

4 questions of 3 marks

4 questions of 5 marks

Almost all Mcqs from the file final term solved mcqs with reference by mooaz

Subjective questions:

Questions of 2 marks
In the array representation of union what represents  -1?
For smaller lists, linear insertion sort performs well, but for larger lists, quick sort is suitable to apply." Justify why?from mooaz file
If we want to delete the node from BST which has left and right child then which rotation is applied ?
Collision in hashing definition?

Question of 3 marks:
Algorithm union by weight?
One tree is given question is it heap or not if it is heap then write its type
Which data structure is best for priority queue?



Questions of 5 marks:
Some numbers are given and using those make BST?
One array is given we require to sort it using bubble sort and write only 2 iterations?
One tree is given which not the heap but after minimum changes it becomes max heap make it?
Make tree your are required to show only the final tree

Union(4,1) es trah se dia hua thay

CS101 Final Term July Spring 2012 Current Paper


Cs101 today current papers 16 july 2012

Paper CS101
16 July 2012 (Timing 8:AM to 10:AM)
Time Allowed 120 Minutes

Total Marks 80
40 MCQ's 1 Mark each = 40
4 Questions X 2 Marks each = 8
4 Questions X 3 Marks each = 12
4 Questions X 5 Marks each = 20
NOTE: Almost 20-30 MCQs from Past papers.


One More...

40 Mcqs question thy
4 question of 2
4 question of 3
4 question of 5
Total marks 80
time 2 hours
1.flow chart define and what is conditional and structre loop..5
2.define comprihensive defination of animation and what is tweening process..5
3.define database and what is working...
4.e-mail service define alternate backdraws...

One More..

Trojan horses k bary me aik question tha,
lecture 31 (presentation development) imp,developer report to....,
describe four internet services
,is the function of URL and BROWSER is same,discuss in detail?
describe difference b/w RAM and ROM ,ERREOR in RDBS.
MCQ WAS,
Network predigm, binary ,testing and heauristic related mcq.

One More ..

40 Mcqs question thy
4 question of 2
4 question of 3
4 question of 5
Total marks 80
time 2 hours
1.flow chart define and what is conditional and structre loop..5
2.define comprihensive defination of animation and what is tweening process..5
3.define database and what is working...
4.e-mail service define alternate backdraws...

40 Mcqs question thy
4 question of 2
4 question of 3
4 question of 5
Total marks 80
time 2 hours
1.flow chart define and what is conditional and structre loop..5
2.define comprihensive defination of animation and what is tweening process..5
3.define database and what is working...
4.e-mail service define alternate backdraws...
----------------------------
rojan horses k bary me aik question tha,
lecture 31 (presentation development) imp,developer report to....,
describe four internet services
,is the function of URL and BROWSER is same,discuss in detail?
describe difference b/w RAM and ROM ,ERREOR in RDBS.
MCQ WAS,
Network predigm, binary ,testing and heauristic related mcq.
---------------------------------------


Trojan horses k bary me aik question tha,
lecture 31 (presentation development) imp,developer report to....,
describe four internet services
,is the function of URL and BROWSER is same,discuss in detail?
describe difference b/w RAM and ROM ,ERREOR in RDBS.
MCQ WAS,
Network predigm, binary ,testing and heauristic related mcq.

CS201 Final Term MCQs July 2012 Current Paper


MCqs mostly past papers main se aye thay jin main se kuch yay hain

Friend function of a class is ______________.
Member function
Non-member function
Private function
Public function

A template function must have at least ---------- generic data type
Zero
One
Two
Three

The object _______________may be used both for file input and file output
fstream,
ifstream,
ofstream,
none of the given options

What should be the return type of the constructor?
void pointer
int
same as object type
constructors do not return any thing

Classes defined inside other classes are called ________ classes.
Looped
Nested
Overloaded
none of the given options.

new operator is used to allocate memory from the free store during
Compile Time
Run Time
Link Time
None of the given options

Which kind of functions can access private member variables of a class?
Friend functions of the class
Private member functions of the class
Public member functions of the class
Friend, private and public functions

The normal source of cin object is
File
Disk
Keyboard
RAM

Which value is returned by the destructor of a class?
A pointer to the class.
An object of the class.
A status code determining whether the class was destructed correctl
Destructors do not return a value.

 C is widely known as development language of _______ operating system.
Linux
Windows
Unix
Mac OS

Like member functions, ______ can also access the private data members of a class.
Non-member functions
Friend functions
Any function outside class
None of the given options
The stream insertion and stream extraction operators are already overloaded for ______.
User-defined data types
Built-in data types
User-defined and built-in data types
None of the given options

The appropriate data type to store the number of rows and colums of the matrix is____________.
Float
Int
Char
none of the given options.

A Matrix can be composed of ints, floats or doubles as their elements. Best way is to handle this ,

_______________.
Write a separate class to handle each
Use templates
Use strings to store all types
None of the given options

cout setfill(‘0’) setw(7) 128 ;
0000128
0128128
1280000
0012800

Which of the following is the correct way to declare a variable x of integer type?
x int ;
integer x ;
int x;
x integer

Q.1: Using setw and setfill manipulators to display Virtual--------University.

Q.2: Write a program to display:

          If you age is less than or equal to 18 then display "you are child"

          if your age is above 18 or less than 35 then display "you are adult"

          if your age is is above 60 then display "you are senior citizen"

CS201 Programming Final Term Paper July 2012

My paper  16-07-2012.

Short questions 50% new thay.

Long questions men say jo mjhay yad hen wo yeh thay:



Ik while loop dia tha us ko for loop men change krna tha?

 Program likhna tha jis men “Welcome to Virtual University”  input krna tha phir is ki output is trah show krni thi

WELCOM

TO

VIRTUAL

UNIVERSITY

Yani k in letters ko upper case men convert bhi krna tha aur space ki jaga endl dal kr letters ko ilehda bhi krna tha.

\

Ik matrix 3x4 bnana tha us min 12345678 yeh integer show krnay thy

Out put yeh deni thi      1   2   3   4

                                            5    6   7   8

Keybord say input leni thi as a array.



Q4: What is the output of following code snippet.  (2)

 // class templates
 #include <iostream>
 using namespace std;

 template <class T>
 class mypair {
 T a, b;
 public:
 mypair (T first, T second)
 {a=first; b=second;}
 T getmax ();
 };

 template <class T>
 T mypair<T>::getmax ()
 {
 T retval;
 retval = a>b? a : b;
 return retval;
 }
 int main () {
 mypair <int> myobject (100, 75);
 cout myobject.getmax();
 system("pause");
 }



Question No: 33 ( Marks: 3 )

What happens when we use new and delete operator?

Answer:

When we use new operator to create objects the memory space is allocated for the object and then its constructor

is called. Similarly, when we use delete operator with our objects, the destructor is called for the object before

deallocating the storage to the object.

Question No: 16      ( Marks: 1 ) - Please choose one





Which of the following function call is correct for the function prototype?

defaultParameters ( int a, int b = 7, char z = ‘*’ );





       ► defaultParameters (5);





       ► defaultParameters (5, ‘8’);





       ► defaultParameters (6, ‘#’);





       ► defaultParameters (0, 0, ‘*’, 0);

Question No: 17      ( Marks: 1 ) - Please choose one



When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are.





       ► Zero



       ► One



       ► Two



       ► N arguments

Question No: 23      ( Marks: 1 ) - Please choose one





NULL value has been defined in ______ and _________ header files.





       ► strings.h and iostream.h





       ► ctype.h and conio.c





       ► conio.c and conio.h





       ► stdlib.h and stddef.h









Q. Suppose a program has a math class having only one data member number.

Write the declaration and definition of operator function to overload + operator for the statements of main function.

         math obj1, obj2;

         obj2= 10 + obj1  ; 

Ans:

#include <iostream.h>

math

{

mth operator + (obj1,obj2)

mth operator + (obj1,obj2)

{

 mth operator + (obj1,obj2)

mth operator + (obj1,obj2)



}

}

CS201 Subjective Questions Final Term Spring 2012


Questions

1. Find the error in following syntax,

while(i<=100)

sum+=i*i;



2. General syntax of declaring and initializing the data members.

3. class String

{

char buf [25];

};

Write code for assignment (=) operator function which assign one String object to other object. Your code should also avoid self assignment.



4. Write a simple program, which will get a stream of character and output the stream of characters using cin and cout.

CS201 Current Final Term Paper Spring 2012

CS201

                       Intrtoduction to Programming



Q.1. Let we have a class,

class String

{

char buf [25];

};

Write code for assignment (=) operator function which assign one String object to other object. Your code should also avoid self assignment.



Q2. Write a program which uses setflag function of cout to display hexadecimal and octal representation of number.

Q3: Write a program that defines a Template function named Square () which finds the square of a number and then return it. Define one variable of type int in main function and then call Square function on that.

 Program output should look like this:

 Enter an integer value to find its Square: 6
 Square of integer number is: 36

Q4: What is the output of following code snippet.  (2)

 // class templates
 #include <iostream>
 using namespace std;

 template <class T>
 class mypair {
 T a, b;
 public:
 mypair (T first, T second)
 {a=first; b=second;}
 T getmax ();
 };

 template <class T>
 T mypair<T>::getmax ()
 {
 T retval;
 retval = a>b? a : b;
 return retval;
 }
 int main () {
 mypair <int> myobject (100, 75);
 cout myobject.getmax();
 system("pause");
 }

Q5. Write output pf the given code   (2)

a=10 b=5 c=0

a+(2*5)+c/2



Q6.Can we call new operator inside constructor function?

Q7. We comment our program liberally. How comment help us? Also tell is they affect the performance.

Q8. what is the source and destination of cin stream?

Q9 and Q10:

 2 question thay jin mai code diya hua tha aur us ka output daina tha. Aik template wala tha aur dusara string wala.



MCQ’s zayada tar past papers mai se thay…

                                                                 Remember me in ur prayers

GOOD LUCK

CS201 FINAL TERM PAPER DATE: 16-JULY-2012



CS201 FINAL TERM PAPER

 DATE: 16-JULY-2012          TIMING : 11 AM TO 1 PM



Classes defined inside other classes are called ________ classes

       ► looped

       ► nested

       ► overloaded

       ► none of the given options.

When the compiler overloads the assignment (=) operator by default then __________

       ► compiler does member wise assignment.

       ► compiler does not allow default overload of assignment (=) operator

       ► member of the class are not assigned properly

       ► None of the given options

YA QUESTION ESKSI AUR TARHAN POCHA THA JS KA JAWAB THA MEMBER WISE ASSIGNMENT

  MCQ/Q:         Copy constructor       KY BOHAT QUESTION THAY ES KI CONCEPT CLEAR   HONY CHAIN

  MCQ:           stream insertion and stream extraction operators







   MCQ:           Unary and binary operators

    Q: 2/ 3 number ka tha            

     How many bytes will the pointer iPtr of type hexadecimal aur sath mai value dee hoi thee

        (x—ff51) and jump to the next position and what is the address  iPtr += 4 ;



   Which programming tool is helpful in tracing the logical errors?

            Debugger

A template function must have at least ---------- generic data type

        ► Zero

        ► One

        ► Two

        ► Three


Dynamic memory allocation ky ab kuch question thay MCQ b aur 2 number ki b


Constructor enclose the other constructor and tells the how’s destructor call


For non-member operator function, object on left side of the operator may be

        ► Object of operator class

        ► Object of different class

        ► Built-in data type

        ► All of the given options



           The operator function will be implemented as _____, if obj1 drive the - operator whereas obj2 is

             passed as arguments to - operator in the statement given below.

              obj3   =   obj1 -   obj2;

      ► Member function

      ► Non-member function

       ► Friend function

       ► None of the given options




          Which one of the following is the declaration of overloaded pre-increment operator implemented as

         member function?

 

       ► Class-name operator +() ;

        ► Class-name operator +(int) ;

        ► Class-name operator ++() ;

        ► Class-name operator ++(int) ;check from book please


 The static data members of a class are initialized _______

       ► at file scope

        ► within class definition

        ► within member function

        ► within main function



life time of static variable?




Es tarhan ka question tha lakin values change thee

What will be the output of following function if we call this function by passing int 5?

template <class T>

T reciprocal(T x)

{

return (1/x);

}

Answer:-

0

The output will zero as 1/5 and its .05 but conversion to int make it

zero
Above is prototype of template class so assume passing an int and
Post increment and pre increment k syntax btana thay(2 marks)

Answer:

Classname operator ++(); ---- pre increment
Classname operator ++(int) ---- post increment

Es ka pocha tha copy constructor  or assignment
Matrix m1 = m2;
How many arguments a Unary Operator take? Can we make a binary operator as unary operator?
Answer:-
Unary operator takes only one arguments like i++ or i-- (Post increment or post decrement operators for
integers) or ++i,--i (Pre increment or pre decrement operators for integers) ,we can not make Unary
operator as binary or binary as Unary operator
Simple function and class function explain


5 mark ka ak question th
To calculate the tax 5%  and 7 % to deduct the salary using the switch statement
Full concept of Midterm aur ya question book mai hay kafi ziyda milta hay lakin values change thee lakin idea same tha
5 marks ka 2nd question
-Class String
-Delete pointer
-New sy allocate memory
-Strcpy(s2,s1)

Main()

   -String  s, *sptr
   Kuch assignment ki hoi thee baki yad nahi Kai problem kahn thee aur ya likha hoa tah kai bad
   programming hay ap khud program lkihoo
   And program mai sy error findout kerny thay aur khud program batana tha kai consi technique 
  bather hhay
*this ponter ka pocha tha
wish you all the best

Nasia Aslam
Friday, July 13, 2012

CS201 - Introduction to Programming Solved Final Term MCQs



Download From Here!
Join Forum93.com for more VU Stuff.



FINALTERM  EXAMINATION
Fall 2009
CS201- Introduction to Programming
Time: 120 min
Marks: 75
If we write a statement like s2 = s1; ___ will be the calling object and ____ will be passed to the = operator as an argument.
       s1, s1
       s1, s2
       s2, s1
       s2, s2
If we write a statement like s2 = s1; s2 will be the calling object and s1 will be passed to the = operator as an argument. P# 397
cout << setfill(‘0’) << setw(7) << 128 ;
       0000128
       0128128
       1280000
       0012800
default alignment is from left due to this it first prints 4 Zeros(setw=7, digit=3 i.e 1-2-8,) 7-3=4 Zeros Forum93 
The stream insertion and extraction operators are not already overloaded for _______
       Built-in data types
       User-defined data types
       Both built-in and user-defined types
       None of the given options

Constructors can not be overloaded like ordinary functions.
       True
       False

The constructors can be overloaded. We can write as many constructors as we require. At one time, the compiler will call the correct version of the constructor".P# 323 these solutions are meant to host at Forum93 site only
Overloaded new operator function takes parameter of type size_t and returns
       void (nothing)
       void pointer
       object pointer
       int pointer
Also note that the new operator returns a void pointer. Any new operator we write must have this parameter and return type.

Which of the following is the correct way to declare a variable x of integer type?
       x int ;
       integer x ;
       int x;
       x integer
Reserve words cannot be used as a variable name.
       True
       False
There are few data types in C language. These data types are reserved words of C language. The reserve words can not be used as a variable manes. P#  17

A template function must have at least ---------- generic data type 
       Zero
       One
       Two
       Three
The function arguments must contain at least one generic data type. P#  499
Template functions can also be overloaded
       True
       False

We can write overloaded template functions as long as there is use of different number or type of arguments.. P # 503

We can not make a member function of a class as template function.
       True
       False not sure

When break statement is encountered in switch statement, it
       Stops the entire program
       Stops the execution of current statement
       Exits from switch statement
       None of the given options

We can also define a variable of user define data type (object) as static.
       True
       False


The declarator of Plus (+) member operator function is

       Class-Name  operator + (Class-Name  rhs)
       operator Class-Name + ( )
       operator Class-Name + ( rhs)
       Class-Name  operator + ( )



 Let suppose
    int a, b, c, d, e;
  a = b = c = d = e = 42;
This can be interpreted by the complier as:

       a = (b = (c = (d = (e = 42))));
       (a = b = (c = (d = (e = 42))));
       a = b = (c = (d = (e = 42)));
       (a = b) = (c = d) = (e = 42);
a = (b = (c = (d = (e = 42) ) ) );



What will be the range of numbers generated by function rand () % 9?
       0 to 9
       1 to 9
       0 to 8
       1 to 8
When 6 divides any number, the remainder will always be less than 6. Ther
result will be between therefore we will add 1. 1 + rand ( ) % 6;
Which of the following is the correct function call having array named student of 10 elements as a parameter.
       addRecord(student[]) ;
       addRecord(student) ;
       addRecord(student[10]) ;
       addRecord(*student) ;
when we pass array we don’t give limit of array
Example:
Pass array to function

#include<stdio.h>
   #include<conio.h>
   void read(int *,int);
   void dis(int *,int);

   void main()
   {
    int a[5],b[5],c[5],i;

    printf("Enter the elements of first list \n");
    read(a,5);
    printf("The elements of first list are \n");
    dis(a,5);
   }

   void read(int c[],int i)
   {
    int j;
    for(j=0;j<i;j++)
      scanf("%d",&c[j]);
    fflush(stdin);
   }

   void dis(int d[],int i)
   {
    int j;
    for(j=0;j<i;j++)
    printf("%d ",d[j]);
    printf("\n");
   }


Declaring structures does not mean that memory is allocated.
Example:
       True
       False

structures do not occupy any memory until it is associated with the structure variable

Identifier is a name that can be given to variables, labels and functions.
       True
       False

An 'Identifier' means any name that the user creates in his/her program. These names can be of variables, functions and labels

If a class A declares itself a friend of class B and a class B declares itself a friend of class C then
       Class A is also a friend of class C.
       Class B is also a friend of class A.
       Class A is also a friend of class C if A declares C as its friend.
        Class A is also a friend of class C if C declares A as its friend.
If we want a two-way relationship, OtherClass will have to declare ClassOne as a friend class, resulting in a complete two-way relationship



Which of the following statement is best regarding declaration of friend function?

       Friend function must be declared after public keyword.
       Friend function must be declared after private keyword.
       Friend function must be declared at the top within class definition.
       It can be declared anywhere in class as these are not affected by the public and private keywords.



Friend is a very strong statement. It is too strong to be affected by public or private we can put it anywhere in the class

A pointer is a special type of variable that contain ___________
       Memory Address
       Data values
       Both Values and Memory
       None of given of options

Pointer is a special type of variable that contains a memory address.

When memory for a program is allocated at run time then it is called ________

       static memory allocation 
       dynamic memory allocation 
       stack memory allocation
       virtual memory allocation 
When we create an object of the class at run time, it will allocate memory according to our requirement. So there is no waste of memory and the situations in which we want to store large data in small memory or vice versa are prevented. So we do dynamic memory allocation inside these classes.

What purpose do classes serve?
       Data encapsulation
       Providing a convenient way of modeling real-world objects
       Simplifying code reuse
       All of the given options



Which of the following function cannot be overloaded?
       Member functions
       Utility functions
       Constructor
       Destructor
The destructors can be summarized as The destructors cannot be overloaded. The destructors take no arguments. The destructors don’t return a value



The following prototype of unary operator function indicates that it is ____________ .
Date operator++(int )

       Member functions of post increment operator
       Member functions of  pre increment operator
       Non-member functions of post increment operator
       Non-member functions of  pre increment operator
Overloading Unary Operators
// Preincrement operator overloaded as a member function.
Date Date::operator++()
{
   helpIncrement();
   return *this;  // value return; not a reference return
}

// Postincrement operator overloaded as a member function.
// Note that the dummy integer parameter does not have a
// parameter name.
Date Date::operator++(int)
{
   Date temp = *this;
   helpIncrement();

   // return non-incremented, saved, temporary object
   return temp;   // value return; not a reference return
} // This paper was solved by Forum93 Team and meant for hosting
at Forum93 otherwise its stolen contents



Static variable which is defined in a function is initialized __________.
       Only once during its life time
       Every time the function call
       Compile time of the program
       None of the above

Once the static variables are created, they exist for the life of the program. They do not die.

In the member initialize list, the data members are initialized,
       From left to right
       From right to left
       In the order in which they are defined within class
       None of the given options



If we do not indent the code properly it will __________________
       Be a syntax error
       Be a logical error
       Not be an error at all
       None of the given options



we Indent the code for better readability and understanding


Truth tables are used for analyzing ___________.
       logical expressions
       arithmetic expressions
       both logical and arithmetic expressions
       none of the given options.

The truth tables are very important. These are still a tool available for analyzing logical expressions.

Static memory allocation is also known as ____________
       Dynamic allocation
       Compile time allocation
       Run time allocation
       None of the given options
This type of memory static allocation. It is also known as compile time allocation.


 ( Marks: 1 )
What does getline() member function of cin stream do?
  
Another member function of cin is getline(). It reads a complete buffer i.e. the number of character specified up to a delimiter we specify. We can write something like:
            cin.getline(char *buffer, int buff_size, char delimiter = ‘\n’)
   ( Marks: 1 )
When memory is allocated dynamically using new operator within the constructor of class then what is an appropriate place to de-allocate the memory?

Whenever we allocate memory with the new operator, it is our responsibility to de-allocate this memory after the termination of the program. To do this de-allocation, we have an operator delete. To de-allocate the memory, allocated with p = new int ; we will write delete

(p) ;
It will not delete the p rather, it will send the memory gotten and pointed by p back to the free store.
( Marks: 2 )
What will be the output of following code, if user input a number 123?
int input ;
cin >> oct >> input;
cout << hex << input ;
 ( Marks: 2 
What is memory leak?
suppose, the heap size is decreased as we had allocated memory from it despite the fact that it was never utilized. If this step of allocating memory and then destroy the pointer to this memory carries on then the size of the heap will going on to decrease. It may become of zero size. When there is no memory on heap, the computer will stop running and there may be a system crash. This situation is called a memory leak

 ( Marks: 3 )
When we call calloc function to allocate memory and its return a NULL pointer what does it mean?

Calloc function takes two arguments. The first argument is the required space in terms of numbers while the second one is the size of the space
Now we have to see what happens when either we ask for too much memory at a time of non-availability of enough memory on the heap or we ask for memory that is available on the heap , but not available as a single chunk?. In this case, the call to calloc will fail. When a call to memory allocation functions fails, it returns a NULL pointer.

 ( Marks: 3 )
Read the given code and explain code functionality.

Matrix :: Matrix ( const Matrix & m )
{
    numRows = m.numRows ;
    numCols = m.numCols ;
    elements = new ( double * ) [ numRows ] ;
    for ( int  i = 0 ; i < numRows ; i ++ )
{
        elements [ i ] = new double [ numCols ] ;
        for ( int j = 0 ; j < numCols ; j ++ )
                 elements [ i ] [ j ] = m.elements [ i ] [ j ] ;
    }
}
( Marks: 3 )
What is the keyword ‘this’ and what are the uses of ‘this’ pointer?

Whenever an object calls a member function, the function implicitly gets a pointer from the calling object. That pointer is known as this pointer. ‘this’ is a key word. We cannot use it as a variable name. ‘this’ pointer is present in the function, referring to the calling object.
this pointer points to the current object.
 ( Marks: 5 )

What do you mean by garbage collection and how it works in JAVA and C++ ?

JAVA gives the concept of garbage collection with the use of references. Due to this garbage collection, we are free from the headache of de- allocating the memory. We allocate and use the memory. When it is no longer in use, JAVA automatically deletes (frees) it through garbage collection But in C and C++ languages, we have to take care of de-allocating the memory. In classes where we use dynamic memory, we have to provide destructors to free this memory. The languages keep evolving, new constructs will keep evolving in existing or new languages.
 ( Marks: 5 )

Explain the concept of separation of interface from the implementation in the context of classes, using a real world example.
 ( Marks: 10 )

Write a simple program using the get() member function of cin object reading a text of 30 characters from the keyboard, store them in an array and then using put() member function of cout object to display them on the screen.
 ( Marks: 10 )

Overload the Binary Assignment (=) Operator.
Write a program which has a class List, This class should have Two data members, an array of integers list[] and an integer variable length (i.e. number of elements in the list).The class should further contain a default  constructor,  a Print() function which display the list and a Function insert() which insert an element in the list and  Assignment (= ) Operator function, which contain code for the assignment of one object to other. .
In main function define two objects list1 and list2 and use the statement list2 = list1; and use (call ) print function with both objects

Followers

Copyright VirtualHelp 2011. Powered by Blogger.

Blog Archive

Search Your Subject