3i Infotech Papers: Sample Questions 186 - 187 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 186

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

Find the output of the following program

  1. class complex
  2. {
  3.     double re;
  4.     double im;
  5.     publiccomplex() : re(1),im(0.5)
  6.     {
  7.     }
  8.     bool operator==(complex &rhs); operator int(){}
  9. };
  10. bool complex::operator == (complex &rhs)
  11. {
  12.     if((this->re == rhs.re) && (this->im == rhs.im)) return trueelse return false;
  13. }
  14. int main()
  15. {
  16.     complex c1;
  17.     cout<< c1;
  18. }

Explanation

  • In the program

Table showing the program

Table showing the program

  1. class complex
  2. {
  3.     double re;
  4.     double im;
  5.     publiccomplex() : re(1),im(0.5)
  6.     {
  7.     }
  8.     bool operator==(complex &rhs);
  9.     operator int(){}
  10. };
  11. bool complex::operator == (complex &rhs)
  12. {
  13.     if((this- > re == rhs.re) && (this- > im == rhs.im)) return trueelse return false;
  14. }
  • Define the class complex

  • Define the double variable re and im

int main () {complex c1; cout < < c1; }

  • The program tries to print the complex object using output re-direction operator, which is not defined for the class.

  • But the compiler instead of giving an error sees the conversion function and converts the user defined object to standard object and prints some garbage value.

Question number: 187

» Database » Oracle

MCQ▾

Question

Which of the following is not an advantage of a client/server model?

Choices

Choice (4) Response

a.

A client/server model allows centralised control of data and centralised implementation of business rules.

b.

A client/server model is suitable for all applications

c.

A client/server model increases developer’s productivity

d.

None of the above

Answer

b.

Explanation

Client/ server model

Client/Server Model

Client/server model

Advantages of Client-Server Model:

Centralization

  • Updating data or other resources at central location.

  • Integrity of the data controlled by the dedicated server.

Proper Management

  • The files are stored at the same place- management of files becomes easy.

Suitable for All Application:

  • A client-server application is a distributed system made up of both client and server software.

  • Client server application provides a better way to share the workload.

Multitasking:

  • Delivers the highest possible degree of concurrency, data integrity, and performance to its client applications.