3i Infotech Papers: Sample Questions 273 - 275 of 1245

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

Question number: 273

» Database » Oracle

MCQ▾

Question

What type of file is used for porting Forms 4.5 applications to various platforms?

Choices

Choice (4) Response

a.

. EXE file

b.

. FMT file

c.

. FMX file

d.

. FMB file

Answer

b.

Explanation

The text and documentation files

The Text and Documentation Files

The text and documentation files

In Forms 4.5 the PL/SQL code is in text form in the FMT file- allowing search for code, or export to FMB files.

Question number: 274

» Database » MySQL

Essay Question▾

Describe in Detail

What is a Relation Schema and a Relation?

Explanation

Relation schema:

  • A set of attributes is called a relation schema (or relation scheme).

  • A relation schema is also known as table schema (or table scheme).

  • A relation schema can be thought of as the basic information describing a table or relation.

  • It is the logical definition of a table.

  • Relation schema defines what the name of the table is.

  • This includes a set of column names, the data types associated with each column.

A relation:

  • A relational database is a set of tables containing data fitted into predefined categories.

  • Each table (which is sometimes called a relation) contains one or more data categories in columns.

  • Each row contains a unique instance of data for the categories defined by the columns.

Question number: 275

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

What is the output of following program:

  1. class Sample
  2. {
  3.     public:
  4.     int * ptr;
  5.     Sample (int i)
  6.     {
  7.         ptr = new int (i);
  8.     }
  9.     ~Sample ()
  10.     {
  11.         delete ptr;
  12.     }
  13.     void PrintVal ()
  14.     {
  15.         cout << “The value is” << * ptr;
  16.     }
  17. };
  18. void SomeFunc (Sample x)
  19. {
  20.     cout << “Say i am in someFunc” << endl;
  21. }
  22. int main ()
  23. {
  24.     Sample s1 = 10;
  25.     SomeFunc (s1);
  26.     s1PrintVal ();
  27. }

Explanation

  • In the program

Table showing the program

Table showing the program

  1. class Sample
  2. {
  3.     public:
  4.     int * ptr;
  • Define the sample class

  • int * ptr; defines the integer pointer ptr

  1. Sample (int i)
  2. {
  3.     ptr = new int (i);
  4. }
  • defines the sample () function with integer parameters

  • ptr is assigned the integer parameter i

  1. ~Sample ()
  2. {
  3.     delete ptr;
  4. }
  • define the ~sample () function

  • deletes the ptr pointer

  1. void PrintVal ()
  2. {
  3.     cout < < “The value is” < < * ptr;
  4. }
  • define the printval () function

  • cout prints the * ptr value

  1. void SomeFunc (Sample x)
  2. {
  3.     cout < < “Say i am in someFunc” < < endl;
  4. }
  • define the SomeFunc () function

  • Cout prints “Say i am in someFunc”

  1. int main ()
  2. {
  3.     Sample s1 = 10;
  4.     SomeFunc (s1);
  5.     s1PrintVal ();
  6. }
  • Define the sample () function s1 = 10

  • S1 value pass in SomeFunc () function

  • Printval () function use the s1 value

  • As the object is passed by value to SomeFunc the destructor of the object is called when the control returns from the function.

  • So when PrintVal is called it meets up with ptr that has been freed.

  • The solution is to pass the Sample object by reference to SomeFunc: void SomeFunc (Sample &x) {cout < < “Say i am in someFunc ” < < endl; } because when we pass objects by reference that object is not destroyed while returning from the function.