CS201 Solved MCQ’s


The statement cout yptr will show the __________the yptr points to.
Value
Memory Address
Variabvle
None of given
char **argv can be read as__________________.
Pointer to Pimter
Pointer to Char
Pointer to Pointer to Char
None of given
_______________are conventional names of the command line parameters of the ‘main()’ function.
‘argb’ and ‘argv’
‘argc’ and ‘argv’
‘argc’ and ‘argu’
None of Given
___________ Returns true if c is a digit and false otherwise.
int isalpha( int c )
int isalnum( int c )
int isxdigit( int c )
int isdigit( int c )
In the case of pointer to pointer or _______________, the first pointer contains the address of the second pointer, which contains the address of the variable, which contains the desired value.
double dereference
Single dereference
dereference
None of the given
_______________________ contains functions for manipulations of character data.
ctype.h
iostream.h
string.h
None of the given
dereferencing operator is represented by _______
*
+

None of the given
In_________, we try to have a precise problem statement
Analysis
Design
Coding
None of the given
Memory allocated from heap or free store _____________________.
can be returned back to the system automatically
can be allocated to classes only
cannot be returned back unless freed explicitly using malloc and realloc
cannot be returned back unless freed explicitly using free and delete operators
Once the _______________ are created, they exist for the life time of the program
local variables
non static variables
static variables
automatic variables
Once the static variables are created, they exist for the life of the program. They do not die. So returning their reference is all right.
The members of a class declared with the keyword struct are _____________by default.
static
private
protected
public.
The members of a class declared with the keyword struct are public by default. A structure is inherited publicly by default.
If the memory in the free store is not sufficient ____________________.
Select correct option:
malloc function returns 1
malloc function returns 0
malloc functions returns NULL pointer
malloc function returns free space
if the memory in the free store is not sufficient enough to fulfill the request. malloc() function returns NULL pointer if the memory is not enough. In C++, 0 is returned instead of NULL pointer.
This reference to a variable can be obtained by preceding the identifier of a variable with ________________.
dot operator
ampersand sign &
^ sign
operator
Once an object is declared as a friend, _________________________.
it has access to all non-public members as if they were public
it has access to public members only
it has no access to data members of the class
it has to protected data members only
Reference variables must _________________.
not be initialized after they are declared
be initialized after they are declared
contain integer value
contain zero value
If the request of new operator is not fulfilled due to insufficient memory in the heap____________________.
the new operator returns 2
the new operator returns 1
malloc functions returns NULL pointer
malloc function returns free space
Reference is not really an address it is ______________.
a synonym
an antonym
a value
a number
If the request of new operator is not fulfilled due to insufficient memory in the heap ____________________.
the new operator returns 2
the new operator returns 1
the operator returns 0
free operator returns nothing
Functions declared with the _______________ specifier in a class member list are called friend functions of that class.
protected
private
Public
friend
Functions declared with the friend specifier in a class member list are called friend functions of that class. Classes declared with the friend specifier in the member list of another class are called friend classes of that class.
public or private keywords can be ____________
written only for once in the class or structure declaration
written multiple times in the class or structure declaration
written only twice in the class declaration
written outside the class
good practice is to write public or private keywords only once in the class or structure declaration, though there is no syntactical or logical problem in writing them multiple times.
The friend keyword provides access _____________.
in one direction only
in two directions
to all classes
to the data members of the friend class only
The friend keyword provides access in one direction only. This means that while OtherClass is a friend of ClassOne, the reverse is not true.
References cannot be uninitialized. Because it is impossible to _______________
reinitialize a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer
new operator can be used for ______________.
Select correct option:
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.
The destructor is used to ______________.
allocate memory
deallocate memory
create objects
allocate static memory
If we want to allocate memory to an array of 5 integers dynamically, the syntax will be _____________.
int *iptr ; iptr = new int[5] ;
integer iptr** ; iptr= new int[5]
int iptr ; iptr= int [5]
iptr= new[5]
Memory allocated from heap or free store _____________________.
can be returned back to the system automatically
can be allocated to classes only
cannot be returned back unless freed explicitly using malloc and realloc
cannot be returned back unless freed explicitly using free and delete operators
The memory allocated from free store or heap is a system resource and is not returned back to the system unless explicitly freed using delete or freeoperators.
Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the _________.
Select correct option:
Compilers
Operands
Function names
Applications
Operator overloading is to allow the same operator to be bound to more than one
implementation, depending on the types of the operands.
The operator to free the allocated memory using new operator is________________.
Select correct option:
free
del
delete
remove
The operator to free the allocated memory using new operator is delete. So whenever,
we use new to allocate memory, it will be necessary to make use of ‘delete’ to deallocate
the allocated memory.
The concept of friend function negates the concept of _________________.
Select correct option:
inheritance
polymorphism
persistence
encapsulation
New operator is used to allocate memory from the free store during ______________
Compile Time
Run Time
Link Time
None of above
To get the memory address of a variable we use _____

&

&&
*
|

If we have a program that writes the output data (numbers) to the disc, and if we collect the output Data and write it on the disc in one write operation instead of writing the numbers one by one. In the above situation the area where we will gather the number is called
Buffer
Stream
Memory
None of these
What functionality the following program is performing?
#include <iostream.h>
int main()
{
const int SIZE = 80;
char buffer[SIZE];
cout <<” Enter a sentence : “;
cin.getline(buffer, SIZE);
cout<<buffer <<endl;
system(“pause”);

}
objects are used respectively to read a sentence from the key board and then print it on the screen.
Using getline function
using character arrays
Doing nothing
The get member function, when passed no arguments, inputs an entire stream and returns it as the value of the function call.
True
False
New operator allocates memory from free store and returns ___________
Void
NULL
Nothing return
None of above
The statement cin.get (); is used to,
Read a character from keyboard
Read a an entire string
Read integer values
Read float values
Suppose int i = 10; then what will be the value of i after being converted in to octal value
10
12
14
16
Which of the following is a destination of cout stream?
Monitor /screen
Keyboard
Memory
None of these
Which of the following is the correct definition of streams ?
streams are memory locations
sequence of bytes are called streams
sequence of variables are called streams
sequence does not have any definition
Stream operators are heavily overloaded means , they allow to handle int and character data type only.
true
false
What functionality the following program is performing?
int main()
{
const int SIZE = 80;
char buffer[SIZE];
cout <<” Enter a sentence : “;
cin.getline(buffer, SIZE);
cout<<buffer <<endl;
system(“pause”);

}
read and write member functions of cin and cout objects are used respectively to read a sentence from the key board and then print it on the screen.
read and put member functions of cin and cout objects are used respectively to read a sentence from the key board and then print it on the screen.
get and write member functions of cout and cin objects are used respectively to read a sentence from the key board and then print it on the screen.
get and write member functions of cout and cin objects are used respectively to read a sentence from the key board and then print it on the screen.
Which of the following is a source for cout stream?
monitor / screen
keyboard
proccessor
none of these
If we use cin stream to read some value and store it in some integer variable and press some alphabet key instead of numeric keys. then what will happen?
Its binary representation will be ignored and the character will be stored
Its binary representation will be ignored and the value will be stored
Its ASCII code will be stored inside the computer
Some error will occur and cin stream will detect this error.
The endl and flush are _____
Functions
Operators
Manipulators
Objects
What is the difference between cout and cerr ?
cout is unbuffered output and cerr is buffered output
cout is standard output and cerr is not a standard output
cout is not a standard output and cerr is standard output
cout is buffered output and cerr is unbuffered output
The operator function for << (stream insertion) >> and stream extraction must be
Member function of class
Non-member function of class
Both member and non-member function
None of the given options
The pointer returned by the new operator points to ————— of memory chunks allocated by the new operator
First memory address
Second memory address
Last memory address
None of the above
When we used eof (end of file) with the file reading than which of the following is a true statement?
This is way to check source of the stream
This is way to check destination of the stream
This is way to check state of the stream
This is way to check type of the stream
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
When a variable is defined as static in a class then ___________
Separate copy of this variable is created for each object
Only one copy is created for all objects of this class
A copy of this variable is created for only static objects.
None of the given options
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

MGT111 Assignment No 2 Spring 2012

All the incumbents of the public offices enjoy and exercise certain authority by the virtue of the office they hold. Some of these offices carry more and important aspect of authority as compared to the others. These include Police and the paramilitary forces. It is usually assumed that the SHO or the DPO is “King” ridding an unbridled horse of authority. But the situation is not so in the real life. The newspapers speaks about SHO being called for explanation or suspended by the IG Police, IG Police called for explanation in Courts of Law, even Secretary Interior called to appear before Committees of the Parliament to provide satisfactory answers, even the Police Department as a whole needs to request for funds from the executive to fulfill its desired role. Not only the mentioned ones but now the fourth pillar of the state has also nosed the Police in general and all the other pillars of the state in particular.

Question:

All the points given in the above mentioned paragraph refer to an important practice of Public Administration. Relate all the above mentioned incidents to the types they belong to.

Solution:

SHO being called for explanation or suspended by the IG Police

“Internal Control”, as both belong to the same department.

IG Police called for explanation in Courts of Law

” External Control” (judicial control)

Secretary Interior called to appear before Committees of the Parliament to provide satisfactory answers

“External Control” (legislative control)

Police Department as a whole needs to request for funds from the executive to fulfill its desired role

“External Control” (executive control)

Not only the mentioned ones but now the fourth pillar of the state has also nosed the Police in general and all the other pillars of the state in particular

External Control


MGT301 Assignment No 2 Spring 2012

1. After analyzing the findings of the research conducted, you need to identify the ‘key factor’ which compelled KFC’s higher management to launch Big Filler Burger?

Solution:
As a new product launch is always risky. You can never be certain if your product will be a success or a failure. There are, however, ways to predict with reasonable accuracy, whether or not a product will succeed. This can be done by determining the key success factors for a new product. According to Dr. William R. Boulton,
“key success factor fall into five categories: customer requirements, competitive factors that must be met, regulations/industry standards, requirements to implement competitive strategy, and technical requirements to build a competitive position. Determining the precise key success factors for your specific product is simple when using these categories. Following a few easy steps will show you how to determine your key success factors.”
1- customer requirement:
The KFC’s higher management write down a list of customer requirements. These are the things that you know your potential customers want in a product. This can be gathered via market research. An example as it is discribed that the size of the burger is now attracting customers,. Therefore, it is considered a key success factor.
2- Competitive factors:
Write a list of competitive factors that must be met. For example, if you are marketing a new sports drink and all other sports drinks contain caffeine, putting caffeine in your product is a competitive factor that you must meet. Not meeting this factor means that you will likely be unable to compete, so this factor is a key success factor.
3- Regulations/industry standards:
Write a list of regulations/industry standards in your specific business. A food product, for instance, needs to pass certain health requirements. Not meeting these requirements makes it likely that you will be shut down by regulators. Therefore, these requirements are considered key success factors.
4- Resource requirements:
Write your resource requirements to implement competitive strategy. For example, for a marketing campaign you will need to the the approximate cost and the number of employees needed. These are factors necessary to implement your strategy, so they are considered key success factors.
5- Technical requirements:
Write a list of technical requirements you need to build a competitive position. If you need access to particular technology to produce and distribute your product, this is a key success factor
2. How competitors of KFC help in making an idea of Big Filler? Was it market intelligence or market research which helped KFC to take this decision?

Solution:
It was Market research that KFC help in making an idea of Big Filler as KFC was facing severe competition from its competitor regarding size of the burger e.g. BIG MAC Burger by McDonald, Foot Long Burger by Subway etc. The crux of the task was to design a campaign where KFC could stand out among competitors by offering something unique and out of the box. Therefore KFC’s product development team came up with a new idea of introducing “KFC Big Filler Burger”
KFC conducted a research that what the competitors are doing in this regards. Research findings show that Big Mac by Mac Donald and Big Foot by Subway, have received a tremendous response from the market; especially from those customers who are focusing on the size of the product. For that KFC has developed a new product with the name of Big Filler burger. After the launch of this product, they again conducted a research and tried to explore the response of the customer regarding some particular attributes of the product.

ENG101 Assignment No. 3 Spring 2012 Solution

Q1. Correct the grammatical mistakes in the following sentences. (5 marks)
1. No less than fifty men were injured in the accident.
2. He is the taller of the two brothers.
3. He would make a better engineer than a doctor.
4. I do not like such movies, which are immoral.
5. Poultry has given him great profit.
Q2. Fill in blanks by using the appropriate connectives. (5 marks)

1. This is _____ a heavy chair that it is not easy to carry. (much, such)
2. I was ___ pleased about the letter that I ran to tell my mother. (so, very)
3. The news is ____wonderful to be believed. (too, to)
4. The main reason I left early was ________ I was bored. (if, because)
5. I was reaching down to pick up my cap just _____ I saw the two snakes. (when, then)

Q3. Identify the given statements as Complete Sentence or Sentence Fragment.
(5 marks)
1. Several small shops went out of business.
2. The nurse pierced my arm four times with a syringe.
3. As it was her first airplane ride.
4. Because there was a gas leak.
5. The small child was always active.
Solution:
Question No.1
1. No less than fifty men were injured in the accident.
2. He is the taller of the two brothers.
3. He would make a better engineer than a doctor.
4.I donot like immoral movies.
5. He has earned benefit through dealing in poultry.
Question No.2
1. This is such a heavy chair that it is not easy to carry.
2. I was so pleased about the letter that I ran to tell my mother.
3. The news is to wonderful to be believed.
4. The main reason I left early was becasue I was bored.
5. I was reaching down to pick up my cap just when I saw the two snakes.
Question No.3
1. Several small shops went out of business. Complete
2. The nurse pierced my arm four times with a syringe.Complete
3. As it was her first airplane ride.Fragment
4. Because there was a gas leak.Fragment
5. The small child was always active.Complete

MGMT611 GDB Solution Spring 2012

Question:

Mr. Hanan is working as an HR director in a multicultural organization. A large number of employees of the organization belong to India, Pakistan and Bangladesh. HR department has received many complaints from employees of different departments that few supervisors prefer the employees of their own country for availing opportunities and resources. This biased situation is creating dissatisfaction among all employees. To find out the real picture, the HR director has decided to conduct a survey regarding the job satisfaction of employees. After conducting an HR survey, he became aware of the fact that ethnocentrism factor is prevailing in the organization which is creating job dissatisfaction among employees. In addition, it can prove to be a great hurdle in increasing productivity and future performance of the organization.
You are required to suggest some approaches appropriate to cope with this cross cultural barrier existing in the organization? Support your answer with appropriate justifications.

Solution:

Strategies to improve cross-cultural relations:
Here we take a systematic look at approaches people can use on their own along with training programs
designed to improve cross-cultural relations.
A. Develop Cultural Sensitivity
B. Focus on Individuals Rather than Groups
C. Respect all Workers and Cultures
D. Value Cultural Differences
E. Minimize Cultural Bloopers/embarrassments
F. Participate in Cultural Training
G. Foreign language training
H. Diversity training