Skip to main content

Posts

Showing posts from March, 2012

Aptitude Questions - for Placements

1.If 2x-y=4 then 6x-3y=?
(a)15
(b)12
(c)18
(d)10

Ans. (b)
2.If x=y=2z and xyz=256 then what is the value of x?

(a)12
(b)8
(c)16
(d)6

Ans. (b)

3. (1/10)18 - (1/10)20 = ?
(a) 99/1020
(b) 99/10
(c) 0.9
(d) none of these
Ans. (a)

4.Pipe A can fill in 20 minutes and Pipe B in 30 mins
and Pipe C can
empty the same in 40 mins.If all of them work
together, find the time
taken to fill the tank
(a) 17 1/7 mins
(b) 20 mins
(c) 8 mins
(d) none of these
Ans. (a)

5. Thirty men take 20 days to complete a job working 9
hours a day.How
many hour a day should 40 men work to complete the
job?
(a) 8 hrs
(b) 7 1/2 hrs
(c) 7 hrs
(d) 9 hrs
Ans. (b)
6. Find the smallest number in a GP whose sum is 38
and product 1728
(a) 12
(b) 20
(c) 8
(d) none of these
Ans. (c)

7. A boat travels 20 kms upstream in 6 hrs and 18 kms
downstream in 4
hrs.Find the speed of the boat in still water and the
speed of the
water current?
(a) 1/2 kmph
(b) 7/12 kmph
(c) 5 kmph
(d) none of these
Ans. (b)

8. A goat is tied to one corner of a square plot of
side 12m by a rope
7m long.Find the …

What is Virtual Functions in C++

What is a virtual function?
One of the most talked about feature of object oriented programming. We have two types of polymorphism in C++. One is compile-time and the other is Run-time.
Virtual function is a use to achieve run-time polymorphism.Refers to performing the same operation in a hierarchy of classes. Typically used in scenarios where the base class pointer is used to hold derived class objects and perform the same operation. See the example below.When a virtual functions is called on a base class pointer the compiler decides to defer the decision on which function to call until the program is running thereby doing late binding.The actual function called at run-time depends on the contents of the pointer and not the type.Internally the compiler creates a Vtable for each class which has virtual functions or derived from base class.Addresses of virtual functions are placed in the Vtable . If a virtual function is not redefined in the derived class, the base class funct…

MCA SEM-4 Exam Time Table - Mumbai University

The written examination will be conducted in the following order :

Days and Dates Time Paper
------Wednesday, May 16, 2012
 03:00 p.m. to 06:00 p.m.

Software Project Management.

------Friday, May 18, 2012
03:00 p.m. to 06:00 p.m.

Java Programming

-------Monday, May 21, 2012
03:00 p.m. to 06:00 p.m.

Network Security

------Wednesday, May 23, 2012
 03:00 p.m. to 06:00 p.m.

Object Oriented Modeling & Design Using U M L

------Friday, May 25, 2012
 03:00 p.m. to 06:00 p.m.

Advance Database Techniques

------Monday, May 28, 2012
 03:00 p.m. to 06:00 p.m.

Elective I :Embedded Systems
Elective I : Geographic Information System
Elective I : Customer Relationship Management
Elective I : Artificial Intelligence
Elective I : E-Bussiness

Type Declaration Instruction:

This instruction is used to declare the type of variables being used in the program. A variable is a location in RAM (main memory) for temporary storage of intermediate data. Any variable used in the program must be declared before using it in any statement. The type declaration statement is written at the beginning of main() function.
Ex:int bas; floatrs, grosssal; charname, code;
These are several subtle variations of the type declaration instruction.
i) While declaring the type of variable we can also initialize it as shown below:
int i=10, j=25; float a=1.5, b= 1.99+2.4 * 1.45 ; ii)The order in which we define the variables is sometimes important sometimes not. For exa:
int i=10,j=20;
is same as int j=20, i=10;
However,
float a =1.2, b=a+3.1; is alright, but
float b=a+3.1, a=1.2;
is not.this is because here we are trying to use a even before defining it.
iii) Similarly int a,b,c,d; a=b=c=10; is O.K. but
int a=b=c=d=10;
will not work.( find out why ???)

The layout of C Programs

The general form of a C program is as follows:
pre-processor directivesglobal declarationsmain(){local variables to function main ;statements associated with function main ;}f1(){local variables to function 1 ;statements associated with function 1 ;}f2(){local variables to function f2 ;statements associated with function 2 ;}...etc
Note the use of the bracket set () and {}. () are used in conjunction with function names whereas {} are used as to delimit the C statements that are associated with that function. Also note the semicolon - yes it is there, but you might have missed it! a semicolon (;) is used to terminate C statements. C is a free format language and long statements can be continued, without truncation, onto the next line. The semicolon informs the C compiler that the end of the statement has been reached. Free format also means that you can add as many spaces as you like to improve the look of your programs.

Fundamental Building Blocks of Programs

There are two basic aspects of programming: data and instructions. To work with data, you need to understand variables and types; to work with instructions, you need to understand control structures and subroutines. You'll spend a large part of the course becoming familiar with these concepts.
A variable is just a memory location (or several locations treated as a unit) that has been given a name so that it can be easily referred to and used in a program. The programmer only has to worry about the name; it is the compiler's responsibility to keep track of the memory location. The programmer does need to keep in mind that the name refers to a kind of "box" in memory that can hold data, even if the programmer doesn't have to know where in memory that box is located.
In Java and in many other programming languages, a variable has a type that indicates what sort of data it can hold. One type of variable might hold integers -- whole numbers such as 3, -7, and …

Factorial of Number - Java

import java.io.*;
class Factorial
{
public static void main(String [] args)
{
try
{
BufferedReader object= new BufferedReader(new InputStreamReader(System.in));
int num,i;
System.out.println("Enter the Number to Calculate the Factorial");
num=Integer.parseInt(object.readLine());
int factorial=1;
System.out.println("The FACTORIAL OF Number"+num+"is:");
for(i=1;i<=num;i++)
{
factorial=factorial*i;
}
System.out.println("The FACTORIAL is"+factorial);
}
catch(Exception e)
{
}
}
}

Swapping Two Numbers in Java

class Swapper
{
    int a=23, b=32, temp;
    void before()
    {   
        System.out.println("The values of a and b Before swapping are");
        System.out.println("A="+a+"B="+b);
    }

    void swapping()
    {
        temp=a;
        a=b;
        b=temp;
    }

    void after()
    {
        System.out.println("The values of a and b After swapping are");
        System.out.println("A="+a+"B="+b);
    }
}

class Swapp
{
    public static void main(String [] arg)
    {
        Swapper s1= new Swapper();
        s1.before();
        s1.swapping();
        s1.after();
    }
}

Hello World - Your First Program (C# Programming Guide)

The following procedure creates a C# version of the traditional "Hello World!" program. The program displays the string Hello World! To create and run a console applicationStart Visual Studio.On the File menu, point to New, and then click Project.In the Templates Categories pane, expand Visual C#, and then click Windows.In the Templates pane, click Console Application.Type a name for your project in the Name field.Click OK.
The new project appears in Solution Explorer.If Program.cs is not open in the Code Editor, right-click Program.cs in Solution Explorer and then click View Code.Replace the contents of Program.cs with the following code.
C# // A Hello World! program in C#.using System; namespace HelloWorld { class Hello { staticvoid Main() { Console.WriteLine("Hello World!"); // Keep the console window open in debug mode. Console.WriteLine("Press any key to exit."); Console.Read…

Variables in PHP - Create, Assign, Display

A variable is used in PHP scripts to represent a value. As the name variable suggests, the value of a variable can change (or vary) throughout the program. Variables are one of the features that distinguish a programming language like PHP from markup languages such as HTML.
Variables allow you write your code in a generic manner. To highlight this, consider a web form which asks users to input their name and favorite color.


Every time the form is completed, the data will be different. One user may say his name is John and his favorite color is blue. Another may say her name is Susan and her favorite color is yellow. We need a way of working with the values a user enters. The way to do this is by using variables.
There are a few standard variables that PHP creates automatically, but most of the time variables are created (or declared) by you, the programmer. By creating two variables called $name and $color, you could create generic code which can handle any input values. …

What is Java Virtual Machine (JVM)

--------------Note on JavaVirtual Machine--------------
• The Java Language runs on a “Java Virtual Machine”
– Java Virtual machine abstracts away the details of theunderlying platform and provides a uniform environment for executing Java“byte-code”
• The Java compiler (javac) compiles Java code intobyte-code
– Bytecode is an intermediate form which can run on theJVM
– JVM does the translation from byte-code to machine-codein a platform dependent way.

Explain Difference between Java and C++

C++

Java
C++ is a complex language

Java is Simple Language
C++ has signed and unsigned data types

By default, all data types in java are signed( Exception char)
Characters in C++ are 8 bit and 16 bit chars are represented by wide character types

By default all the characters 16 bit and supports Unicode
C++ supports pointers and pointer arithmetic

No low-level pointers or pointer arithmetic.
Instead have variables and expressions of reference type.
Objects needs to be deallocated explicitly using destructors

Objects are Garbage collected automatically
Variables can be used before its initialization

No Variable can be used before its initialization
Array bounds are not checked by default

Strict array bounds checking
No built in support for multithreading.

Built in support for multithreading
Struct,union , typedef available

No struct, union, typedef—classes and objects are used uniformly instead.
C++ platform dependent

Java is platform independent and machine independent
C++ is less Secure

Java is more Secure

Explain Features of Java - Introduction

1) Simple
• Similar to C/C++ in syntax
• But eliminates several complexities of
– No operator overloading
– No direct pointer manipulation or pointer arithmetic
– No multiple inheritance
– No malloc() and free() – handles memory automatically
– Garbage Collector
• Lots more things which make Java more attractive.
2) Object-Oriented
• Fundamentally based on OOP
– Classes and Objects
– Uses a formal OOP type system
– Lends an inherent structure/organization for how wewrite Java programs
• Unlike spaghetti code in languages like Perl
– Efficient re-use of packages such that the programmeronly cares about the interface and not the implementation
3) Distributed / Network Oriented
• Java grew up in the days of the Internet
– Inherently network friendly
– Original release of Java came with Networking libraries
– Newer releases contain even more for handlingdistributed applications
• RMI, Trans…

JAVA Tutorial 1- Introduction to Java

•Java was developed by James Goslingat Sun Microsystems in 1991. •His Original Aim was to develop a low cost, Hardware Independent Language based on C++. •Due to technical reasons that idea was dropped. •A new programming Language called Oak was developed based on C++. •The language oak was developed by removing undesirable features of C++. •Those features include: •Multiple Inheritance •Automatic type conversions •Use of pointers •Memory Management. •By 1994 the World Wide Web Emerged and Oak was Re-named as Java.

PL/SQL to Create or Replace Triggers, Varray and nested tables

Question: 1)
Create orreplace trigger trig_msg after update ordelete or insert on customer for each row
Code:
declare
oper varchar2(10);
begin
if updating then
DBMS_OUTPUT.PUT_LINE('UPDATING');
end if;
if deleting then
DBMS_OUTPUT.PUT_LINE('DELETING');
end if;
if inserting then
DBMS_OUTPUT.PUT_LINE('INSERTING');
end if;
end;
SQL> set serveroutput on;
SQL> insert into customer values(1,'vish','delhi',500,'21-jan-2001');
INSERTING
1 row created.
SQL> delete from customer where loanno = 1;
DELETING
1 row deleted.
Question 2)
create or replace trigger trig_nodml after update orinsert or delete on loan for each row
Code:
declare
m varchar2(15);
begin
if updating then
RAISE_APPLICATION_ERROR(-20000,'NO UPDATE ALLOWED');
end if;
if deleting then
RAISE_APPLICATION_ERROR(-20000,'NO DELETING ALLOWED');
end if;
if inserting then
m:=TO_CHAR(sysdate,'DAY');
if (upper(m)<> upper('sunday')) then
RAIS…

Advanced Database Techniques Practical - Experiment No.1

PRACTICAL NO. 1

Create tables as per following definitions.

Deposit3 :
Actno
Cname
Brname
Amount
Date

SQL> create table deposit3
(actno number(5),cname varchar(20),brname varchar2(20),amount number(10,2),dt date);

Table created.


Branch3 :
Brid
Brname
City
Ins_date
Update_date

SQL> create table branch3
(brid varchar2(20), brname varchar2(20),city varchar2(20),insdate date,update_date date);

Table created.


Customer3 :
Custid
Cname
City
ins_date
update_date

SQL> create table customer3
          (custid varchar2(20), cname varchar2(20),city varchar2(20),insdate date,update_date date);

Table created.


Borrow3 :
loanno
custname
brname
amount
ins_date

SQL> create table borrow3
          (loanno number(10), custname varchar2(20),brname varchar2(20),amount number(10,2),insdate date);

Table created.


Describe all tables.

SQL> desc deposit3

 Name        Null?        Type
-------------------------------------------------------------------
 ACTNO             NUMBER(5)
 CNAME      …

IMPORTANT ANNOUNCEMENT FOR IBPS SPECIALIST OFFICERS EXAM ON 11.03.2012

The Common Written Examination for recruitment of Specialist Officers in 19 Public Sector
Banks will be held on 11.03.2012.  
The examination will be held in one or two sessions at different centres.
No correspondence regarding change of centre of examination/ time  of examination/ post will be entertained.
An email has already been sent to your email addresss specified in your online application  advising you to download the Call Letter for the Written Examination from 28.02.2012 to  10.03.2012. Please take a printout of the call letter in case you have not already done so.   Please note the time mentioned in the call letter.  Please report at the venue for Written
Examination at least 30 minutes prior to the time printed in the call letter (i.e. 8.30 a.m./ 1.00
p.m.). Candidates who report late will not be permitted to take the examination.
The “Acquaint Yourself Booklet” has also been made available on the IBPS website. You may
download the Booklet and study it carefully.
Ple…

Maharashtra Common Entrance test (MAH CET) exam, the biggest state level MBA entrance exam for pursuing MBA in Maharashtra date has been postponed.

Maharashtra Common Entrance test (MAH CET) exam, the biggest state level MBA entrance exam for pursuing MBA in Maharashtra date has been postponed. Directorate of Technical Education (DTE), the body that conducts the exam, mentions in its website, “The CET is rescheduled on 11 March 2012 instead of 26 February 2012. “

On November 1, 2011, DTE had announced that the date of MAH CET for the programs MBA, MMS, PGDBM and PGDM courses would be held on Sunday, February 26, 2012. However, in a recent update, it has been confirmed by DTE that the date for MAH CET 2012 has been postponed to Sunday, March 11, 2012. DTE also states that the Information brochure of the exam will be published soon.

The reason for this postponement is possibly due to the dates of the AICTE CMAT exam. The CMAT exam, which is scheduled from February 20 to February 28, 2012, is clashing with the date of the MAH CET 2012 exam which was earlier scheduled for February 26, 2012.

MAH CET 2011 was held on Sunday, February…