Tuesday, 22 January 2013

AMCAT Exam Info (for Graduates)

Hi

Just want to tell you something about the AMCAT Exam organized on recent date.
(We have an agreement that we can't tell about the questions, but i can tell you about the Procedure of appearing,Subjects,No. of Questions, Level of Difficulty and main topics of the questions)

Procedure:

1. Open www.myamcat.com.
2. Register your name, you must have a valid email-ID.
3. Check the availability of the exam center near your Location.
4. Enroll, select the date and slot time and pay the amount(Net banking,Credit card or Demand Draft).
5. Give the exam on the specified date and wait for the email for result.  

Exam Scenario:

First of all Subjects w.r.t to CSE (Computer Science Eng) and Graduation or B.Tech field:

         Subjects                   Questions      Level of
                                                           Difficulty
1. Quantitative Aptitude      about 25       Easy
2. English                           about 25       Medium
3. Logical Reasoning            about 35       Medium
4. AMPI (Personality based)  90 Questions  Very Easy
5. C++, Java, Unix, SQl        about 25       Medium
    (any two)           
6. Computer programming    about 25       Easy

1. Quant
mainly based on
i.  Logarithms
ii. Permutation combination
iii.Pipe problems
iv. Arithmetic


2. English
i.  Synonyms
ii. Antonyms
iii.Fill in the blanks
iv.Assumption Questions


3. Logical
i. Direction problems
ii. Reasoning
iii.Arrangements
iv.Blood Relation problems

4. AMPI
i. There is no right or wrong answers, this is just a check of your personality.You have to answer 90 questions in just 20 mins.
ii. lots of repeatition of the same questions So stick to your answer in every case.

5. Languages
i. Java
    a. Simple questions basically on Static.
    b. Programs to find output.
    c. To find errors in programs.
ii. SQL
    a. SQL queries output.
    b. Join based queries.
    
6. Computer programming
i. Algorithm based questions
ii. Questions based on output.

Thursday, 17 January 2013

JAVA : Double value in String (Comparing Values)



public class doubleinstring 
{
public static void main(String args[])
{
System.out.println("Inside main");

boolean returnvalue=comparechk(".21999" , ".22");
System.out.println("equal true else false for .21999 , .22 ::"+returnvalue);

returnvalue=comparechk(".2" , "0.2");
System.out.println("equal true else false for .2 and 0.2 ::"+returnvalue);

returnvalue=comparechk("2" , "2.0");
System.out.println("equal true else false for 2 and 2.0 ::"+returnvalue);

returnvalue=comparechk("0.44500000000000001" , ".445");
System.out.println("equal true else false for 0.44500000000000001 and .445          ::"+returnvalue);

returnvalue=comparechk("0.29499999999999998" , ".295");
System.out.println("equal true else false for 0.29499999999999998 and .295  ::"+returnvalue);

returnvalue=comparechk("234.33" , "234.329999");
System.out.println("equal true else false for 234.33 and 234.329999 ::"+returnvalue);

returnvalue=comparechk("0.0" , "0");
System.out.println("equal true else false for 0 & 0.0 ::"+returnvalue);

returnvalue=comparechk("" , "");
System.out.println("equal true else false for empty  & empty ::"+returnvalue);
}
public static boolean comparechk(String a, String b)
{
boolean result=false;

if(!a.equals("")&&!a.equals(""))
{
Double s= Double.valueOf(a);
BigDecimal bd1 = new BigDecimal(s);
bd1 = bd1.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.println("s  rounded value ::"+bd1);

Double s1= Double.valueOf(b);
BigDecimal bd = new BigDecimal(s1);
bd = bd.setScale(3, BigDecimal.ROUND_HALF_UP);
System.out.println("s1 value ::"+bd);
if(bd1.equals(bd))
{
result= true;
}
}
return result; 
}
}


Thursday, 10 January 2013

Digit sum VS Sum of digits + JAVA Code


Sum Of Digits : It is the sum of all the digits of a number(given) and we are list bothered about the result.
Eg.  Given Number   ->   5982
       Sum of digits     :    5+9+8+2 =24             Result is 24
       Note
       Here, result can be a single digit or multiple digit.

Digit Sum : It is also the sum of digits but we have to add the digits till it become a single digit number.
Eg.  Given Number->  5982
       Digit sum       :   5+9+8+2 = 24 but we have to sum the digits again as 24 is not a single digit
                                2+4=6                          Result is 6
       Note:
       Here, final result will always be as single digit number.
(Shortcut to get Digit sum)
Digit sum is the remainder we get after dividing the number by 9
eg.   5982%9  = 6    where % specifies modulus used to find remainder.    


JAVA Code for Sum of Digits

public class sumOfDigits
{
public static void main (String args[])
{
int number =5982;
int sum=0;
int variable;
while(number>0)
{
variable=number%10;
sum=sum+variable;
number=number/10;
}
System.out.println("Sum of Digits is : "+sum);
}
}  


JAVA Code for Digit Sum


public class DigitSum 
{
public static void main (String args[])
{
int number =5982;
int sum=0;
int variable;
while(number>9)
{
while(number>0)
{
variable=number%10;
sum=sum+variable;
number=number/10;
}
number=sum;
sum=0;
}
System.out.println("Sum of Digits is : "+number);
}
}             
       

Tuesday, 8 January 2013

Simple puzzles

Q1 We have trees in all 26 rows and 26 columns. And we want to put a golden flower in between any two trees So can you tell us the number of flowers needed to buy so that they can be planted.

Ans  : we have three concerns to find the number of flowers
         i.  Rows(R)
         ii. Columns(C)
         iii.Diagonal alignment(D)
         So, Number is     26*25(R)+26*25(C)+25*25(D) 
        

Monday, 7 January 2013

JAVA Versions difference

1) Java 7  (Code named Dolphin and released on July 28, 2011)
  • Strings in switch Statement.
  • Type Inference for Generic Instance Creation.
  • Multiple Exception Handling.
  • Support for Dynamic Languages.
  • Binary Literals, underscore in literals.
  • Automatic null Handling.
  • New file I/O library to enhance platform independence and add support for metadata and symbolic links. The new packages are java.nio.file and java.nio.file.attribute.
  • Upstream updates to XML and Unicode.

2)  Java 6  (Code named Mustang and released on December 11, 2006)
  • Scripting Language Support
  • JDBC 4.0 API Support
  • Java Compiler API : an API allowing a Java program to select and invoke a Java Compiler programmatically.
  • Pluggable Annotations.
  • Native PKI, Java GSS, Kerberos and LDAP support.
  • Integrated Web Services.
  • Lot more enhancements.

3)  Java 5  (Code named Tiger and released on September 30, 2004)
  • Generics
  • Enhanced for Loop
  • Autoboxing/Unboxing
  • Typesafe Enums
  • Varargs
  • Static Import
  • Metadata (Annotations)

4)  Java 1.4  (Code named Merlin and released on February 6, 2002)
  • XML Processing.
  • Java Print Service.
  • Logging API.
  • Java Web Start.
  • JDBC 3.0 API.
  • Assertions.
  • Preferences API.
  • Chained Exception.
  • IPv6 Support.
  • Regular Expressions.
  • Image I/O API.
5)  Java 1.3  (Code named Kestrel and released on May 8, 2000)
  • Java Sound
  • Jar Indexing
  • A huge list of enhancements in almost all the java area.
6)  Java 1.2  (Code named Playground and released on December 8, 1998)
  • Collections framework.
  • Java String memory map for constants.
  • Just In Time (JIT) compiler.
  • Jar Signer for signing Java ARchive (JAR) files.
  • Policy Tool for granting access to system resources.
  • Java Foundation Classes (JFC) which consists of Swing 1.0, Drag and Drop, and Java 2D class libraries.
  • Java Plug-in.
  • Scrollable result sets, BLOB, CLOB, batch update, user-defined types in JDBC.
  • Audio support in Applets.
7)  Java 1.1  (Released on February 19, 1997)
  • JDBC (Java Database Connectivity)
  • Inner Classes
  • Java Beans
  • RMI (Remote Method Invocation)
  • Reflection (introspection only)
8)  Java 1.0  (Code named Oak and released on January 23, 1996.)

Weighing Puzzles

Q1 We have one weighing balance and we can measure a thing weighing upto 100Kg and     we can put weight only on one Side. Can you tell us the minimum number of weighing bars needed to measure any weight between 1kg to 100kg.

Ans :
       i.  To start with it should be 1.
       ii. 2kg is required aftr tht and no need of 3kg bar as we can do with (2+1)
       iii.Next we need 4 kg  and not 5kg as we can use(4+1).

       So after close look we have some match i.e

       1,2,4,8,....till number less than 100 which is 64
       2^0, 2^1,2^2....till 2^6
       i.e power of 2(starting from 0 to 6). 

       So Result is 7.

Q2  We have one weighing balance and we can measure a thing weighing upto 100Kg and     we can put weight on both Sides. Can you tell us the minimum number of weighing bars needed to measure any weight between 1kg to 100kg.

Ans :
       Similar to the discussion  as above...
       Here, series goes like
       1,3,9,27,81
       3^0,3^1,3^2....till the number less than the needed

       So Result 5.
      



PYAR KA WAR-1

                              "PYAR KA WAR "

1)   Ek bar apni ek dost ke pass, le gaya main phul
      usne dekh kar kahan, mujhe nahi hai kabul
      maine kahan, ek baar meri baat to sun lete
      usne kahan, jo sune apki baat use hi kyon nahi dete!!!

      Beparwah ho kar, gaya dusri ladki ki aur
      usko dekhte hi, ho gaya uski ankhon ka main chor
      madhosh ho kar, betha dekhta raha usko
      itne main police aa gayi aur boli idhar se khisko

      Tisri ke pass jab main tyari ke sath pahuncha
      usne bade pyar se dekhaa aur mujhse pucha
      maine use kahan, apse pyaar mujhe hai ho gaya
      mar mere face pe ghussa, uska boyfriend usko le gaya!!!

      Tin try karne ke bad, main phir ruk gaya
      Socha bas bahut hua, aaj kota pura ho gaya
      dil pe patahar rakh kar, liya ye decision
      ki aaj mera din nahi aur next day phir shuru kiya revision... :)


      By " Sumit Kumar " 
      (if you like it, wait for the Sequel, will be published soon :) )

2)   Zindagi ki raahon main saal kai aaye,
      kuch acche aur kuch gham ke saaye,
      Rab se ye dua hai hamari,
      ki ye saal apki khushiyon ki bahaar le ke aaye.
               "Happy New Year"

      

Friday, 4 January 2013

Thoughts Part1

1. Winners recognize their limitations but focus on their strengths,
    Losers recognize their strengths but focus on their weaknesses.

2. If you hate a person, you hate something in him that is a part of yourself,
   What isn't part of ourselves doesn't disturb us.

3. Argument is the worst sort of conversation.

4. Judge a man by his questions rather than by his answers.

5. The journey of a thousand miles must begin with a single step.