[go: up one dir, main page]

0% found this document useful (0 votes)
1K views38 pages

Final Assesment All-In-One-Domain

The document contains questions about database management systems (DBMS) and related concepts. It asks about: 1) Writing SQL queries to retrieve order information for a specific customer ID. 2) Modeling a scenario involving students and courses as entities in a relational database. 3) Properties of database normalization forms. 4) Types of data partitioning. 5) Writing SQL queries to retrieve student records based on name. 6) Concepts related to transaction scheduling and dependencies.

Uploaded by

Pawan Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views38 pages

Final Assesment All-In-One-Domain

The document contains questions about database management systems (DBMS) and related concepts. It asks about: 1) Writing SQL queries to retrieve order information for a specific customer ID. 2) Modeling a scenario involving students and courses as entities in a relational database. 3) Properties of database normalization forms. 4) Types of data partitioning. 5) Writing SQL queries to retrieve student records based on name. 6) Concepts related to transaction scheduling and dependencies.

Uploaded by

Pawan Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

DBMS

Q.1 Which of the following is the correct query to find all the orders against the employee who works
for the customer whose id is 1234 ?

The required tables are :

Employee(eid, name, city) and orders (ord_no, purch_amt, ord_date, customer_id, eid)

OPTIONS:-

a) Select * from orders where eid (select DISTINCT eid from orders where customer_id=1234)
order by eid.
b) Select * from orders where eid =(select DISTINCT eid from orders where customer_id=1234);
c) Select * from orders where eid = (select eid from orders) where customer_id=1234;
d) Select * from salesman where eid =(select DISTINCT eid from orders) where customer_id=1234;

Q.2 Consider the following scenario.

You are required to store information about students and the courses they study in college.

In this case, which one of the following statements describes correctly about the entities?

a) Such a scenario cannot be implemented in RDBMS


b) Students and Courses would together be represented as one entity
c) Students would be one entity and Courses would be another
d) Information on given is inadequate to decide on entities

Q.3 Which of the statement is not true regarding normal form?

a) Any relation with two attributes is in BCNF


b) Lossless dependency preserving decomposition into BCNF is always possible
c) Lossless dependency preserving decomposition into 3NF is always possible
d) BCNF is stricker than 3NF

Q.4 Which of the following partitioning is used to put different rows into different tables?

a) Range
b) Hash
c) Vertical
d) Horizontal

Q.5 Which of the following queries can be used to display the records of the students from student table
with student names beginning with any of the letters but not between ‘B’ and ‘N’?

a) Select name from student where StudentName NOT BETWEEN ‘B’ and ‘N’;
b) Select * from student where StudentName NOT EXISTS ‘B’ and ‘N’;
c) Select * from student where StudentName NOT BETWEEN ‘B’ OR ‘N’;
d) Select * from student where StudentName NOT BETWEEN ‘B’ AND ‘N’;

Q.6 Two schedulers are _________equivalent if transaction in both schedules perform similar actions in
similar manner.
a) conflict
b) schedule
c) view
d) result

Q.7 whenever two independent one-to-many relationships are mixed in the same relation, which of the
following dependency arises?

a) Multi-valued dependency
b) Partial dependency
c) Functional dependency
d) Transitive dependency

Q.8 Consider the following schemas

Orders(OrderID, CustomerID, EmployeeID, OrderDate, ShipperID)

Employees(EmployeeID, LastName, FirstName, BirthDate, Photo, Notes)

Which of the following SQL statements lists if the employees with lastname =“Smith” or “Pears” have
registered more than 18 orders?

Choose the most appropriate alternative from the options given below

a) None of the mentioned options

b) SELECT Employees.LastName, COUNT(Orders.OrderID) AS NumberOfOrders from Orders


INNER JOIN Employees
ON Orders.EmployeeID=Employees.EmployeeID
WHERE LastName=’Smith’ OR LastName=‘Pears’
GROUP BY FirstName
HAVING COUNT (Orders.OrderId) > 18;

c) SELECT Employees.LastName, COUNT(Orders.OrderID) AS NumberOfOrders from Orders


INNER JOIN Employees
ON Orders.EmployeeID=Employees.EmployeeID
WHERE LastName=’Smith’ OR LastName=‘Pears’
GROUP BY LastName
HAVING COUNT (Orders.OrderId) > 18;

d) SELECT Employees.LastName, COUNT(Employees.EmployeeID) AS NumberOfOrders from Orders


INNER JOIN Employees
ON Orders.EmployeeID=Employees.EmployeeID
WHERE LastName=‘Smith’ OR LastName=‘Pears’
GROUP BY LastName
HAVING COUNT (Orders.OrderId) > 18;
Pseudocodes
Q.1 what will be the output of the following Pseudocode?
Integer a , n , sum , q , r
Set a=123, n=0, sum=0
Set q = a
While ( q mod 10 NOT EQUALS 0)
n=n+1
q = q / 10
End while
Print n
While (a greater than 0)
r = a mod 10
sum = sum + r
a = a / 10 n-1
End While
Print sum
[Note mod finds the remainder after the division of one number by another. For
example, the expression “5 mod 2” would evaluate to 1 because 5 divisible by 2 leaves a
quotient of 2 and a remainder of 1 ]
a) 6 5
b) 6 4
c) 3 4
d) 3 2

Q.2 What will be the output of Pseudocode?


Integer n, rev, rem, orig
Set n = 61206, rev = 0
Set orig = n
While n NOT EQUALS 0
rem = n MOD 10
rev = rev * 10 + rem
n = n / 10
End while
If (orig IS EQUAL TO rev)
Print rev
Else
Print (orig – rev) / 6
End If

[Note mod finds the remainder after the division of one number by another. For
example, the expression “5 mod 2” would evaluate to 1 because 5 divisible by 2 leaves a
quotient of 2 and a remainder of 1 ]
a) 60216
b) 61206
c) 0
d) 165

Q.3 What will be the output of the following Pseudocode?


Integer num, temp, digit, sum
Set num = 123, sum = 0
While (num greater than 0)
digit = num mod 10
sum = sum + digit * 2
num = num / 10
End while
Print sum
[Note mod finds the remainder after the division of one number by another. For
example, the expression “5 mod 2” would evaluate to 1 because 5 divisible by 2 leaves a
quotient of 2 and a remainder of 1 ]
a) 12
b) 321
c) 18
d) 6

Q.4 What will be the output of the following Pseudocode?


Integer i, j, sum, n
Set sum = 0 , n = 7
Repeat for i = 1 to n
Repeat for j = 1 to i - 1
sum = sum + j
End loop
End loop
Print sum
a) 84
b) 147
c) 56
d) 35
Q.5 What will be the output of the following Pseudocode?
Integer i = 0, j = 0
While ( i < 2 ) // line 2
Increment i;
While ( j < 3 )
Print A
Go to line no. 2
End while
End while
a) It will print A two times
b) None of the mentioned options
c) It will print A four times
d) It will print A three times

Q.6 What will be the output of the following Pseudocode?


Integer n, beg, end
Set beg = 5, end = 7, sum = 0
If (beg > end)
Print sum + 1
Else
For (n=end; n>=beg; n=n-1)
Sum = sum + n
n=n–1
End for loop
Print n
a) 6
b) 3
c) 7
d) 9
Q.7 What will be the output of the following pseudocode for a=84, b=24?
Integer fun (Integer a, Integer b)
While (a NOT EQUALS b)
If(a > b)
Return fun (a – b , b)
Else
Return fun (a, b - a)
End if
End while
Return a
End function fun( )
a) 12
b) 60
c) 2
d) 3

Q.8 What will be the output of the following pseudocode?

Integer I, sum
Set i=1, sum=0
Sum=sum + i //Line 3
If(sum>500)
Print i
Else
i=i+1
go to line number 3
end if

32
45
28
36
Front End Technology

Question-1

In HTML 5 document, the users can define their own attributes. Identify the correct way to
declare a user defined attribute

Custom-XXXX
Customdata-XXXX
Data-XXXX
Datacustom-XXXX

Question-2

Which of the following HTML 4 elements is also present in HTML5?

<object>
<big>
<applet>
<font>

Question-3

What is the default font size in Bootstrap 4?

8px
48 px
16 px
32 px

Question-4

How many columns are allowed across the page in Bootstrap grid system?

16
12
8
24

Question-5
Identify the correct statement(s) about CSS3?

CSS 3 can compile CSS styling with fewer lines of code


CSS 3 allows responsive designs
CSS 3 is not backwards- compatible with former CSS versions

Only 2
Only 2 and 3
Only 1 and 3
Only 1 and 2
Question-6

Which type of computer language is HTML 5?

Markup language
Machine language
Query language
Programming language

Question-7

Which new feature of CSS 3 makes it possible to adjust the transparency of the elements?

Rounded corners
Border Images
Box shadow
Opacity

Question-8

Which container class is used to represent a full width container?

.container-solid
.container-fluid
.container-fixed
.container

Question-9

Which feature of CSS 3 is used to add special colored corner to the body or text by using the
border-radius property
Box shadow
Border images
Multi background
Rounded corners

Question-10

Which color is produced using the Hex color code #FF0000?

Blue
Green
Red
Black

Question-11

Which Bootstrap class indicates the dropdown menu?

.dropdown (indicates the dropdown menu)


.dropdown-menu (builds the dropdown menu)
.dropdown-menu-right (right aligns a dropdown menu)
.dropdown-header (adds a header inside the dropdown menu)

Question-12

What is the function of ng-app directive in Angular JS-6?

It tells Angular JS that it is root element of the Angular application


It binds the value of HTML controls to application data
It is used to copy the data from one Angular JS application to another.
It initializes application data

Question-13

Which Angular CLI command is used to compile Angular projects into an output directory?

Ng build
Ng serve
Ng update
Ng generate

Question-14
Angular JS 6 is written in which programming language?

TypeScript
Python
C++
Java

Question-15

Following are valid Bootstrap grid classes.

.col (extra small device –screen width less than 576 px)
.col-sm- (small device –screen >=576 px)
.col-md- (medium device –screen width >= 768 px)
.col-lg- (large device –screen width >=992 px)
.col-xl- (extra-large device –screen width >= 1200 px)

Question-16

For which of the following language Bootstrap 4 does not act as a Framework?
C++
HTML
CSS
JavaScript

Question-17

What is the correct syntax to write an expression in Angular JS 6?

{expression}
{{expression}}
[expression]
(expression)
Question-18

What will be the output of the following code?

<html>
<head>
<title> HTML Table Cell padding</title>
</head>
<body>
<table border=”1” cellpadding=”5” cellspacing=”5”>
<tr>
<th> Name</th>
<th> Salary</th>
</tr>

<tr>
<td> Ramesh Gupta</td>
<td> 5000</td>
</tr>

<tr>
<td> Amit Kumar</td>
<td> 8000</td>
</tr>
</table>
</body>
</html>
Question-19

Which of the following is a type of empty element?


<p>
<body>
<br>
<H1>

Question-20

The synchronization between the model and the view in Angular is known
as_______________
Data binding
Property binding
Components
Modules

Question-21

Which of the following is a non-semantic element in HTML5?

<article>
<form>
<table>
<div>
Question-22

Which of the following is showing BLUE color code?

rgb(255,0,0)
rgb(0,0,255)
rgb(0,255,0)
rgb(255,255,0)
Question-23

What can be used to display smooth transitions between two or more specified colors in CSS
3?

Gradient

Question-24

Which of the following is not a valid value of attribute align?

Left
Right
Middle
Top
Bottom
Center

Question-25

Which container class is used to represent a fixed width container?

.container-solid
.container-fluid
.container-fixed
.container

Question- 26

Choose the correct code to get the following output:


This is a heading
This is a paragraph

Question- 27

Which type of gradient style is displayed in the given image?

Radial
Top to bottom
Left to right
Diagonal
_____________________________________________________________________________
Question-28

Which of the following commands has been added in Angular 6 that was absent in the former
versions?

Ng-bind
Ng-serve
Ng-add
Ng-app

Question-29

Which are the default responsive grid systems in bootstrap?

Bootstrap's grid system uses a series of containers, rows, and columns to layout and align content. It's built
with flexbox and is fully responsive. Below is an example and an in-depth look at how the grid comes together.

The major browsers use the following prefixes:

-webkit- (Chrome, Safari, newer versions of Opera, almost all iOS browsers (including Firefox for iOS);
basically, any WebKit based browser)
-moz- (Firefox)
-o- (Old, pre-WebKit, versions of Opera)
-ms- (Internet Explorer and Microsoft Edge)

Question-30

if you have to align pagination to the right side of the web page then which of the following classes will be
used
a. pagination justify-content-center
b.pagination justify-content-end
c.pagination justify-content-right
d. pagination pagination-sm

Question-31

Which of the following statements is/are correct regarding web worker in HTML5?

1. A web worker is a script which runs in background with the page needing to wait for it complete
2. The user can continue to interact with the page, while the web worker in the background
3. Worker utilize thread like message passing to achieve parallelism

a. 2 and 3
b. 1 and 3
c. 1,2 and 3
d. 1 and 2

Question-32

What is the function of the attribute "accesskey" in HTML 5?

A. It specifies a keyboard shortcut to access an element


B. It classifies an element for use with Cascading Style Sheets
C. It specifies if the user can edit the element's content or not
D. It specifies the context menu for an element

Question-33

Identify the table that will be created by the CSS code given below.

<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Parag</td>
<td>Singh</td>
</tr>
<tr>
<td>Gaurav</td>
<td>Kumar</td>
</tr>
</table>
</body>
</html>
Question-34

Arrange the following steps in the correct order of using Bootstrap 4.


1. Include jQuery
2. Load Bootstrap JavaScript
3. Create an HTML page
4. Load Bootstrap via CDN or host it locally

A. 3-4-1-2
B. 3-2-1-4
C. 3-1-2-4
D. 2-1-4-3

Question-35

Match the following ng-directives with their functions.

1. ng-app a. It defines an AngularJS application


2. ng-model b. It binds application data to the HTML view
3. ng-bind c. It binds the value of HTML controls (input,
select, textarea) to application data

A. 1-a, 2-c, 3-b


B. 1-b, 2-a, 3-c
C. 1-b, 2-c, 3-a
D. 1-c, 2-a, 3-b

Question-36

Match the following files of Angular 6 with their respective functions:

App Component:
1. new-cmp.component.css
2. new-cmp.component.html
3. new-cmp.component.spec.ts
4. new-cmp.component.ts

Functions:
a. An HTML file is created
b. A CSS file for the new component is created
c. It is used to define the module, properties, etc.
d. It can be used for unit testing

A. 1-b, 2-a, 3-d, 4-c


B. 1-c, 2-a, 3-b, 4-d
C. 1-d, 2-a, 3-b, 4-c
D. 1-d, 2-b, 3-a, 4-c
Core Java Fundamentals

Question 1: Which of the following statements is/are true about comparing two
instances of the same class, given that the equals () and hashcode () methods have
been properly overridden?
1. If the equals () method returns true, the hashcode () comparison == might return
false.
2. If the equals () method returns false, the hashcode () comparison == might return
true.
3. If the hashcode () comparison == return true, the equals () method returns true.
4. If the hashcode () comparison == return true, the equals () method might returns
true.
Ans: . If the hashcode () comparison == return true, the equals () method might returns
true.
Question 2: What will be the output of the following code?
import java.util.*;
import java.lang.*;
import java.io.*;
class Newthread extends Thread
{
Newthread()
{
super ("My Thread");
start ();
}
public void run ()
{
System.out.println(this);
}
}
class Multithreaded_programming
{
public static void main (String args[])
{
new Newthread (); -------------Anonymous object creation
}
}

a) Compilation Error

b) My Thread
My Thread
c) My Thread
d) Thread [My Thread, 5, main].

Question 3: What will be the output of the following code?


class MyClass extends Thread
{
public void run()
{
method1();
}
public void method1()
{
synchronized(this)
{
System.out.println("My Class");
}
}
public static void main(String args[])
{
new Thread(new MyClass()).start();
}
}
Ans: My Class
Question 4: What will be the output of the following code?
class TestExample extends Thread
{
public void run()
{
System.out.println("Name: " + Thread.currentThread().getName());
System.out.println("Daemon: " + Thread.currentThread().isDaemon());

}
public static void main(String args[])
{
TestExample t1 = new TestExample();
TestExample t2 = new TestExample();
t1.start();
t1.setDaemon(true);
t2.start();
}
}

Ans: exception in thread main: java.lang. IllegalThreadStateException


Question 5: Which of the following exceptions is thrown by wait(),notify() and
notifyAll() methods. If we call them without acquiring object local?
1. illegalThreadStateException
2. illegalMonitorStateException
3. InstantiationException
4. InterruptedException

Ans: illegalMonitorStateException
Question 6: What will happen if we try to compile the following code?
class Test1
{
public static void main(String args[])
{
Object i = Integer.valueOf(42);
String s = (String)i; //lines exception
System.out.println(s);
}
}
Ans: It will raise the ClassCastException object
Question 7: What will be the output of the following code for the input = 10?
import java.util.*;
import java.lang.*;
import java.io.*;
class Test
{
public static void main(String args[])
{
int N = Integer.parseInt(args[0]);
Boolean[] b1 = new Boolean[N+1];
for(int k=2;k<=N;k++)
{
b1[k] = true;
}
for(int k=2;k*k<=N;k++)
{
if(b1[k])
{
for(int j=k;k*j<=N;j++)
{
b1[k*j]= false;
}
}
}
int a= 0;
for(int k=2;k<=N;k++)
{
if(b1[k]) a++;
}
System.out.println("The number is <= " + N + " "+ a);
}
}

a. Runtime error
b. Compilation Error
c. 16

Question 8: What will be the output of the following code?


import java.util.*;
import java.lang.*;
import java.io.*;
class average
{
public static void main(String args[])
{
double num[]={1,2,3,4,5,6,7,8,9,10};
double result;
result=0;
for(int j=0;j<10;++j)
result = result+ num[j];
System.out.println(result/10);
}
}
Ans: 5.5
Question 9: What will be the output of the following code?
import java.io.*;
class Sample
{
public static void main(String args[])
{
String s = "mnopqrst";
int len = s.length();
char c[] = new char[len];
s.getChars(0,len,c,0);
CharArrayReader x = new CharArrayReader(c);
CharArrayReader y = new CharArrayReader(c,1,4);
int i;
int j;
try
{
while((i = x.read()) ==(j= y.read()))
{
System.out.println((char)i);
}
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
Ans: None of the mentioned options

Question 10: What will be the output of the following code?


enum Barcode
{
a,b,c,d,e;
}
class EnumTest
{
public static void main(String args[])
{
System.out.println(Barcode.b);
}
}
Ans: b
Question 11: What can be inferred from the following code?
public static void before()
{

Set set = new TreeSet();


set.add("4");
set.add("5");
set.add("3");
Iterator it = set.iterator();
while(it.hasNext())
System.out.println(it.next() + " ");
}
}
Ans: The before method will print 3 4 5

Question 12: Consider the following code snippet:


StringBuilder s1 = new StringBuilder("444");
String s2 = "444";
System.out.println(s1 + " " + s2);

S1=”444same”;
S2=”444same”;

a) s1.append("same"); s2=s2.concat("same");
b) s1.append("same"); s2.concat("same");
c) s1.append("same"); s2.append("same");

Question 13: What will be the output of the following code?


import java.util.*;
class Example
{
public static void main(String args[])
{
String s1 = "This is my home town";
String [] words = s1.split("\\s");
for(String w : words)
{
System.out.println(w);
}
}
}

a) This
is
my
home
town

b) This is my home town


c) None of the mentioned option

Question 14: What does the following code do?


class MainClass
{
public static void main(String args[])
{
String s1 = "JavaJ2eeStrutsHibernate";
String s2 = "StrutsHibernateJavaJ2ee";
if(s1.length() != s2.length())
{
System.out.println("Unequal Length");
}
else
{
String s3 = s2 + s1;
if(s3.contains(s2))
{
System.out.println("Verified");
}
else
{
System.out.println("Not Verified");
}
}
}
}

Ans: Verified

Question14: The index of an array in java begins from :


Ans: 0
Question 15: Variables, methods and constructors which are declared____in a
superclass can be accessed only by the subclasses in other package or any class within
the package of its member’s class.
Ans: protected

Question16: What will be the output of the following code?


class TestException
{
public static void main(String args[])
{
TestException a = new TestException();
try
{
a.blowup();
System.out.println("a");
}
catch(IOException e | SQLException e)
{
System.out.println("c");
}
finally
{
System.out.println("d");
}
}
void blowup() throws IOException,SQLException
{
throw new SQLException();
}
}
Ans: Compilation error

Question 17: Consider the following code snippet?


void doSomething()
{
throw new RuntimeException(new Exception("Chained Exception"));
}
1. It’s when chaining exceptions, the compiler only cares about the first one in the
chain and we don’t need to add a throws clause here.
2. It will show runtime error.
3. It will show a compilation error as it detects an unchecked exception, we need to
add a throws clause.
4. It’s when chaining exceptions, the compiler only cares about the last one in the
chain and because it detects a checked exception we don’t need to add a throws
clause.

Ans: It will show a compilation error as it detects an unchecked exception, we need to


add a throws clause.

Question 18: What will be the output of the following code?

public class Test implements Runnable{


public static void main (String[] args)
{
Thread t=new Thread (this);
t.start();
}
public void run(){
System.out.print(“test”);
}
}

None of the mentioned options


The program does not compile because this cannot be referenced in a static method
The program compiles fine, but it does not print anything because it does not invoke the
run() method
The program compiles and run fine and displays test on the console.

Question 19: what will be the output of the following code?

import java.util.*;
class friends{
public static void main (String[] args)
{
LinkedHashSet<String> s1=new LinkedHashSet<String> ();
s1. add(“Joe”);
s1. add(“Smith”);
s1. add(“Joe”);
s1. add(“Tom”);
Iterator<String> it=s1.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
}

Runtime error

Joe
Smith
Smith
Tom

Joe
Smith
Tom

Compilation error
Question 20: which of the following statements can be used in the blank space of the
following code to print 1 3 5 8 12?

int [] array={1, 3, 5, 8, 12};


for(int x= array.length, y=2*x; y>array.length; --y,x++)
System.out.print(array[ ]); //Fill in the blanks

a) (array.length-y+x)/2
b) (array.length/2-m+n)
c) (m-n)/2
d) (array.length+m-n)/2
Question 21: what will be the output of following code?

Import java.util.*;
Import java.lang.*;
Import java.io.*;
Class evaluate{
Public static void main(String [] args)
{
Int a[]={1,2,3,4,5};
Int d[]=a;
Int sum=0;
For(int j=0;j<3;++j)
Sum+=(a[j]*d[j+1])+(a[j+1]*d[j]);
System.out.print(sum);
}
}
38
39
40
30

Q.22 Which of the following is necessary to specify at the time of array initalisation?
a) Both Row and Column
b) Row
c) Column
d) None of the mentioned option

Q.23 Which of the following classes is related to all the exceptions that cannot be
caught?
a) RuntimeException
b) Exception
c) Error
d) CompileTimeException

Q.24 If public class prototype{ } is a class . what would be the default constructor for
this class?
a) prototype(void){ }
b) public prototype(int a, int b){ }
c) none of the mentioned options
d) public prototype(){ }

Q.25 What will be the output of the following code?


public clas Example{
public static void main(String [] args){
String s1=new String(“hello”);
String s2=”hello”;
String s3=s1.intern();
System.out.println(s1==s2);
System.out.println(s2==s3);
}
}

a) True
True

b) False
True

c) True
False
d) False
False

Q.26 We have created a final class names “student” . It has one final data member, a
parameterized constructor and getter method

public final class Student{


final String pancardnumber;
public Student(String pancardnumber){
this.pancardnumber=pancardnumber;
}

public String getpancardnumber(){


return pancardnumber;
}

For which of the following statement the above classes are immutable?

1. We can change the value of the instance variable after creating an object.
2. The class is final so we cannot create the subclass.
3. There are no setter methods

Choose the correct option:


a) All 1, 2 and 3
b) Only 1 and 3
c) Only 2 and 3
d) Only 1

Q.27 What will be the output of the following code?

import java.util.*;
import java.lang.*;
import java.io.*;

class MyTest{
public static void main(String [] args){
char [] chars = new char[](‘\u0097’);
String str=new String(chars);
byte[]=str.getBytes();
Sytem.out.println(Arrays.toString(bytes));
}
}

a) [-62 -105]
b) [-32 -75]
c) [-60 -85]
d) Compile time Error
Q.28 what will be the output of following code:
import java.util.*;
public class Main{
public static void main(String[] args)
{
LinkedList l=new LinkedList();
l.add(new Integer(9));
l.add(new Integer(5));
l.add(new Integer(8));
l.add(new Integer(4));
Iterator it=l.iterator();
Collections.reverse(l);
Collections.sort(l);
while(it.hasNext())
System.out.print(it.next()+" ");
}
}

Answer :- 4 5 8 9

Q.29 what will be the output of following code:


class Connecting{
public static void main(String [] args){
try{
int a=0;
int b=5;
int c=a/b;
System.out.println(“Connect”);
}
catch(Exception e){
System.out.println(“Company”);
}
}
}

a) Connect
b) Runtime Error
c) Compile Time Error
d) Company

Q.30 As stop() method is deprecated which of the following method can be used to
terminate or stop infinitely running thread in java ?

1. Infinitely running thread can be stopped using Boolean variable


2. Infinitely running thread can be stopped using interrupt() method
3. Infinitely running thread can be stopped using terminate() method

All 1,2 and 3


Only 2 and 3
Only 1 and 3
Only 1 and 2
Computer Fundamentals

Question1: What is the use of “Bcc” in emails?

1. It is used to let other recipients see an e-mail you sent without the main
recipient knowing.
2. It is used to send emails and disclose the receiver who else has received the
email.
3. It is used to send emails to only one receiver
4. It is used to attach images in emails

Ans: It is used to let other recipients see an e-mail you sent without the main
recipient knowing.

Question2: In which of the following cases we use “Forward” feature in emails?

1. To send the email to a colleague who is not on the To or Cc lines.


2. To reply to the original sender and all other recipients on the To and Cc lines.

Ans: To send the email to a colleague who is not on the To or Cc lines.

Question3: Outlook express is a/an:

1. Email-client
2. Search engine
3. Website
4. Browser

Ans: Email-client

Question4: Cartesian product in relational algebra is:

1. a Unary operator
2. not defined
3. a Ternary operator
4. a Binary operator

Ans: a Binary operator

Question5: Which of the following is/are mandatory for sending an email?


1. The body of the email
2. The recipients of the email
3. The subject of the email
4. The signature of the email

Ans: The recipients of the email

Question6: While sending or receiving emails you see the terms “Cc”. What
does “Cc” stands for in terms of email?

1. Carbon Copy
2. Closed Caption
3. Content Copy
4. Copy Content

Ans: Carbon Copy

Question7: Which of the following is not a feature of the primary key?

1. Primary key will not allow integrated values


2. Primary key will not allow null values
3. Only one primary key is allowed per table
4. Primary key will not allow duplicate values

Ans: Primary key will not allow integrated values

Question8: In which of the following process the relation between two entities
is treated as a single entity?
1. isolation
2. Specialization
3. Generalization
4. Aggregation

Ans: Aggregation
Question9: While sending emails which option should be choose if you want to
put another person in a copy secretly?

1. Subject
2. Cc
3. Bcc
4. To

Ans: Bcc

Question10: Which language provides a command to retrieve records?


1. Data Control Language
2. Data Definition Language
3. Data Query Language
4. Transaction Control Language

Ans: Data Query Language

Question11: In DBMS, there are two tables, Teacher containing the information
about all the teachers in a school and Class containing information about
classes taught by the teachers, which of the following relationship will link
them?

1. Many to many
2. None of the mentioned options
3. One to one
4. One to many

Ans: Many to many

CODING Question
WAP to return the numbers of integers in given range (a-b), where numbers which are divisible by given
number a

public class Solution{


public static int numbers(int a, int b)
{
//write your code here
}
}
Solution

public class Solution{


public static int numbers(int a, int b)
{
return a/b;
}
}
WAP to return sum of squares of numbers in given range (1-n).

public class Solution{


public static int sum(int n)
{
//write your code here
}
}
Solution:

public class Solution{


public static int sum(int n)
{
int result=0,i;
for(i=1;i<=n;i++)
{
result=result+(i*i);
}
return result;

}
}
WAP to return sum of numbers in given range (a-b), The numbers which are divisible by given number n

public class Solution{


public static int sum(int a, int b, int n)
{
//write your code here
}
}
Solution:

public class Solution{


public static int sum(int a, int b, int n)
{
int s=0,i;
for(i=a;i<=b;i++)
{
if(i%n==0)
sum=sum+i;
}
return s;
}
}
WAP to return the count of numbers from 1 to n, The numbers which are divisible by either 5 or 7

public class Solution{


public static int count(int n)
{
//write your code here
}
}
Solution:

public class Solution{


public static int count(int n)
{
int c=0,i;
for(i=1;i<=n;i++)
{
if(i%5==0 || i%7==0)
c++;
}
return c;

}
}
WAP to return the sum of marks (a,b,c)
Assumptions:
I: a>=0, b>=0, c>=0
II: passing marks: >=40
III: Return the sum of marks if it is >=40

public class Solution{


public static int sumOfMarks(int a, int b, int c)
{
//write your code here
}
}
Solution:

public class Solution{


public static int sumOfMarks(int a, int b, int c)
{
if(a<40)
a=0;
if(b<40)
b=0;
if(c<40)
c=0;
return a+b+c;
}
}
WAP to return the difference between sum of cube of n and m and sum of square of n and m

public class Solution{


public static int difference(int n, int m)
{
//write your code here
}
}
Solution:

public class Solution{


public static int difference(int n, int m)
{
return ((n*n*n+m*m*m)-(n*n+m*m));
}
}
WAP to calculate the runrate of team when target, runs required in an over and number of balls remaining is
given:

public class Solution{


public statin int RunRate(int runs, int balls, int target)
{
//write your code here
}

Solution:

public class Solution{


public statin int RunRate(int runs, int balls, int target)
{
return (target-runs)*6/balls;
}

}
Written English Paragraph:-
200 words

1.People are harming themselves and others by not following traffic rules ?

2.what influence does cinema have on our society ?

You might also like