Primmer Exam Question with answers


1.What is the approach of OO ?

Ans – bundle data and method

2.How do we change the state of an object ?

ANS – Using object’s behavior

3.Select the benefits of OOP?

Ans – Ease of design, Resuability

4.What defines the state of an object ?

a. Using the class Id
b. Using the class identity
c. Using the behavior
d. Using the value of the class properties

Ans:d

5.How does the different section of an application communicate in
an oo approach ?

a. Different sections of the application interact through file
system
b. Different sections of the application interact through
database
c. The objects created during runtime by different sections of
the application interact through messages
d. In OO approach, the diffferent sections run in isolation so
they will NOT interact

The correct answer is: The objects created during runtime by different sections of the application interact through messages

6.Select the principle that best describes the given scenario. The
wind is called a breeze if it is gentle. The wind is called a storm if it
is harsh.

a. Polymorphism
b. Abstraction
c. Typing
d. Aggregation

ans : a

7.A program is said to be ___________, if it optimizes the amount of
memory and processing time.

a. robust
b. documented
c. efficient
d. modular

ans : c

8.In which of the given SDLC model, unclear requirements are
considered?

a. Spiral Model
b. Agile Model
c. Prototyping Model
d. Waterfall Model

ans : c

9.ERD Example: Considerthe given scenario. ZEE public school
Library. A Library has many books. Each Book has many chapters.
Identify the cardinality between Chapter and Book

a-m…1
b. 0..0
c. 0..m
d. m..m

ans : a

10.After the development of online website for global pharmacy, it
was found that there were interface errors in few of the modules.
In which level of testing these errors would be identified.

a. System Testing
b. Acceptance Testing
c. Unit Testing
d. Integration Testing

ans : d

11.Choose the correct option where waterfall model is not suited.

a. Projects with frequent changes
b. Complex Projects (that has more number of functionalities)
c. Projects with stable requirements
d. Simple Projects (that has less number of functionalities)

ans : a

12.Software was developed for Global Marketing. Few changes that
was earlier requested was already incorporated in the delivered
software. Now the client does not want the changes and
requested for the previous release. Which of the below option
would facilitate developer to meet the client needs.

a. Software Repository
b. Software Configuration Management
c. Software Control Management
d. Change Control Management

ans : b

13.What does the below Unix command accomplish?
$ vi sample

a. delete a file named sample
b. edit file named sample
c. open file named sample
d. open file if it exists else creates a new file

ans : d

14.Which of the following is not a feature of UNIX?

a. User friendly
b. Multiuser
c. Multitasking
d. Portability

ans : a

15.Consider the sample.txt file and predict the output
Unix is an operating system.
Unix is open source.
Linux is also a powerful OS.
What is the output of grep -c “Unix” sample.txt command?

a. 3
b. 4
c. 0
d. 2

ans : d


16.Which of the following layer acts as an interface between user and
kernel ?

a. System Calls
b. Kernel
c. Shell
d. Hardware

ans : c

17.Which command in UNIX displays the list of all the users who have
logged into the Unix server?

a. users
b. Who
c. Who am i
d. List users

ans : b

18.What is the purpose of using -a option with Is command ?

a. for showing hidden files
b. for showing executables
c. for multi columnar output
d. for showing directories

ans : a

19.Comment in XML document is given by

ans :

20.Which is not true about XML

a. XML Tags are not Case Sensitive
b. XML Elements Must be Properly Nested
c. All XML Elements Must Have a Closing Tag
d. XML must be wellformed

ans :

21.Which of the following fragments of XML are well-formed

ans :

22.Find out the well-formed xml file

ans : XML Tutorials 100 $300.00

23.Which of the following statement/s is/are TRUE?
(1) Abstract method can have body
(2) Abstract class cannot be instantiated
(3) Abstract class can have constructor
Choose the most appropriate option.

ans : b. Both (2) and (3) are TRUE

24.Identify the appropriate relationship between the classes House
and Room. Assume that getter and setter methods for all instance
variables are implemented

class Room
{
private int length;
private float width;
}
class House
{
}
private float area;
private Room room;
public House()
{
room=new Room();
}

ans : Composition

25.Identify the CORRECT SQL statement to create a table with
composite primary key. Choose most appropriate option.

a. CREATE TABLE Account (AccountNumber Number(S),
Customerld Number(10), OpeningDate Date, Balance
Number(10,2), CONSTRAINT Acc.Pkey PRIMARY KEY
(AccountNumber,Customerld));
b. CREATE TABLE Account (AccountNumber Number(S),
Customerld Number(10), OpeningDate Date, Balance
Number(10,2), CONSTRAINT Acc.Pkey COMPOSITE PRIMARY
KEY (AccountNumber,Customerld));
c. CREATE TABLE Account (AccountNumber Number(S)
CONSTRAINT Acc_Pkey1 PRIMARY KEY, Customerld
Number(10) CONSTRAINT Acc_Pkey2 PRIMARY KEY,
OpeningDate Date, Balance Number(10,2));
d. CREATE TABLE Account (AccountNumber Number(S),
Customerld Number(10) CONSTRAINT Acc_Pkey2 PRIMARY
KEY (AccountNumber,Customerld), OpeningDate Date, Balance
Number(10,2));

ans : A

26.Consider the table Student(Studentld, StudentName, Email,
PercentageOfMarks). Which is the CORRECT query to display the
details in the ascending order (lowest to highest) of
PercentageOfMarks and in the descending order of Studentld in
case PercentageOfMarks is the same. Choose most appropriate
option

a. SELECT Studentld, StudentName, Email, PercentageOfmarks
FROM Student ORDER BY PercentageOfMarks DESC, Studentld;
b. SELECT Studentld, StudentName, Email, PercentageOfmarks
FROM Student ORDER BY PercentageOfMarks DESC, Studentld
DESC;
c. SELECT Studentld, StudentName, Email, PercentageOfmarks
FROM Student ORDER BY Studentld DESC, PercentageOfMarks;
; d. SELECT Studentld, StudentName, Email, PercentageOfmarks
FROM Student ORDER BY PercentageOfMarks, Studentld DESC;

ans : D

27.Consider table Customer(cid NUMBER(4), cname VARCHAR2(10))
has some records. Identify the appropriate ALTER statements
(choose 2)which executes on table Customer [ Note: There is no
null value for any column]

a. ALTER TABLE Customer MODIFY cname VARCHAR2(15);
b. ALTER TABLE Customer ADD CONSTRAINT cust_name NOT
NULL(cname);
c. ALTER TABLE Customer MODIFY cid NUMBER(2);
d. ALTER TABLE Customer ADD dob DATE DEFAULT ’30-Jun-
1995′;

ans : ALTER TABLE Customer MODIFY cname VARCHAR2(15);, ALTER TABLE Customer ADD dob DATE DEFAULT 30-Jun-1995;

28.Consider table Students(studentld, branchid). Identify the
CORRECT SOL statement to retrieve the branches which has more
than 3 students. Choose most appropriate option.

a. SELECT branchid FROM Students HAVING COUNT() >3;

b. SELECT branchid FROM Students GROUP BY studentld HAVING COUNTS) > 3; ✓ Q

c. SELECT branchid FROM Students GROUP BY branchid HAVING COUNT() > 3;
d. SELECT branchid FROM Students WHERE COUNT(*) >3
GROUP BY branchid;

ans : SELECT branchid FROM Students GROUP BY branchid HAVING COUNT(*) > 3;

29.Consider table Project is created using the SQL statement given
below
CREATE TABLE Project(
projectid VARCHAR2(10) CONSTRAINT pkey PRIMARY KEY,
projectname VARCHAR2(10) CONSTRAINT pnull NOT NULL,
employeecount NUMBER(2) DEFAULT 0);
Which of the following statements insert record successfully to
Project table [Choose 2]

a. INSERT INTO project(projectid,employeecount)
VALUES(‘P3’,10);
b. INSERT INTO project(projectid,projectname)
VALUES(‘P2’, ‘Finance’);
c. INSERT INTO project VALUESfPT,’Finance’,20);
d. INSERT INTO project VALUESfPT,’Finance’;)

ans : INSERT INTO project(projectid,projectname) VALUESCP2′,’Finance’);, INSERT INTO project VALUESfPT, ‘Finance’, 20);

30.’link’, ‘vlink’ and ‘alink’ are attributes of which HTML tag?

ans :

Next »


Leave a Reply

Your email address will not be published. Required fields are marked *