BELOW ARE 5 MULTIPLE CHOICE QUESTIONS GIVEN BELOW IN WHICH ONE OR MORE THAN ONE OPTIONS ARE CORRECT . ( KINDLY PROVIDE RIGHT SOLUTION NEEDED URGENTLY FOR PRACTICE)   ----------------------------------------------------------------   Q1:- The C++ unexpected() function is called in which of the following circumstances ?   A) when there is no appropriate catch block in the calling function , to catch an exception thrown by the   B) When a function throws an exception unexpectedly , before a catch block is encountered   C) when something unexpected happens during normal program execution   D) when a function is called with parameters which do not match its declaration   E) when a function throws an exception which is not in the function definition's throw list.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

BELOW ARE 5 MULTIPLE CHOICE QUESTIONS GIVEN BELOW IN WHICH ONE OR MORE THAN ONE OPTIONS ARE CORRECT . ( KINDLY PROVIDE RIGHT SOLUTION NEEDED URGENTLY FOR PRACTICE)  

----------------------------------------------------------------

 

Q1:- The C++ unexpected() function is called in which of the following circumstances ?

 

A) when there is no appropriate catch block in the calling function , to catch an exception thrown by the

 

B) When a function throws an exception unexpectedly , before a catch block is encountered

 

C) when something unexpected happens during normal program execution

 

D) when a function is called with parameters which do not match its declaration

 

E) when a function throws an exception which is not in the function definition's throw list.

 

Q2 ) :- Which of the following statements correctly describe exceution of the highlighted command ?

 

$qrep ^root /etc/passwd

root:qqed262w7tvxq:0:0:0000~admin(0000), ,258, :/:/bin/tcsh

$su

 

A) the current directory will be changed to '/'

 

B) the environment will be the same as though root (super user ) had logged onto the system.

 

C) the user will be prompted for a password and then /bin/tcsh will be executed .

 

D) the system will execute /bin/sh . the current directory will not be changed.

 

E) the user will be prompted for a password and then /bin/sh will be executed.

 

 

Q3 :- The ANSI C function below causes the program in which it runs to malfunction . Which of the following connection will help  to perform function successfully ?

 

/* Return a count of all the bits set in bytes */

 

int bitcount (unsigned char c)

{

unsigned char x , b , count =0;

for (b = 0 , x= 1 ; !(x & 0x100); ++b, x <<=1) {

if (x | c )

++count;

}

return count;

}

 

A) change the type of x to a type larger than unsigned char.

 

B) remove the extraneous variable b.

 

C) change the return type to unsigned char .

 

D) change if ( x | c) to if ( x & c) inside the for loop.

 

E) change ! (c & 0x100) to ( x < 0x100) inside the for loop.

 

 

Q4:- Which of the following statements accurately describe the C++ code except below ?

 

int* arr = new int [10];

delete arr;

 

A) delete will fail.

B) the compiler will emit a diagnostic error.

C) an exception may be thrown at runtime .

D) delete[] arr; must be used to properly deallocate arr.

E) the free-store may be corrupted.

 

 

Q5 :- Which of the following are differences between signed and unsigned variations of the same integer type in a 2's complement.

 

A) the range of the signed and unsigned variations of the same integer type are equivalent in size and numeric maximum value and minimum .

 

B) the range of the unsigned variations of an integer type is twice that of the signed variation.

 

C) A negative value, expressed as a signed integer , will be expressed as a positive value greater than the maximum value of the signed integer , if expresses as an unsigned integer of the same size.

 

D) they have the same size , but the signed variation range is centered around 0 ( zero0 , and the unsigned variation range  has a lower bound of 0 (zero)

 

E) the representation of a signed integer has one additional bit for the sign.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Networking
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education